Skip to content

Commit

Permalink
azure-mgmt-managementgroups 0.1.0 (#2520)
Browse files Browse the repository at this point in the history
* [AutoPR managementgroups/resource-manager] Remove EntityViewParameter from Entities Call (#2111)

* Generated from 174778e3f250ad04c3732590fdcb430b1bbc9576

Remove entities-view-parameter from swagger

* Generated from 174778e3f250ad04c3732590fdcb430b1bbc9576

Remove entities-view-parameter from swagger

* Generated from 0b1c989c20db1b55e669d6f9bb8554fc8e2e0547 (#2519)

Update package version

* Generated from cbc3675d0627d07b36dceb73ab730cdf3a416246 (#2554)

Fix error in the possible values for an enum

* [AutoPR managementgroups/resource-manager] Add Management Groups 2018-03-01-preview version (#2581)

* Generated from 025c1ca34a0b85e448d05127a5f62e5ede440884

Update to spec

* Generated from 8ba395542c266e46cd3ff941c6f958366a9027cb

Update to management groups spec

* Generated from 872ed7e01b10c9f5dec2a96bf660d365e2c21adb

Remove \n from descriptions, parameter method location and error fix

* Generated from 531b538181e453da3c8ca940ee38fe0010537bc8

remove long running op flags

* Generated from 56bfb36a30d8865b80bb9c60b2abdd959fff5849 (#2599)

Fix typo

* azure-mgmt-managementgroups 0.1.0

* VErsion
  • Loading branch information
AutorestCI authored and lmazuel committed May 31, 2018
1 parent bddfd35 commit 8fc953a
Show file tree
Hide file tree
Showing 56 changed files with 2,395 additions and 168 deletions.
2 changes: 1 addition & 1 deletion azure-mgmt-managementgroups/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Release History
===============

0.1.0 (1970-01-01)
0.1.0 (2018-05-31)
++++++++++++++++++

* Initial Release
2 changes: 1 addition & 1 deletion azure-mgmt-managementgroups/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Usage
=====

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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import ServiceClient
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from msrest.pipeline import ClientRawResponse
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
import uuid
from .operations.management_groups_operations import ManagementGroupsOperations
from .operations.management_group_subscriptions_operations import ManagementGroupSubscriptionsOperations
from .operations.operations import Operations
from .operations.entities_operations import EntitiesOperations
from . import models


Expand Down Expand Up @@ -46,10 +51,8 @@ def __init__(
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.
class ManagementGroupsAPI(SDKClient):
"""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
Expand All @@ -60,6 +63,8 @@ class ManagementGroupsAPI(object):
:vartype management_group_subscriptions: azure.mgmt.managementgroups.operations.ManagementGroupSubscriptionsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.managementgroups.operations.Operations
:ivar entities: Entities operations
:vartype entities: azure.mgmt.managementgroups.operations.EntitiesOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
Expand All @@ -71,10 +76,10 @@ def __init__(
self, credentials, base_url=None):

self.config = ManagementGroupsAPIConfiguration(credentials, base_url)
self._client = ServiceClient(self.config.credentials, self.config)
super(ManagementGroupsAPI, self).__init__(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.api_version = '2018-03-01-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand All @@ -84,3 +89,167 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.entities = EntitiesOperations(
self._client, self.config, self._serialize, self._deserialize)

def check_name_availability(
self, check_name_availability_request, custom_headers=None, raw=False, **operation_config):
"""Checks if the specified management group name is valid and unique.
:param check_name_availability_request: Management group name
availability check parameters.
:type check_name_availability_request:
~azure.mgmt.managementgroups.models.CheckNameAvailabilityRequest
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: CheckNameAvailabilityResult or ClientRawResponse if raw=true
:rtype:
~azure.mgmt.managementgroups.models.CheckNameAvailabilityResult or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.managementgroups.models.ErrorResponseException>`
"""
# Construct URL
url = self.check_name_availability.metadata['url']

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
body_content = self._serialize.body(check_name_availability_request, 'CheckNameAvailabilityRequest')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('CheckNameAvailabilityResult', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
check_name_availability.metadata = {'url': '/providers/Microsoft.Management/checkNameAvailability'}

def start_tenant_backfill(
self, custom_headers=None, raw=False, **operation_config):
"""Starts backfilling subscriptions for the Tenant.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: TenantBackfillStatusResult or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.managementgroups.models.TenantBackfillStatusResult
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.managementgroups.models.ErrorResponseException>`
"""
# Construct URL
url = self.start_tenant_backfill.metadata['url']

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('TenantBackfillStatusResult', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
start_tenant_backfill.metadata = {'url': '/providers/Microsoft.Management/startTenantBackfill'}

def tenant_backfill_status(
self, custom_headers=None, raw=False, **operation_config):
"""Gets tenant backfill status.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: TenantBackfillStatusResult or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.managementgroups.models.TenantBackfillStatusResult
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.managementgroups.models.ErrorResponseException>`
"""
# Construct URL
url = self.tenant_backfill_status.metadata['url']

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('TenantBackfillStatusResult', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
tenant_backfill_status.metadata = {'url': '/providers/Microsoft.Management/tenantBackfillStatus'}
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,85 @@
# 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
try:
from .error_details_py3 import ErrorDetails
from .error_response_py3 import ErrorResponse, ErrorResponseException
from .operation_display_properties_py3 import OperationDisplayProperties
from .operation_py3 import Operation
from .check_name_availability_result_py3 import CheckNameAvailabilityResult
from .tenant_backfill_status_result_py3 import TenantBackfillStatusResult
from .management_group_info_py3 import ManagementGroupInfo
from .parent_group_info_py3 import ParentGroupInfo
from .management_group_details_py3 import ManagementGroupDetails
from .management_group_child_info_py3 import ManagementGroupChildInfo
from .management_group_py3 import ManagementGroup
from .operation_results_py3 import OperationResults
from .entity_parent_group_info_py3 import EntityParentGroupInfo
from .entity_info_py3 import EntityInfo
from .entity_hierarchy_item_py3 import EntityHierarchyItem
from .patch_management_group_request_py3 import PatchManagementGroupRequest
from .create_parent_group_info_py3 import CreateParentGroupInfo
from .create_management_group_details_py3 import CreateManagementGroupDetails
from .create_management_group_child_info_py3 import CreateManagementGroupChildInfo
from .create_management_group_request_py3 import CreateManagementGroupRequest
from .check_name_availability_request_py3 import CheckNameAvailabilityRequest
except (SyntaxError, ImportError):
from .error_details import ErrorDetails
from .error_response import ErrorResponse, ErrorResponseException
from .operation_display_properties import OperationDisplayProperties
from .operation import Operation
from .check_name_availability_result import CheckNameAvailabilityResult
from .tenant_backfill_status_result import TenantBackfillStatusResult
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 .operation_results import OperationResults
from .entity_parent_group_info import EntityParentGroupInfo
from .entity_info import EntityInfo
from .entity_hierarchy_item import EntityHierarchyItem
from .patch_management_group_request import PatchManagementGroupRequest
from .create_parent_group_info import CreateParentGroupInfo
from .create_management_group_details import CreateManagementGroupDetails
from .create_management_group_child_info import CreateManagementGroupChildInfo
from .create_management_group_request import CreateManagementGroupRequest
from .check_name_availability_request import CheckNameAvailabilityRequest
from .management_group_info_paged import ManagementGroupInfoPaged
from .operation_paged import OperationPaged
from .entity_info_paged import EntityInfoPaged
from .management_groups_api_enums import (
Reason,
Status,
Type,
)

__all__ = [
'ErrorDetails',
'ErrorResponse', 'ErrorResponseException',
'OperationDisplay',
'OperationDisplayProperties',
'Operation',
'CheckNameAvailabilityResult',
'TenantBackfillStatusResult',
'ManagementGroupInfo',
'ParentGroupInfo',
'ManagementGroupDetails',
'ManagementGroupChildInfo',
'ManagementGroup',
'OperationResults',
'EntityParentGroupInfo',
'EntityInfo',
'EntityHierarchyItem',
'PatchManagementGroupRequest',
'CreateParentGroupInfo',
'CreateManagementGroupDetails',
'CreateManagementGroupChildInfo',
'CreateManagementGroupRequest',
'CheckNameAvailabilityRequest',
'ManagementGroupInfoPaged',
'OperationPaged',
'EntityInfoPaged',
'Reason',
'Status',
'Type',
]
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 CheckNameAvailabilityRequest(Model):
"""Management group name availability check parameters.
:param name: the name to check for availability
:type name: str
:param type: fully qualified resource type which includes provider
namespace. Possible values include:
'/providers/Microsoft.Management/managementGroups'
:type type: str or ~azure.mgmt.managementgroups.models.Type
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'Type'},
}

def __init__(self, **kwargs):
super(CheckNameAvailabilityRequest, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.type = kwargs.get('type', None)
Loading

0 comments on commit 8fc953a

Please sign in to comment.