Skip to content

Commit

Permalink
[AutoPR resources/resource-manager/managementgroups/resource-manager]…
Browse files Browse the repository at this point in the history
… Move ManagementGroups out of Resources to a separate folder (#1968)

* Generated from 6d8ea2134bc8155bd6162598d67880cd68a2c31d

Revert go output folder

* Packaging for azure-mgmt-managementgroups
  • Loading branch information
AutorestCI authored and lmazuel committed Feb 22, 2018
1 parent af67c66 commit 6a79793
Show file tree
Hide file tree
Showing 28 changed files with 1,978 additions and 0 deletions.
9 changes: 9 additions & 0 deletions azure-mgmt-managementgroups/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:
Release History
===============

0.1.0 (1970-01-01)
++++++++++++++++++

* Initial Release
2 changes: 2 additions & 0 deletions azure-mgmt-managementgroups/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include *.rst
include azure_bdist_wheel.py
49 changes: 49 additions & 0 deletions azure-mgmt-managementgroups/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure Management Groups Client Library.

Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.

For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Compatibility
=============

**IMPORTANT**: If you have an earlier version of the azure package
(version < 1.0), you should uninstall it before installing this package.

You can check the version using pip:

.. code:: shell
pip freeze
If you see azure==0.11.0 (or any version below 1.0), uninstall it first:

.. code:: shell
pip uninstall azure
Usage
=====

For code examples, see `Management Groups
<https://docs.microsoft.com/python/azure/>`__
on docs.microsoft.com.


Provide Feedback
================

If you encounter any bugs or have suggestions, please file an issue in the
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
section of the project.
1 change: 1 addition & 0 deletions azure-mgmt-managementgroups/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
1 change: 1 addition & 0 deletions azure-mgmt-managementgroups/azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .management_groups_api import ManagementGroupsAPI
from .version import VERSION

__all__ = ['ManagementGroupsAPI']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import ServiceClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.management_groups_operations import ManagementGroupsOperations
from .operations.management_group_subscriptions_operations import ManagementGroupSubscriptionsOperations
from .operations.operations import Operations
from . import models


class ManagementGroupsAPIConfiguration(AzureConfiguration):
"""Configuration for ManagementGroupsAPI
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param str base_url: Service URL
"""

def __init__(
self, credentials, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(ManagementGroupsAPIConfiguration, self).__init__(base_url)

self.add_user_agent('azure-mgmt-managementgroups/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials


class ManagementGroupsAPI(object):
"""The Azure Management Groups API enables consolidation of multiple
subscriptions/resources into an organizational hierarchy and centrally
manage access control, policies, alerting and reporting for those resources.
:ivar config: Configuration for client.
:vartype config: ManagementGroupsAPIConfiguration
:ivar management_groups: ManagementGroups operations
:vartype management_groups: azure.mgmt.managementgroups.operations.ManagementGroupsOperations
:ivar management_group_subscriptions: ManagementGroupSubscriptions operations
:vartype management_group_subscriptions: azure.mgmt.managementgroups.operations.ManagementGroupSubscriptionsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.managementgroups.operations.Operations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param str base_url: Service URL
"""

def __init__(
self, credentials, base_url=None):

self.config = ManagementGroupsAPIConfiguration(credentials, base_url)
self._client = ServiceClient(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2017-11-01-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.management_groups = ManagementGroupsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.management_group_subscriptions = ManagementGroupSubscriptionsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .error_details import ErrorDetails
from .error_response import ErrorResponse, ErrorResponseException
from .operation_display import OperationDisplay
from .operation import Operation
from .management_group_info import ManagementGroupInfo
from .parent_group_info import ParentGroupInfo
from .management_group_details import ManagementGroupDetails
from .management_group_child_info import ManagementGroupChildInfo
from .management_group import ManagementGroup
from .create_management_group_request import CreateManagementGroupRequest
from .management_group_info_paged import ManagementGroupInfoPaged
from .operation_paged import OperationPaged

__all__ = [
'ErrorDetails',
'ErrorResponse', 'ErrorResponseException',
'OperationDisplay',
'Operation',
'ManagementGroupInfo',
'ParentGroupInfo',
'ManagementGroupDetails',
'ManagementGroupChildInfo',
'ManagementGroup',
'CreateManagementGroupRequest',
'ManagementGroupInfoPaged',
'OperationPaged',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CreateManagementGroupRequest(Model):
"""Management group creation parameters.
:param display_name: The friendly name of the management group.
:type display_name: str
:param parent_id: (Optional) The fully qualified ID for the parent
management group. For example,
/providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
:type parent_id: str
"""

_attribute_map = {
'display_name': {'key': 'displayName', 'type': 'str'},
'parent_id': {'key': 'parentId', 'type': 'str'},
}

def __init__(self, display_name=None, parent_id=None):
super(CreateManagementGroupRequest, self).__init__()
self.display_name = display_name
self.parent_id = parent_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ErrorDetails(Model):
"""The details of the error.
:param code: One of a server-defined set of error codes.
:type code: str
:param message: A human-readable representation of the error.
:type message: str
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, code=None, message=None):
super(ErrorDetails, self).__init__()
self.code = code
self.message = message
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from msrest.exceptions import HttpOperationError


class ErrorResponse(Model):
"""The error object.
:param error: Error.
:type error: ~azure.mgmt.managementgroups.models.ErrorDetails
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorDetails'},
}

def __init__(self, error=None):
super(ErrorResponse, self).__init__()
self.error = error


class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.
:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ManagementGroup(Model):
"""The management group details.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: The fully qualified ID for the management group. For example,
/providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
:vartype id: str
:ivar type: The type of the resource. For example,
/providers/Microsoft.Management/managementGroups
:vartype type: str
:ivar name: The name of the management group. For example,
00000000-0000-0000-0000-000000000000
:vartype name: str
:param tenant_id: The AAD Tenant ID associated with the management group.
For example, 00000000-0000-0000-0000-000000000000
:type tenant_id: str
:param display_name: The friendly name of the management group.
:type display_name: str
:param details: Details.
:type details: ~azure.mgmt.managementgroups.models.ManagementGroupDetails
:param children: The list of children.
:type children:
list[~azure.mgmt.managementgroups.models.ManagementGroupChildInfo]
"""

_validation = {
'id': {'readonly': True},
'type': {'readonly': True},
'name': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'tenant_id': {'key': 'properties.tenantId', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'details': {'key': 'properties.details', 'type': 'ManagementGroupDetails'},
'children': {'key': 'properties.children', 'type': '[ManagementGroupChildInfo]'},
}

def __init__(self, tenant_id=None, display_name=None, details=None, children=None):
super(ManagementGroup, self).__init__()
self.id = None
self.type = None
self.name = None
self.tenant_id = tenant_id
self.display_name = display_name
self.details = details
self.children = children
Loading

0 comments on commit 6a79793

Please sign in to comment.