diff --git a/azure-mgmt-resource/MANIFEST.in b/azure-mgmt-resource/MANIFEST.in index 9ecaeb15de50..bb37a2723dae 100644 --- a/azure-mgmt-resource/MANIFEST.in +++ b/azure-mgmt-resource/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-resource/azure/__init__.py b/azure-mgmt-resource/azure/__init__.py index 849489fca33c..0260537a02bb 100644 --- a/azure-mgmt-resource/azure/__init__.py +++ b/azure-mgmt-resource/azure/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-resource/azure/mgmt/__init__.py b/azure-mgmt-resource/azure/mgmt/__init__.py index 849489fca33c..0260537a02bb 100644 --- a/azure-mgmt-resource/azure/mgmt/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/feature_client.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/feature_client.py index 3dfaec20c691..874b8d7d0248 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/feature_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/feature_client.py @@ -13,6 +13,9 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +import uuid from .operations.features_operations import FeaturesOperations from . import models @@ -79,3 +82,63 @@ def __init__( self.features = FeaturesOperations( self._client, self.config, self._serialize, self._deserialize) + + def list_operations( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.Features REST API operations. + + :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`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.resource.features.v2015_12_01.models.OperationPaged[~azure.mgmt.resource.features.v2015_12_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_operations.metadata = {'url': '/providers/Microsoft.Features/operations'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py index 59fc0c7f229d..534a16d30c90 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py @@ -12,13 +12,21 @@ try: from .feature_properties_py3 import FeatureProperties from .feature_result_py3 import FeatureResult + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation except (SyntaxError, ImportError): from .feature_properties import FeatureProperties from .feature_result import FeatureResult + from .operation_display import OperationDisplay + from .operation import Operation +from .operation_paged import OperationPaged from .feature_result_paged import FeatureResultPaged __all__ = [ 'FeatureProperties', 'FeatureResult', + 'OperationDisplay', + 'Operation', + 'OperationPaged', 'FeatureResultPaged', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation.py new file mode 100644 index 000000000000..458e37b3bd90 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation.py @@ -0,0 +1,33 @@ +# 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 Operation(Model): + """Microsoft.Features operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.features.v2015_12_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display.py new file mode 100644 index 000000000000..96c5847dd02d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display.py @@ -0,0 +1,37 @@ +# 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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Features + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display_py3.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display_py3.py new file mode 100644 index 000000000000..500ca2ade894 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_display_py3.py @@ -0,0 +1,37 @@ +# 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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Features + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_paged.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_paged.py new file mode 100644 index 000000000000..3205c43a4b5f --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_py3.py new file mode 100644 index 000000000000..0768baa3c0e6 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/operation_py3.py @@ -0,0 +1,33 @@ +# 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 Operation(Model): + """Microsoft.Features operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.features.v2015_12_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/management_link_client.py b/azure-mgmt-resource/azure/mgmt/resource/links/management_link_client.py index 99b3d0937bfc..81f030277fc7 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/management_link_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/management_link_client.py @@ -103,6 +103,19 @@ def models(cls, api_version=DEFAULT_API_VERSION): return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + @property + def operations(self): + """Instance depends on the API version: + + * 2016-09-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2016-09-01': + from .v2016_09_01.operations import Operations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def resource_links(self): """Instance depends on the API version: diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/management_link_client.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/management_link_client.py index 9820f661c595..398d9f9d208d 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/management_link_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/management_link_client.py @@ -13,6 +13,7 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.operations import Operations from .operations.resource_links_operations import ResourceLinksOperations from . import models @@ -55,6 +56,8 @@ class ManagementLinkClient(SDKClient): :ivar config: Configuration for client. :vartype config: ManagementLinkClientConfiguration + :ivar operations: Operations operations + :vartype operations: azure.mgmt.resource.links.v2016_09_01.operations.Operations :ivar resource_links: ResourceLinks operations :vartype resource_links: azure.mgmt.resource.links.v2016_09_01.operations.ResourceLinksOperations @@ -77,5 +80,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) self.resource_links = ResourceLinksOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/__init__.py index 80cdd1f9217a..c7f4a210c5cf 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/__init__.py @@ -13,10 +13,15 @@ from .resource_link_filter_py3 import ResourceLinkFilter from .resource_link_properties_py3 import ResourceLinkProperties from .resource_link_py3 import ResourceLink + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation except (SyntaxError, ImportError): from .resource_link_filter import ResourceLinkFilter from .resource_link_properties import ResourceLinkProperties from .resource_link import ResourceLink + from .operation_display import OperationDisplay + from .operation import Operation +from .operation_paged import OperationPaged from .resource_link_paged import ResourceLinkPaged from .management_link_client_enums import ( Filter, @@ -26,6 +31,9 @@ 'ResourceLinkFilter', 'ResourceLinkProperties', 'ResourceLink', + 'OperationDisplay', + 'Operation', + 'OperationPaged', 'ResourceLinkPaged', 'Filter', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation.py new file mode 100644 index 000000000000..6f99ca831b0b --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation.py @@ -0,0 +1,33 @@ +# 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 Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.links.v2016_09_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display.py new file mode 100644 index 000000000000..98e3ef7e561c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display.py @@ -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 + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display_py3.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display_py3.py new file mode 100644 index 000000000000..9579860dfd81 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_display_py3.py @@ -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 + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_paged.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_paged.py new file mode 100644 index 000000000000..21d8ee08cc45 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_py3.py new file mode 100644 index 000000000000..a81d9586d98d --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/operation_py3.py @@ -0,0 +1,33 @@ +# 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 Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.links.v2016_09_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link.py index 1c5c5b143719..b0a65c24ac61 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link.py @@ -22,6 +22,8 @@ class ResourceLink(Model): :vartype id: str :ivar name: The name of the resource link. :vartype name: str + :ivar type: The resource link object. + :vartype type: object :param properties: Properties for resource link. :type properties: ~azure.mgmt.resource.links.v2016_09_01.models.ResourceLinkProperties @@ -30,11 +32,13 @@ class ResourceLink(Model): _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'ResourceLinkProperties'}, } @@ -42,4 +46,5 @@ def __init__(self, **kwargs): super(ResourceLink, self).__init__(**kwargs) self.id = None self.name = None + self.type = None self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_py3.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_py3.py index ec2bdd48ca70..f4fa3544608c 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_py3.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_py3.py @@ -22,6 +22,8 @@ class ResourceLink(Model): :vartype id: str :ivar name: The name of the resource link. :vartype name: str + :ivar type: The resource link object. + :vartype type: object :param properties: Properties for resource link. :type properties: ~azure.mgmt.resource.links.v2016_09_01.models.ResourceLinkProperties @@ -30,11 +32,13 @@ class ResourceLink(Model): _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'ResourceLinkProperties'}, } @@ -42,4 +46,5 @@ def __init__(self, *, properties=None, **kwargs) -> None: super(ResourceLink, self).__init__(**kwargs) self.id = None self.name = None + self.type = None self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/__init__.py index ada44c974c8f..9fd0cda7f4c4 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/__init__.py @@ -9,8 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- +from .operations import Operations from .resource_links_operations import ResourceLinksOperations __all__ = [ + 'Operations', 'ResourceLinksOperations', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/operations.py b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/operations.py new file mode 100644 index 000000000000..e85ad6f21fe9 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/operations.py @@ -0,0 +1,98 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the operation. Constant value: "2016-09-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-09-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.Resources REST API operations. + + :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`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.resource.links.v2016_09_01.models.OperationPaged[~azure.mgmt.resource.links.v2016_09_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Resources/operations'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/management_lock_client.py b/azure-mgmt-resource/azure/mgmt/resource/locks/management_lock_client.py index ba07d13070c9..f16e7b1c5ab0 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/management_lock_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/management_lock_client.py @@ -107,6 +107,19 @@ def models(cls, api_version=DEFAULT_API_VERSION): return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + @property + def authorization_operations(self): + """Instance depends on the API version: + + * 2016-09-01: :class:`AuthorizationOperations` + """ + api_version = self._get_api_version('authorization_operations') + if api_version == '2016-09-01': + from .v2016_09_01.operations import AuthorizationOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def management_locks(self): """Instance depends on the API version: diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/management_lock_client.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/management_lock_client.py index fef858859619..5489aa865263 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/management_lock_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/management_lock_client.py @@ -13,9 +13,7 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -import uuid +from .operations.authorization_operations import AuthorizationOperations from .operations.management_locks_operations import ManagementLocksOperations from . import models @@ -58,6 +56,8 @@ class ManagementLockClient(SDKClient): :ivar config: Configuration for client. :vartype config: ManagementLockClientConfiguration + :ivar authorization_operations: AuthorizationOperations operations + :vartype authorization_operations: azure.mgmt.resource.locks.v2016_09_01.operations.AuthorizationOperations :ivar management_locks: ManagementLocks operations :vartype management_locks: azure.mgmt.resource.locks.v2016_09_01.operations.ManagementLocksOperations @@ -80,65 +80,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.authorization_operations = AuthorizationOperations( + self._client, self.config, self._serialize, self._deserialize) self.management_locks = ManagementLocksOperations( self._client, self.config, self._serialize, self._deserialize) - - def list_operations( - self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available Microsoft.Authorization REST API operations. - - :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`. - :return: An iterator like instance of Operation - :rtype: - ~azure.mgmt.resource.locks.v2016_09_01.models.OperationPaged[~azure.mgmt.resource.locks.v2016_09_01.models.Operation] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_operations.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_operations.metadata = {'url': '/providers/Microsoft.Features/operations'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/__init__.py index 2bffd473ac4b..89a0150a09b7 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/__init__.py @@ -9,8 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- +from .authorization_operations import AuthorizationOperations from .management_locks_operations import ManagementLocksOperations __all__ = [ + 'AuthorizationOperations', 'ManagementLocksOperations', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/authorization_operations.py b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/authorization_operations.py new file mode 100644 index 000000000000..e5c8f3d65d55 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/authorization_operations.py @@ -0,0 +1,98 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class AuthorizationOperations(object): + """AuthorizationOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the operation. Constant value: "2016-09-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-09-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.Authorization REST API operations. + + :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`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.resource.locks.v2016_09_01.models.OperationPaged[~azure.mgmt.resource.locks.v2016_09_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Authorization/operations'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/resource_management_client.py b/azure-mgmt-resource/azure/mgmt/resource/resources/resource_management_client.py index 1b23352f1536..e9c39247790c 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/resource_management_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/resource_management_client.py @@ -169,6 +169,19 @@ def deployments(self): raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def operations(self): + """Instance depends on the API version: + + * 2018-05-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2018-05-01': + from .v2018_05_01.operations import Operations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def providers(self): """Instance depends on the API version: diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py index 8e763379cfca..a25acecd0869 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py @@ -52,6 +52,8 @@ from .resource_py3 import Resource from .sub_resource_py3 import SubResource from .resource_group_export_result_py3 import ResourceGroupExportResult + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation except (SyntaxError, ImportError): from .deployment_extended_filter import DeploymentExtendedFilter from .generic_resource_filter import GenericResourceFilter @@ -95,6 +97,9 @@ from .resource import Resource from .sub_resource import SubResource from .resource_group_export_result import ResourceGroupExportResult + from .operation_display import OperationDisplay + from .operation import Operation +from .operation_paged import OperationPaged from .deployment_extended_paged import DeploymentExtendedPaged from .provider_paged import ProviderPaged from .generic_resource_paged import GenericResourcePaged @@ -150,6 +155,9 @@ 'Resource', 'SubResource', 'ResourceGroupExportResult', + 'OperationDisplay', + 'Operation', + 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', 'GenericResourcePaged', diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended.py index 36adba4277f1..c7e4aac9eb01 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended.py @@ -18,12 +18,10 @@ class DeploymentExtended(Model): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: The ID of the deployment. :vartype id: str - :param name: Required. The name of the deployment. - :type name: str + :ivar name: The name of the deployment. + :vartype name: str :param location: the location of the deployment. :type location: str :param properties: Deployment properties. @@ -33,7 +31,7 @@ class DeploymentExtended(Model): _validation = { 'id': {'readonly': True}, - 'name': {'required': True}, + 'name': {'readonly': True}, } _attribute_map = { @@ -46,6 +44,6 @@ class DeploymentExtended(Model): def __init__(self, **kwargs): super(DeploymentExtended, self).__init__(**kwargs) self.id = None - self.name = kwargs.get('name', None) + self.name = None self.location = kwargs.get('location', None) self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended_py3.py index 2c21e770ccf7..b8b6b4899586 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended_py3.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/deployment_extended_py3.py @@ -18,12 +18,10 @@ class DeploymentExtended(Model): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: The ID of the deployment. :vartype id: str - :param name: Required. The name of the deployment. - :type name: str + :ivar name: The name of the deployment. + :vartype name: str :param location: the location of the deployment. :type location: str :param properties: Deployment properties. @@ -33,7 +31,7 @@ class DeploymentExtended(Model): _validation = { 'id': {'readonly': True}, - 'name': {'required': True}, + 'name': {'readonly': True}, } _attribute_map = { @@ -43,9 +41,9 @@ class DeploymentExtended(Model): 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, } - def __init__(self, *, name: str, location: str=None, properties=None, **kwargs) -> None: + def __init__(self, *, location: str=None, properties=None, **kwargs) -> None: super(DeploymentExtended, self).__init__(**kwargs) self.id = None - self.name = name + self.name = None self.location = location self.properties = properties diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation.py new file mode 100644 index 000000000000..f0617b3edee0 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation.py @@ -0,0 +1,33 @@ +# 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 Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.resources.v2018_05_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display.py new file mode 100644 index 000000000000..98e3ef7e561c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display.py @@ -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 + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display_py3.py new file mode 100644 index 000000000000..9579860dfd81 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_display_py3.py @@ -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 + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_paged.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_paged.py new file mode 100644 index 000000000000..a998427204db --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_py3.py new file mode 100644 index 000000000000..64bbbe2fb4d7 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/operation_py3.py @@ -0,0 +1,33 @@ +# 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 Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.resources.v2018_05_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource.py index ee7662aeee52..35452c4dbcfc 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource.py @@ -13,7 +13,7 @@ class Resource(Model): - """Resource. + """Specified resource. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group.py index bc9b389b34e7..b35e177d6491 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group.py @@ -22,8 +22,8 @@ class ResourceGroup(Model): :ivar id: The ID of the resource group. :vartype id: str - :param name: The name of the resource group. - :type name: str + :ivar name: The name of the resource group. + :vartype name: str :param properties: :type properties: ~azure.mgmt.resource.resources.v2018_05_01.models.ResourceGroupProperties @@ -40,6 +40,7 @@ class ResourceGroup(Model): _validation = { 'id': {'readonly': True}, + 'name': {'readonly': True}, 'location': {'required': True}, } @@ -55,7 +56,7 @@ class ResourceGroup(Model): def __init__(self, **kwargs): super(ResourceGroup, self).__init__(**kwargs) self.id = None - self.name = kwargs.get('name', None) + self.name = None self.properties = kwargs.get('properties', None) self.location = kwargs.get('location', None) self.managed_by = kwargs.get('managed_by', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group_py3.py index ce72ce725c87..7c8bd5af08fa 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group_py3.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_group_py3.py @@ -22,8 +22,8 @@ class ResourceGroup(Model): :ivar id: The ID of the resource group. :vartype id: str - :param name: The name of the resource group. - :type name: str + :ivar name: The name of the resource group. + :vartype name: str :param properties: :type properties: ~azure.mgmt.resource.resources.v2018_05_01.models.ResourceGroupProperties @@ -40,6 +40,7 @@ class ResourceGroup(Model): _validation = { 'id': {'readonly': True}, + 'name': {'readonly': True}, 'location': {'required': True}, } @@ -52,10 +53,10 @@ class ResourceGroup(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, name: str=None, properties=None, managed_by: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, location: str, properties=None, managed_by: str=None, tags=None, **kwargs) -> None: super(ResourceGroup, self).__init__(**kwargs) self.id = None - self.name = name + self.name = None self.properties = properties self.location = location self.managed_by = managed_by diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties.py index ac328b64bb1a..975778dcb9c9 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties.py @@ -21,7 +21,7 @@ class ResourceProviderOperationDisplayProperties(Model): :type provider: str :param resource: Operation resource. :type resource: str - :param operation: Operation. + :param operation: Resource provider operation. :type operation: str :param description: Operation description. :type description: str diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties_py3.py index aecc5a412673..853e93d8a01b 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties_py3.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_provider_operation_display_properties_py3.py @@ -21,7 +21,7 @@ class ResourceProviderOperationDisplayProperties(Model): :type provider: str :param resource: Operation resource. :type resource: str - :param operation: Operation. + :param operation: Resource provider operation. :type operation: str :param description: Operation description. :type description: str diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_py3.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_py3.py index 3c8102ab5262..0b12546aafd3 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_py3.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/resource_py3.py @@ -13,7 +13,7 @@ class Resource(Model): - """Resource. + """Specified resource. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/__init__.py index 5aae03a99594..2276b11c175a 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/__init__.py @@ -9,6 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- +from .operations import Operations from .deployments_operations import DeploymentsOperations from .providers_operations import ProvidersOperations from .resources_operations import ResourcesOperations @@ -17,6 +18,7 @@ from .deployment_operations import DeploymentOperations __all__ = [ + 'Operations', 'DeploymentsOperations', 'ProvidersOperations', 'ResourcesOperations', diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/operations.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/operations.py new file mode 100644 index 000000000000..606acfd13829 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/operations.py @@ -0,0 +1,98 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.Resources REST API operations. + + :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`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.resource.resources.v2018_05_01.models.OperationPaged[~azure.mgmt.resource.resources.v2018_05_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Resources/operations'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/resource_management_client.py b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/resource_management_client.py index ea702c28df6d..848bf451ab63 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/resource_management_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/resource_management_client.py @@ -13,6 +13,7 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.operations import Operations from .operations.deployments_operations import DeploymentsOperations from .operations.providers_operations import ProvidersOperations from .operations.resources_operations import ResourcesOperations @@ -60,6 +61,8 @@ class ResourceManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: ResourceManagementClientConfiguration + :ivar operations: Operations operations + :vartype operations: azure.mgmt.resource.resources.v2018_05_01.operations.Operations :ivar deployments: Deployments operations :vartype deployments: azure.mgmt.resource.resources.v2018_05_01.operations.DeploymentsOperations :ivar providers: Providers operations @@ -92,6 +95,8 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) self.deployments = DeploymentsOperations( self._client, self.config, self._serialize, self._deserialize) self.providers = ProvidersOperations( diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/subscription_client.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/subscription_client.py index b28d6c098940..d179507d6fe4 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/subscription_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/subscription_client.py @@ -96,6 +96,19 @@ def models(cls, api_version=DEFAULT_API_VERSION): return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + @property + def operations(self): + """Instance depends on the API version: + + * 2016-06-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2016-06-01': + from .v2016_06_01.operations import Operations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def subscriptions(self): """Instance depends on the API version: diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/__init__.py index c13dd928bb5e..93bb9b27a0d5 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/__init__.py @@ -14,11 +14,16 @@ from .subscription_policies_py3 import SubscriptionPolicies from .subscription_py3 import Subscription from .tenant_id_description_py3 import TenantIdDescription + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation except (SyntaxError, ImportError): from .location import Location from .subscription_policies import SubscriptionPolicies from .subscription import Subscription from .tenant_id_description import TenantIdDescription + from .operation_display import OperationDisplay + from .operation import Operation +from .operation_paged import OperationPaged from .location_paged import LocationPaged from .subscription_paged import SubscriptionPaged from .tenant_id_description_paged import TenantIdDescriptionPaged @@ -32,6 +37,9 @@ 'SubscriptionPolicies', 'Subscription', 'TenantIdDescription', + 'OperationDisplay', + 'Operation', + 'OperationPaged', 'LocationPaged', 'SubscriptionPaged', 'TenantIdDescriptionPaged', diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation.py new file mode 100644 index 000000000000..17371783a238 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation.py @@ -0,0 +1,33 @@ +# 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 Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.subscriptions.v2016_06_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display.py new file mode 100644 index 000000000000..98e3ef7e561c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display.py @@ -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 + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display_py3.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display_py3.py new file mode 100644 index 000000000000..9579860dfd81 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_display_py3.py @@ -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 + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_paged.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_paged.py new file mode 100644 index 000000000000..7637539cb607 --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_py3.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_py3.py new file mode 100644 index 000000000000..392fc49eaefa --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/operation_py3.py @@ -0,0 +1,33 @@ +# 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 Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.subscriptions.v2016_06_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/__init__.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/__init__.py index 49fa5e8b0f03..f6906611d0e7 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/__init__.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/__init__.py @@ -9,10 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- +from .operations import Operations from .subscriptions_operations import SubscriptionsOperations from .tenants_operations import TenantsOperations __all__ = [ + 'Operations', 'SubscriptionsOperations', 'TenantsOperations', ] diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/operations.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/operations.py new file mode 100644 index 000000000000..62c7155f056c --- /dev/null +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/operations.py @@ -0,0 +1,98 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the operation. Constant value: "2016-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-06-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.Resources REST API operations. + + :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`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.resource.subscriptions.v2016_06_01.models.OperationPaged[~azure.mgmt.resource.subscriptions.v2016_06_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Resources/operations'} diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/subscription_client.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/subscription_client.py index deacfa9bab66..dfc36bb76bfb 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/subscription_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/subscription_client.py @@ -13,6 +13,7 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.operations import Operations from .operations.subscriptions_operations import SubscriptionsOperations from .operations.tenants_operations import TenantsOperations from . import models @@ -51,6 +52,8 @@ class SubscriptionClient(SDKClient): :ivar config: Configuration for client. :vartype config: SubscriptionClientConfiguration + :ivar operations: Operations operations + :vartype operations: azure.mgmt.resource.subscriptions.v2016_06_01.operations.Operations :ivar subscriptions: Subscriptions operations :vartype subscriptions: azure.mgmt.resource.subscriptions.v2016_06_01.operations.SubscriptionsOperations :ivar tenants: Tenants operations @@ -73,6 +76,8 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) self.subscriptions = SubscriptionsOperations( self._client, self.config, self._serialize, self._deserialize) self.tenants = TenantsOperations( diff --git a/azure-mgmt-resource/azure_bdist_wheel.py b/azure-mgmt-resource/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b61775..000000000000 --- a/azure-mgmt-resource/azure_bdist_wheel.py +++ /dev/null @@ -1,54 +0,0 @@ -#------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -#-------------------------------------------------------------------------- - -from distutils import log as logger -import os.path - -from wheel.bdist_wheel import bdist_wheel -class azure_bdist_wheel(bdist_wheel): - """The purpose of this class is to build wheel a little differently than the sdist, - without requiring to build the wheel from the sdist (i.e. you can build the wheel - directly from source). - """ - - description = "Create an Azure wheel distribution" - - user_options = bdist_wheel.user_options + \ - [('azure-namespace-package=', None, - "Name of the deepest nspkg used")] - - def initialize_options(self): - bdist_wheel.initialize_options(self) - self.azure_namespace_package = None - - def finalize_options(self): - bdist_wheel.finalize_options(self) - if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"): - raise ValueError("azure_namespace_package must finish by -nspkg") - - def run(self): - if not self.distribution.install_requires: - self.distribution.install_requires = [] - self.distribution.install_requires.append( - "{}>=2.0.0".format(self.azure_namespace_package)) - bdist_wheel.run(self) - - def write_record(self, bdist_dir, distinfo_dir): - if self.azure_namespace_package: - # Split and remove last part, assuming it's "nspkg" - subparts = self.azure_namespace_package.split('-')[0:-1] - folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))] - for azure_sub_package in folder_with_init: - init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py') - if os.path.isfile(init_file): - logger.info("manually remove {} while building the wheel".format(init_file)) - os.remove(init_file) - else: - raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file)) - bdist_wheel.write_record(self, bdist_dir, distinfo_dir) -cmdclass = { - 'bdist_wheel': azure_bdist_wheel, -} diff --git a/azure-mgmt-resource/setup.cfg b/azure-mgmt-resource/setup.cfg index 856f4164982c..3c6e79cf31da 100644 --- a/azure-mgmt-resource/setup.cfg +++ b/azure-mgmt-resource/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-mgmt-nspkg \ No newline at end of file diff --git a/azure-mgmt-resource/setup.py b/azure-mgmt-resource/setup.py index cb6a19760b06..0b6289c9ebda 100644 --- a/azure-mgmt-resource/setup.py +++ b/azure-mgmt-resource/setup.py @@ -10,12 +10,6 @@ import os.path from io import open from setuptools import find_packages, setup -try: - from azure_bdist_wheel import cmdclass -except ImportError: - from distutils import log as logger - logger.warn("Wheel is not available, disabling bdist_wheel hook") - cmdclass = {} # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-resource" @@ -76,11 +70,18 @@ 'License :: OSI Approved :: MIT License', ], zip_safe=False, - packages=find_packages(exclude=["tests"]), + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), install_requires=[ 'msrest>=0.5.0', 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } )