Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/resources/azure-mgmt-resource/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
8 changes: 8 additions & 0 deletions sdk/resources/azure-mgmt-resource/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "V2",
"use": "@microsoft.azure/autorest.python@~4.0.71",
"commit": "3951a779e4cd7b351bdfc4557fdc94490f5f6765",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/resources/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2",
"readme": "specification/resources/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _create_initial(
url = self.create.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1)
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -174,7 +174,7 @@ def update(
url = self.update.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1)
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -243,7 +243,7 @@ def get(
url = self.get.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1)
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -304,7 +304,7 @@ def delete(
url = self.delete.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1)
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -424,7 +424,7 @@ def get_logs(
url = self.get_logs.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1)
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -491,7 +491,7 @@ def get_logs_default(
url = self.get_logs_default.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1)
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -554,7 +554,7 @@ def prepare_request(next_link=None):
url = self.list_by_resource_group.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$')
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1)
}
url = self._client.format_url(url, **path_format_arguments)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ResourceManagementClient(MultiApiClientMixin, SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

DEFAULT_API_VERSION = '2020-10-01'
DEFAULT_API_VERSION = '2021-01-01'
_PROFILE_TAG = "azure.mgmt.resource.resources.ResourceManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand Down Expand Up @@ -85,6 +85,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2019-10-01: :mod:`v2019_10_01.models<azure.mgmt.resource.resources.v2019_10_01.models>`
* 2020-06-01: :mod:`v2020_06_01.models<azure.mgmt.resource.resources.v2020_06_01.models>`
* 2020-10-01: :mod:`v2020_10_01.models<azure.mgmt.resource.resources.v2020_10_01.models>`
* 2021-01-01: :mod:`v2021_01_01.models<azure.mgmt.resource.resources.v2021_01_01.models>`
"""
if api_version == '2016-02-01':
from .v2016_02_01 import models
Expand Down Expand Up @@ -125,6 +126,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2020-10-01':
from .v2020_10_01 import models
return models
elif api_version == '2021-01-01':
from .v2021_01_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
Expand All @@ -144,6 +148,7 @@ def deployment_operations(self):
* 2019-10-01: :class:`DeploymentOperations<azure.mgmt.resource.resources.v2019_10_01.operations.DeploymentOperations>`
* 2020-06-01: :class:`DeploymentOperations<azure.mgmt.resource.resources.v2020_06_01.operations.DeploymentOperations>`
* 2020-10-01: :class:`DeploymentOperations<azure.mgmt.resource.resources.v2020_10_01.operations.DeploymentOperations>`
* 2021-01-01: :class:`DeploymentOperations<azure.mgmt.resource.resources.v2021_01_01.operations.DeploymentOperations>`
"""
api_version = self._get_api_version('deployment_operations')
if api_version == '2016-02-01':
Expand Down Expand Up @@ -172,6 +177,8 @@ def deployment_operations(self):
from .v2020_06_01.operations import DeploymentOperations as OperationClass
elif api_version == '2020-10-01':
from .v2020_10_01.operations import DeploymentOperations as OperationClass
elif api_version == '2021-01-01':
from .v2021_01_01.operations import DeploymentOperations 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)))
Expand All @@ -193,6 +200,7 @@ def deployments(self):
* 2019-10-01: :class:`DeploymentsOperations<azure.mgmt.resource.resources.v2019_10_01.operations.DeploymentsOperations>`
* 2020-06-01: :class:`DeploymentsOperations<azure.mgmt.resource.resources.v2020_06_01.operations.DeploymentsOperations>`
* 2020-10-01: :class:`DeploymentsOperations<azure.mgmt.resource.resources.v2020_10_01.operations.DeploymentsOperations>`
* 2021-01-01: :class:`DeploymentsOperations<azure.mgmt.resource.resources.v2021_01_01.operations.DeploymentsOperations>`
"""
api_version = self._get_api_version('deployments')
if api_version == '2016-02-01':
Expand Down Expand Up @@ -221,6 +229,8 @@ def deployments(self):
from .v2020_06_01.operations import DeploymentsOperations as OperationClass
elif api_version == '2020-10-01':
from .v2020_10_01.operations import DeploymentsOperations as OperationClass
elif api_version == '2021-01-01':
from .v2021_01_01.operations import DeploymentsOperations 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)))
Expand All @@ -238,6 +248,7 @@ def operations(self):
* 2019-10-01: :class:`Operations<azure.mgmt.resource.resources.v2019_10_01.operations.Operations>`
* 2020-06-01: :class:`Operations<azure.mgmt.resource.resources.v2020_06_01.operations.Operations>`
* 2020-10-01: :class:`Operations<azure.mgmt.resource.resources.v2020_10_01.operations.Operations>`
* 2021-01-01: :class:`Operations<azure.mgmt.resource.resources.v2021_01_01.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2018-05-01':
Expand All @@ -258,6 +269,8 @@ def operations(self):
from .v2020_06_01.operations import Operations as OperationClass
elif api_version == '2020-10-01':
from .v2020_10_01.operations import Operations as OperationClass
elif api_version == '2021-01-01':
from .v2021_01_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)))
Expand All @@ -267,10 +280,13 @@ def provider_resource_types(self):
"""Instance depends on the API version:
* 2020-10-01: :class:`ProviderResourceTypesOperations<azure.mgmt.resource.resources.v2020_10_01.operations.ProviderResourceTypesOperations>`
* 2021-01-01: :class:`ProviderResourceTypesOperations<azure.mgmt.resource.resources.v2021_01_01.operations.ProviderResourceTypesOperations>`
"""
api_version = self._get_api_version('provider_resource_types')
if api_version == '2020-10-01':
from .v2020_10_01.operations import ProviderResourceTypesOperations as OperationClass
elif api_version == '2021-01-01':
from .v2021_01_01.operations import ProviderResourceTypesOperations 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)))
Expand All @@ -292,6 +308,7 @@ def providers(self):
* 2019-10-01: :class:`ProvidersOperations<azure.mgmt.resource.resources.v2019_10_01.operations.ProvidersOperations>`
* 2020-06-01: :class:`ProvidersOperations<azure.mgmt.resource.resources.v2020_06_01.operations.ProvidersOperations>`
* 2020-10-01: :class:`ProvidersOperations<azure.mgmt.resource.resources.v2020_10_01.operations.ProvidersOperations>`
* 2021-01-01: :class:`ProvidersOperations<azure.mgmt.resource.resources.v2021_01_01.operations.ProvidersOperations>`
"""
api_version = self._get_api_version('providers')
if api_version == '2016-02-01':
Expand Down Expand Up @@ -320,6 +337,8 @@ def providers(self):
from .v2020_06_01.operations import ProvidersOperations as OperationClass
elif api_version == '2020-10-01':
from .v2020_10_01.operations import ProvidersOperations as OperationClass
elif api_version == '2021-01-01':
from .v2021_01_01.operations import ProvidersOperations 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)))
Expand All @@ -341,6 +360,7 @@ def resource_groups(self):
* 2019-10-01: :class:`ResourceGroupsOperations<azure.mgmt.resource.resources.v2019_10_01.operations.ResourceGroupsOperations>`
* 2020-06-01: :class:`ResourceGroupsOperations<azure.mgmt.resource.resources.v2020_06_01.operations.ResourceGroupsOperations>`
* 2020-10-01: :class:`ResourceGroupsOperations<azure.mgmt.resource.resources.v2020_10_01.operations.ResourceGroupsOperations>`
* 2021-01-01: :class:`ResourceGroupsOperations<azure.mgmt.resource.resources.v2021_01_01.operations.ResourceGroupsOperations>`
"""
api_version = self._get_api_version('resource_groups')
if api_version == '2016-02-01':
Expand Down Expand Up @@ -369,6 +389,8 @@ def resource_groups(self):
from .v2020_06_01.operations import ResourceGroupsOperations as OperationClass
elif api_version == '2020-10-01':
from .v2020_10_01.operations import ResourceGroupsOperations as OperationClass
elif api_version == '2021-01-01':
from .v2021_01_01.operations import ResourceGroupsOperations 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)))
Expand All @@ -390,6 +412,7 @@ def resources(self):
* 2019-10-01: :class:`ResourcesOperations<azure.mgmt.resource.resources.v2019_10_01.operations.ResourcesOperations>`
* 2020-06-01: :class:`ResourcesOperations<azure.mgmt.resource.resources.v2020_06_01.operations.ResourcesOperations>`
* 2020-10-01: :class:`ResourcesOperations<azure.mgmt.resource.resources.v2020_10_01.operations.ResourcesOperations>`
* 2021-01-01: :class:`ResourcesOperations<azure.mgmt.resource.resources.v2021_01_01.operations.ResourcesOperations>`
"""
api_version = self._get_api_version('resources')
if api_version == '2016-02-01':
Expand Down Expand Up @@ -418,6 +441,8 @@ def resources(self):
from .v2020_06_01.operations import ResourcesOperations as OperationClass
elif api_version == '2020-10-01':
from .v2020_10_01.operations import ResourcesOperations as OperationClass
elif api_version == '2021-01-01':
from .v2021_01_01.operations import ResourcesOperations 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)))
Expand All @@ -439,6 +464,7 @@ def tags(self):
* 2019-10-01: :class:`TagsOperations<azure.mgmt.resource.resources.v2019_10_01.operations.TagsOperations>`
* 2020-06-01: :class:`TagsOperations<azure.mgmt.resource.resources.v2020_06_01.operations.TagsOperations>`
* 2020-10-01: :class:`TagsOperations<azure.mgmt.resource.resources.v2020_10_01.operations.TagsOperations>`
* 2021-01-01: :class:`TagsOperations<azure.mgmt.resource.resources.v2021_01_01.operations.TagsOperations>`
"""
api_version = self._get_api_version('tags')
if api_version == '2016-02-01':
Expand Down Expand Up @@ -467,6 +493,8 @@ def tags(self):
from .v2020_06_01.operations import TagsOperations as OperationClass
elif api_version == '2020-10-01':
from .v2020_10_01.operations import TagsOperations as OperationClass
elif api_version == '2021-01-01':
from .v2021_01_01.operations import TagsOperations 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)))
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from .v2020_10_01.models import *
from .v2021_01_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
from ._models_py3 import TargetResource
from ._models_py3 import TemplateHashResult
from ._models_py3 import TemplateLink
from ._models_py3 import ZoneMapping
except (SyntaxError, ImportError):
from ._models import AliasPathType
from ._models import AliasType
Expand Down Expand Up @@ -95,6 +96,7 @@
from ._models import TargetResource
from ._models import TemplateHashResult
from ._models import TemplateLink
from ._models import ZoneMapping
from ._paged_models import DeploymentExtendedPaged
from ._paged_models import DeploymentOperationPaged
from ._paged_models import GenericResourceExpandedPaged
Expand Down Expand Up @@ -149,6 +151,7 @@
'TargetResource',
'TemplateHashResult',
'TemplateLink',
'ZoneMapping',
'DeploymentExtendedPaged',
'ProviderPaged',
'GenericResourceExpandedPaged',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,9 @@ class ProviderResourceType(Model):
list[~azure.mgmt.resource.resources.v2016_09_01.models.AliasType]
:param api_versions: The API version.
:type api_versions: list[str]
:param zone_mappings:
:type zone_mappings:
list[~azure.mgmt.resource.resources.v2016_09_01.models.ZoneMapping]
:param properties: The properties.
:type properties: dict[str, str]
"""
Expand All @@ -973,6 +976,7 @@ class ProviderResourceType(Model):
'locations': {'key': 'locations', 'type': '[str]'},
'aliases': {'key': 'aliases', 'type': '[AliasType]'},
'api_versions': {'key': 'apiVersions', 'type': '[str]'},
'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'},
'properties': {'key': 'properties', 'type': '{str}'},
}

Expand All @@ -982,6 +986,7 @@ def __init__(self, **kwargs):
self.locations = kwargs.get('locations', None)
self.aliases = kwargs.get('aliases', None)
self.api_versions = kwargs.get('api_versions', None)
self.zone_mappings = kwargs.get('zone_mappings', None)
self.properties = kwargs.get('properties', None)


Expand Down Expand Up @@ -1401,3 +1406,23 @@ def __init__(self, **kwargs):
super(TemplateLink, self).__init__(**kwargs)
self.uri = kwargs.get('uri', None)
self.content_version = kwargs.get('content_version', None)


class ZoneMapping(Model):
"""ZoneMapping.

:param location: The location of the zone mapping.
:type location: str
:param zones:
:type zones: list[str]
"""

_attribute_map = {
'location': {'key': 'location', 'type': 'str'},
'zones': {'key': 'zones', 'type': '[str]'},
}

def __init__(self, **kwargs):
super(ZoneMapping, self).__init__(**kwargs)
self.location = kwargs.get('location', None)
self.zones = kwargs.get('zones', None)
Loading