diff --git a/sdk/resources/azure-mgmt-resource/README.md b/sdk/resources/azure-mgmt-resource/README.md index 7fd9ba27948c..bc1a2096c766 100644 --- a/sdk/resources/azure-mgmt-resource/README.md +++ b/sdk/resources/azure-mgmt-resource/README.md @@ -1,28 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure Resource Management Client Library. - -Azure Resource Manager (ARM) is the next generation of management APIs -that replace the old Azure Service Management (ASM). - This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. - -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. -## Usage +# Usage For code examples, see [Resource Management](https://docs.microsoft.com/python/api/overview/azure/resources) on docs.microsoft.com. -## Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-resource%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-resource%2FREADME.png) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/__init__.py index d0f4592785b5..6dd3003be147 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/__init__.py @@ -15,8 +15,8 @@ from ._models_py3 import AzureResourceBase from ._models_py3 import ContainerConfiguration from ._models_py3 import DeploymentScript - from ._models_py3 import DeploymentScriptUpdateParameter from ._models_py3 import DeploymentScriptsError, DeploymentScriptsErrorException + from ._models_py3 import DeploymentScriptUpdateParameter from ._models_py3 import EnvironmentVariable from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorResponse @@ -24,6 +24,7 @@ from ._models_py3 import ScriptLog from ._models_py3 import ScriptLogsList from ._models_py3 import ScriptStatus + from ._models_py3 import StorageAccountConfiguration from ._models_py3 import SystemData from ._models_py3 import UserAssignedIdentity except (SyntaxError, ImportError): @@ -32,8 +33,8 @@ from ._models import AzureResourceBase from ._models import ContainerConfiguration from ._models import DeploymentScript - from ._models import DeploymentScriptUpdateParameter from ._models import DeploymentScriptsError, DeploymentScriptsErrorException + from ._models import DeploymentScriptUpdateParameter from ._models import EnvironmentVariable from ._models import ErrorAdditionalInfo from ._models import ErrorResponse @@ -41,6 +42,7 @@ from ._models import ScriptLog from ._models import ScriptLogsList from ._models import ScriptStatus + from ._models import StorageAccountConfiguration from ._models import SystemData from ._models import UserAssignedIdentity from ._paged_models import DeploymentScriptPaged @@ -57,8 +59,8 @@ 'AzureResourceBase', 'ContainerConfiguration', 'DeploymentScript', - 'DeploymentScriptUpdateParameter', 'DeploymentScriptsError', 'DeploymentScriptsErrorException', + 'DeploymentScriptUpdateParameter', 'EnvironmentVariable', 'ErrorAdditionalInfo', 'ErrorResponse', @@ -66,6 +68,7 @@ 'ScriptLog', 'ScriptLogsList', 'ScriptStatus', + 'StorageAccountConfiguration', 'SystemData', 'UserAssignedIdentity', 'DeploymentScriptPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models.py index c3c6f414ae8b..0ecad40c0b2b 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models.py @@ -145,6 +145,9 @@ class AzureCliScript(DeploymentScript): :param container_settings: Container settings. :type container_settings: ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ContainerConfiguration + :param storage_account_settings: Storage Account settings. + :type storage_account_settings: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible values include: 'Always', 'OnSuccess', 'OnExpiration' @@ -216,6 +219,7 @@ class AzureCliScript(DeploymentScript): 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'kind': {'key': 'kind', 'type': 'str'}, 'container_settings': {'key': 'properties.containerSettings', 'type': 'ContainerConfiguration'}, + 'storage_account_settings': {'key': 'properties.storageAccountSettings', 'type': 'StorageAccountConfiguration'}, 'cleanup_preference': {'key': 'properties.cleanupPreference', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'ScriptStatus'}, @@ -234,6 +238,7 @@ class AzureCliScript(DeploymentScript): def __init__(self, **kwargs): super(AzureCliScript, self).__init__(**kwargs) self.container_settings = kwargs.get('container_settings', None) + self.storage_account_settings = kwargs.get('storage_account_settings', None) self.cleanup_preference = kwargs.get('cleanup_preference', None) self.provisioning_state = None self.status = None @@ -281,6 +286,9 @@ class AzurePowerShellScript(DeploymentScript): :param container_settings: Container settings. :type container_settings: ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ContainerConfiguration + :param storage_account_settings: Storage Account settings. + :type storage_account_settings: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible values include: 'Always', 'OnSuccess', 'OnExpiration' @@ -353,6 +361,7 @@ class AzurePowerShellScript(DeploymentScript): 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'kind': {'key': 'kind', 'type': 'str'}, 'container_settings': {'key': 'properties.containerSettings', 'type': 'ContainerConfiguration'}, + 'storage_account_settings': {'key': 'properties.storageAccountSettings', 'type': 'StorageAccountConfiguration'}, 'cleanup_preference': {'key': 'properties.cleanupPreference', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'ScriptStatus'}, @@ -371,6 +380,7 @@ class AzurePowerShellScript(DeploymentScript): def __init__(self, **kwargs): super(AzurePowerShellScript, self).__init__(**kwargs) self.container_settings = kwargs.get('container_settings', None) + self.storage_account_settings = kwargs.get('storage_account_settings', None) self.cleanup_preference = kwargs.get('cleanup_preference', None) self.provisioning_state = None self.status = None @@ -435,6 +445,9 @@ class DeploymentScriptPropertiesBase(Model): :param container_settings: Container settings. :type container_settings: ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ContainerConfiguration + :param storage_account_settings: Storage Account settings. + :type storage_account_settings: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible values include: 'Always', 'OnSuccess', 'OnExpiration' @@ -460,6 +473,7 @@ class DeploymentScriptPropertiesBase(Model): _attribute_map = { 'container_settings': {'key': 'containerSettings', 'type': 'ContainerConfiguration'}, + 'storage_account_settings': {'key': 'storageAccountSettings', 'type': 'StorageAccountConfiguration'}, 'cleanup_preference': {'key': 'cleanupPreference', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'status': {'key': 'status', 'type': 'ScriptStatus'}, @@ -469,12 +483,42 @@ class DeploymentScriptPropertiesBase(Model): def __init__(self, **kwargs): super(DeploymentScriptPropertiesBase, self).__init__(**kwargs) self.container_settings = kwargs.get('container_settings', None) + self.storage_account_settings = kwargs.get('storage_account_settings', None) self.cleanup_preference = kwargs.get('cleanup_preference', None) self.provisioning_state = None self.status = None self.outputs = None +class DeploymentScriptsError(Model): + """Deployment scripts error response. + + :param error: + :type error: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(DeploymentScriptsError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class DeploymentScriptsErrorException(HttpOperationError): + """Server responsed with exception of type: 'DeploymentScriptsError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(DeploymentScriptsErrorException, self).__init__(deserialize, response, 'DeploymentScriptsError', *args) + + class DeploymentScriptUpdateParameter(AzureResourceBase): """Deployment script parameters to be updated. . @@ -509,35 +553,6 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) -class DeploymentScriptsError(Model): - """Deployment scripts error response. - - :param error: - :type error: - ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ErrorResponse - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - } - - def __init__(self, **kwargs): - super(DeploymentScriptsError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class DeploymentScriptsErrorException(HttpOperationError): - """Server responsed with exception of type: 'DeploymentScriptsError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(DeploymentScriptsErrorException, self).__init__(deserialize, response, 'DeploymentScriptsError', *args) - - class EnvironmentVariable(Model): """The environment variable to pass to the script in the container instance. @@ -828,6 +843,27 @@ def __init__(self, **kwargs): self.error = kwargs.get('error', None) +class StorageAccountConfiguration(Model): + """Settings to use an existing storage account. Valid storage account kinds + are: Storage, StorageV2 and FileStorage. + + :param storage_account_name: The storage account name. + :type storage_account_name: str + :param storage_account_key: The storage account access key. + :type storage_account_key: str + """ + + _attribute_map = { + 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, + 'storage_account_key': {'key': 'storageAccountKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountConfiguration, self).__init__(**kwargs) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.storage_account_key = kwargs.get('storage_account_key', None) + + class SystemData(Model): """Metadata pertaining to creation and last modification of the resource. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models_py3.py index e4fe023d0a69..7924595518e4 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_preview/models/_models_py3.py @@ -145,6 +145,9 @@ class AzureCliScript(DeploymentScript): :param container_settings: Container settings. :type container_settings: ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ContainerConfiguration + :param storage_account_settings: Storage Account settings. + :type storage_account_settings: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible values include: 'Always', 'OnSuccess', 'OnExpiration' @@ -216,6 +219,7 @@ class AzureCliScript(DeploymentScript): 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'kind': {'key': 'kind', 'type': 'str'}, 'container_settings': {'key': 'properties.containerSettings', 'type': 'ContainerConfiguration'}, + 'storage_account_settings': {'key': 'properties.storageAccountSettings', 'type': 'StorageAccountConfiguration'}, 'cleanup_preference': {'key': 'properties.cleanupPreference', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'ScriptStatus'}, @@ -231,9 +235,10 @@ class AzureCliScript(DeploymentScript): 'az_cli_version': {'key': 'properties.azCliVersion', 'type': 'str'}, } - def __init__(self, *, identity, location: str, retention_interval, az_cli_version: str, tags=None, container_settings=None, cleanup_preference=None, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: + def __init__(self, *, identity, location: str, retention_interval, az_cli_version: str, tags=None, container_settings=None, storage_account_settings=None, cleanup_preference=None, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: super(AzureCliScript, self).__init__(identity=identity, location=location, tags=tags, **kwargs) self.container_settings = container_settings + self.storage_account_settings = storage_account_settings self.cleanup_preference = cleanup_preference self.provisioning_state = None self.status = None @@ -281,6 +286,9 @@ class AzurePowerShellScript(DeploymentScript): :param container_settings: Container settings. :type container_settings: ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ContainerConfiguration + :param storage_account_settings: Storage Account settings. + :type storage_account_settings: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible values include: 'Always', 'OnSuccess', 'OnExpiration' @@ -353,6 +361,7 @@ class AzurePowerShellScript(DeploymentScript): 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'kind': {'key': 'kind', 'type': 'str'}, 'container_settings': {'key': 'properties.containerSettings', 'type': 'ContainerConfiguration'}, + 'storage_account_settings': {'key': 'properties.storageAccountSettings', 'type': 'StorageAccountConfiguration'}, 'cleanup_preference': {'key': 'properties.cleanupPreference', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'ScriptStatus'}, @@ -368,9 +377,10 @@ class AzurePowerShellScript(DeploymentScript): 'az_power_shell_version': {'key': 'properties.azPowerShellVersion', 'type': 'str'}, } - def __init__(self, *, identity, location: str, retention_interval, az_power_shell_version: str, tags=None, container_settings=None, cleanup_preference=None, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: + def __init__(self, *, identity, location: str, retention_interval, az_power_shell_version: str, tags=None, container_settings=None, storage_account_settings=None, cleanup_preference=None, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: super(AzurePowerShellScript, self).__init__(identity=identity, location=location, tags=tags, **kwargs) self.container_settings = container_settings + self.storage_account_settings = storage_account_settings self.cleanup_preference = cleanup_preference self.provisioning_state = None self.status = None @@ -435,6 +445,9 @@ class DeploymentScriptPropertiesBase(Model): :param container_settings: Container settings. :type container_settings: ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ContainerConfiguration + :param storage_account_settings: Storage Account settings. + :type storage_account_settings: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible values include: 'Always', 'OnSuccess', 'OnExpiration' @@ -460,21 +473,52 @@ class DeploymentScriptPropertiesBase(Model): _attribute_map = { 'container_settings': {'key': 'containerSettings', 'type': 'ContainerConfiguration'}, + 'storage_account_settings': {'key': 'storageAccountSettings', 'type': 'StorageAccountConfiguration'}, 'cleanup_preference': {'key': 'cleanupPreference', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'status': {'key': 'status', 'type': 'ScriptStatus'}, 'outputs': {'key': 'outputs', 'type': '{object}'}, } - def __init__(self, *, container_settings=None, cleanup_preference=None, **kwargs) -> None: + def __init__(self, *, container_settings=None, storage_account_settings=None, cleanup_preference=None, **kwargs) -> None: super(DeploymentScriptPropertiesBase, self).__init__(**kwargs) self.container_settings = container_settings + self.storage_account_settings = storage_account_settings self.cleanup_preference = cleanup_preference self.provisioning_state = None self.status = None self.outputs = None +class DeploymentScriptsError(Model): + """Deployment scripts error response. + + :param error: + :type error: + ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(DeploymentScriptsError, self).__init__(**kwargs) + self.error = error + + +class DeploymentScriptsErrorException(HttpOperationError): + """Server responsed with exception of type: 'DeploymentScriptsError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(DeploymentScriptsErrorException, self).__init__(deserialize, response, 'DeploymentScriptsError', *args) + + class DeploymentScriptUpdateParameter(AzureResourceBase): """Deployment script parameters to be updated. . @@ -509,35 +553,6 @@ def __init__(self, *, tags=None, **kwargs) -> None: self.tags = tags -class DeploymentScriptsError(Model): - """Deployment scripts error response. - - :param error: - :type error: - ~azure.mgmt.resource.deploymentscripts.v2019_10_preview.models.ErrorResponse - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(DeploymentScriptsError, self).__init__(**kwargs) - self.error = error - - -class DeploymentScriptsErrorException(HttpOperationError): - """Server responsed with exception of type: 'DeploymentScriptsError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(DeploymentScriptsErrorException, self).__init__(deserialize, response, 'DeploymentScriptsError', *args) - - class EnvironmentVariable(Model): """The environment variable to pass to the script in the container instance. @@ -828,6 +843,27 @@ def __init__(self, *, error=None, **kwargs) -> None: self.error = error +class StorageAccountConfiguration(Model): + """Settings to use an existing storage account. Valid storage account kinds + are: Storage, StorageV2 and FileStorage. + + :param storage_account_name: The storage account name. + :type storage_account_name: str + :param storage_account_key: The storage account access key. + :type storage_account_key: str + """ + + _attribute_map = { + 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, + 'storage_account_key': {'key': 'storageAccountKey', 'type': 'str'}, + } + + def __init__(self, *, storage_account_name: str=None, storage_account_key: str=None, **kwargs) -> None: + super(StorageAccountConfiguration, self).__init__(**kwargs) + self.storage_account_name = storage_account_name + self.storage_account_key = storage_account_key + + class SystemData(Model): """Metadata pertaining to creation and last modification of the resource. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py index 5bf8e6b74192..7a9d8f1ae662 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py @@ -10,9 +10,9 @@ # -------------------------------------------------------------------------- try: - from ._models_py3 import AliasPathType - from ._models_py3 import AliasPatternType1 - from ._models_py3 import AliasType1 + from ._models_py3 import Alias + from ._models_py3 import AliasPath + from ._models_py3 import AliasPattern from ._models_py3 import BasicDependency from ._models_py3 import DebugSetting from ._models_py3 import Dependency @@ -59,10 +59,10 @@ from ._models_py3 import SubResource from ._models_py3 import TagCount from ._models_py3 import TagDetails - from ._models_py3 import TagValue from ._models_py3 import Tags from ._models_py3 import TagsPatchResource from ._models_py3 import TagsResource + from ._models_py3 import TagValue from ._models_py3 import TargetResource from ._models_py3 import TemplateHashResult from ._models_py3 import TemplateLink @@ -70,9 +70,9 @@ from ._models_py3 import WhatIfOperationResult from ._models_py3 import WhatIfPropertyChange except (SyntaxError, ImportError): - from ._models import AliasPathType - from ._models import AliasPatternType1 - from ._models import AliasType1 + from ._models import Alias + from ._models import AliasPath + from ._models import AliasPattern from ._models import BasicDependency from ._models import DebugSetting from ._models import Dependency @@ -119,10 +119,10 @@ from ._models import SubResource from ._models import TagCount from ._models import TagDetails - from ._models import TagValue from ._models import Tags from ._models import TagsPatchResource from ._models import TagsResource + from ._models import TagValue from ._models import TargetResource from ._models import TemplateHashResult from ._models import TemplateLink @@ -143,14 +143,15 @@ AliasPatternType, AliasType, ResourceIdentityType, + ProvisioningOperation, PropertyChangeType, ChangeType, ) __all__ = [ - 'AliasPathType', - 'AliasPatternType1', - 'AliasType1', + 'Alias', + 'AliasPath', + 'AliasPattern', 'BasicDependency', 'DebugSetting', 'Dependency', @@ -197,10 +198,10 @@ 'SubResource', 'TagCount', 'TagDetails', - 'TagValue', 'Tags', 'TagsPatchResource', 'TagsResource', + 'TagValue', 'TargetResource', 'TemplateHashResult', 'TemplateLink', @@ -220,6 +221,7 @@ 'AliasPatternType', 'AliasType', 'ResourceIdentityType', + 'ProvisioningOperation', 'PropertyChangeType', 'ChangeType', ] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models.py index 3223274b3ca4..2c5630fa29b1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models.py @@ -13,7 +13,43 @@ from msrest.exceptions import HttpOperationError -class AliasPathType(Model): +class Alias(Model): + """The alias type. . + + :param name: The alias name. + :type name: str + :param paths: The paths for an alias. + :type paths: + list[~azure.mgmt.resource.resources.v2019_10_01.models.AliasPath] + :param type: The type of the alias. Possible values include: + 'NotSpecified', 'PlainText', 'Mask' + :type type: str or + ~azure.mgmt.resource.resources.v2019_10_01.models.AliasType + :param default_path: The default path for an alias. + :type default_path: str + :param default_pattern: The default pattern for an alias. + :type default_pattern: + ~azure.mgmt.resource.resources.v2019_10_01.models.AliasPattern + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[AliasPath]'}, + 'type': {'key': 'type', 'type': 'AliasType'}, + 'default_path': {'key': 'defaultPath', 'type': 'str'}, + 'default_pattern': {'key': 'defaultPattern', 'type': 'AliasPattern'}, + } + + def __init__(self, **kwargs): + super(Alias, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.paths = kwargs.get('paths', None) + self.type = kwargs.get('type', None) + self.default_path = kwargs.get('default_path', None) + self.default_pattern = kwargs.get('default_pattern', None) + + +class AliasPath(Model): """The type of the paths for alias. :param path: The path of an alias. @@ -22,23 +58,23 @@ class AliasPathType(Model): :type api_versions: list[str] :param pattern: The pattern for an alias path. :type pattern: - ~azure.mgmt.resource.resources.v2019_10_01.models.AliasPatternType1 + ~azure.mgmt.resource.resources.v2019_10_01.models.AliasPattern """ _attribute_map = { 'path': {'key': 'path', 'type': 'str'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, - 'pattern': {'key': 'pattern', 'type': 'AliasPatternType1'}, + 'pattern': {'key': 'pattern', 'type': 'AliasPattern'}, } def __init__(self, **kwargs): - super(AliasPathType, self).__init__(**kwargs) + super(AliasPath, self).__init__(**kwargs) self.path = kwargs.get('path', None) self.api_versions = kwargs.get('api_versions', None) self.pattern = kwargs.get('pattern', None) -class AliasPatternType1(Model): +class AliasPattern(Model): """The type of the pattern for an alias path. :param phrase: The alias pattern phrase. @@ -58,48 +94,12 @@ class AliasPatternType1(Model): } def __init__(self, **kwargs): - super(AliasPatternType1, self).__init__(**kwargs) + super(AliasPattern, self).__init__(**kwargs) self.phrase = kwargs.get('phrase', None) self.variable = kwargs.get('variable', None) self.type = kwargs.get('type', None) -class AliasType1(Model): - """The alias type. . - - :param name: The alias name. - :type name: str - :param paths: The paths for an alias. - :type paths: - list[~azure.mgmt.resource.resources.v2019_10_01.models.AliasPathType] - :param type: The type of the alias. Possible values include: - 'NotSpecified', 'PlainText', 'Mask' - :type type: str or - ~azure.mgmt.resource.resources.v2019_10_01.models.AliasType - :param default_path: The default path for an alias. - :type default_path: str - :param default_pattern: The default pattern for an alias. - :type default_pattern: - ~azure.mgmt.resource.resources.v2019_10_01.models.AliasPatternType1 - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'paths': {'key': 'paths', 'type': '[AliasPathType]'}, - 'type': {'key': 'type', 'type': 'AliasType'}, - 'default_path': {'key': 'defaultPath', 'type': 'str'}, - 'default_pattern': {'key': 'defaultPattern', 'type': 'AliasPatternType1'}, - } - - def __init__(self, **kwargs): - super(AliasType1, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.paths = kwargs.get('paths', None) - self.type = kwargs.get('type', None) - self.default_path = kwargs.get('default_path', None) - self.default_pattern = kwargs.get('default_pattern', None) - - class BasicDependency(Model): """Deployment dependency information. @@ -352,6 +352,12 @@ class DeploymentOperationProperties(Model): Variables are only populated by the server, and will be ignored when sending a request. + :ivar provisioning_operation: The name of the current provisioning + operation. Possible values include: 'NotSpecified', 'Create', 'Delete', + 'Waiting', 'AzureAsyncOperationWaiting', 'ResourceCacheWaiting', 'Action', + 'Read', 'EvaluateDeploymentOutput', 'DeploymentCleanup' + :vartype provisioning_operation: str or + ~azure.mgmt.resource.resources.v2019_10_01.models.ProvisioningOperation :ivar provisioning_state: The state of the provisioning. :vartype provisioning_state: str :ivar timestamp: The date and time of the operation. @@ -376,6 +382,7 @@ class DeploymentOperationProperties(Model): """ _validation = { + 'provisioning_operation': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'timestamp': {'readonly': True}, 'duration': {'readonly': True}, @@ -388,6 +395,7 @@ class DeploymentOperationProperties(Model): } _attribute_map = { + 'provisioning_operation': {'key': 'provisioningOperation', 'type': 'ProvisioningOperation'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, 'duration': {'key': 'duration', 'type': 'str'}, @@ -401,6 +409,7 @@ class DeploymentOperationProperties(Model): def __init__(self, **kwargs): super(DeploymentOperationProperties, self).__init__(**kwargs) + self.provisioning_operation = None self.provisioning_state = None self.timestamp = None self.duration = None @@ -1339,7 +1348,7 @@ class ProviderResourceType(Model): :type locations: list[str] :param aliases: The aliases that are supported by this resource type. :type aliases: - list[~azure.mgmt.resource.resources.v2019_10_01.models.AliasType1] + list[~azure.mgmt.resource.resources.v2019_10_01.models.Alias] :param api_versions: The API version. :type api_versions: list[str] :param capabilities: The additional capabilities offered by this resource @@ -1352,7 +1361,7 @@ class ProviderResourceType(Model): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'locations': {'key': 'locations', 'type': '[str]'}, - 'aliases': {'key': 'aliases', 'type': '[AliasType1]'}, + 'aliases': {'key': 'aliases', 'type': '[Alias]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, @@ -1735,37 +1744,6 @@ def __init__(self, **kwargs): self.values = kwargs.get('values', None) -class TagValue(Model): - """Tag information. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The tag value ID. - :vartype id: str - :param tag_value: The tag value. - :type tag_value: str - :param count: The tag value count. - :type count: ~azure.mgmt.resource.resources.v2019_10_01.models.TagCount - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'tag_value': {'key': 'tagValue', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'TagCount'}, - } - - def __init__(self, **kwargs): - super(TagValue, self).__init__(**kwargs) - self.id = None - self.tag_value = kwargs.get('tag_value', None) - self.count = kwargs.get('count', None) - - class Tags(Model): """A dictionary of name and value pairs. @@ -1844,6 +1822,37 @@ def __init__(self, **kwargs): self.properties = kwargs.get('properties', None) +class TagValue(Model): + """Tag information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag value ID. + :vartype id: str + :param tag_value: The tag value. + :type tag_value: str + :param count: The tag value count. + :type count: ~azure.mgmt.resource.resources.v2019_10_01.models.TagCount + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + } + + def __init__(self, **kwargs): + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = kwargs.get('tag_value', None) + self.count = kwargs.get('count', None) + + class TargetResource(Model): """Target resource. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py index f04f07b773bd..56d8ec56a59f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py @@ -13,7 +13,43 @@ from msrest.exceptions import HttpOperationError -class AliasPathType(Model): +class Alias(Model): + """The alias type. . + + :param name: The alias name. + :type name: str + :param paths: The paths for an alias. + :type paths: + list[~azure.mgmt.resource.resources.v2019_10_01.models.AliasPath] + :param type: The type of the alias. Possible values include: + 'NotSpecified', 'PlainText', 'Mask' + :type type: str or + ~azure.mgmt.resource.resources.v2019_10_01.models.AliasType + :param default_path: The default path for an alias. + :type default_path: str + :param default_pattern: The default pattern for an alias. + :type default_pattern: + ~azure.mgmt.resource.resources.v2019_10_01.models.AliasPattern + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[AliasPath]'}, + 'type': {'key': 'type', 'type': 'AliasType'}, + 'default_path': {'key': 'defaultPath', 'type': 'str'}, + 'default_pattern': {'key': 'defaultPattern', 'type': 'AliasPattern'}, + } + + def __init__(self, *, name: str=None, paths=None, type=None, default_path: str=None, default_pattern=None, **kwargs) -> None: + super(Alias, self).__init__(**kwargs) + self.name = name + self.paths = paths + self.type = type + self.default_path = default_path + self.default_pattern = default_pattern + + +class AliasPath(Model): """The type of the paths for alias. :param path: The path of an alias. @@ -22,23 +58,23 @@ class AliasPathType(Model): :type api_versions: list[str] :param pattern: The pattern for an alias path. :type pattern: - ~azure.mgmt.resource.resources.v2019_10_01.models.AliasPatternType1 + ~azure.mgmt.resource.resources.v2019_10_01.models.AliasPattern """ _attribute_map = { 'path': {'key': 'path', 'type': 'str'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, - 'pattern': {'key': 'pattern', 'type': 'AliasPatternType1'}, + 'pattern': {'key': 'pattern', 'type': 'AliasPattern'}, } def __init__(self, *, path: str=None, api_versions=None, pattern=None, **kwargs) -> None: - super(AliasPathType, self).__init__(**kwargs) + super(AliasPath, self).__init__(**kwargs) self.path = path self.api_versions = api_versions self.pattern = pattern -class AliasPatternType1(Model): +class AliasPattern(Model): """The type of the pattern for an alias path. :param phrase: The alias pattern phrase. @@ -58,48 +94,12 @@ class AliasPatternType1(Model): } def __init__(self, *, phrase: str=None, variable: str=None, type=None, **kwargs) -> None: - super(AliasPatternType1, self).__init__(**kwargs) + super(AliasPattern, self).__init__(**kwargs) self.phrase = phrase self.variable = variable self.type = type -class AliasType1(Model): - """The alias type. . - - :param name: The alias name. - :type name: str - :param paths: The paths for an alias. - :type paths: - list[~azure.mgmt.resource.resources.v2019_10_01.models.AliasPathType] - :param type: The type of the alias. Possible values include: - 'NotSpecified', 'PlainText', 'Mask' - :type type: str or - ~azure.mgmt.resource.resources.v2019_10_01.models.AliasType - :param default_path: The default path for an alias. - :type default_path: str - :param default_pattern: The default pattern for an alias. - :type default_pattern: - ~azure.mgmt.resource.resources.v2019_10_01.models.AliasPatternType1 - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'paths': {'key': 'paths', 'type': '[AliasPathType]'}, - 'type': {'key': 'type', 'type': 'AliasType'}, - 'default_path': {'key': 'defaultPath', 'type': 'str'}, - 'default_pattern': {'key': 'defaultPattern', 'type': 'AliasPatternType1'}, - } - - def __init__(self, *, name: str=None, paths=None, type=None, default_path: str=None, default_pattern=None, **kwargs) -> None: - super(AliasType1, self).__init__(**kwargs) - self.name = name - self.paths = paths - self.type = type - self.default_path = default_path - self.default_pattern = default_pattern - - class BasicDependency(Model): """Deployment dependency information. @@ -352,6 +352,12 @@ class DeploymentOperationProperties(Model): Variables are only populated by the server, and will be ignored when sending a request. + :ivar provisioning_operation: The name of the current provisioning + operation. Possible values include: 'NotSpecified', 'Create', 'Delete', + 'Waiting', 'AzureAsyncOperationWaiting', 'ResourceCacheWaiting', 'Action', + 'Read', 'EvaluateDeploymentOutput', 'DeploymentCleanup' + :vartype provisioning_operation: str or + ~azure.mgmt.resource.resources.v2019_10_01.models.ProvisioningOperation :ivar provisioning_state: The state of the provisioning. :vartype provisioning_state: str :ivar timestamp: The date and time of the operation. @@ -376,6 +382,7 @@ class DeploymentOperationProperties(Model): """ _validation = { + 'provisioning_operation': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'timestamp': {'readonly': True}, 'duration': {'readonly': True}, @@ -388,6 +395,7 @@ class DeploymentOperationProperties(Model): } _attribute_map = { + 'provisioning_operation': {'key': 'provisioningOperation', 'type': 'ProvisioningOperation'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, 'duration': {'key': 'duration', 'type': 'str'}, @@ -401,6 +409,7 @@ class DeploymentOperationProperties(Model): def __init__(self, **kwargs) -> None: super(DeploymentOperationProperties, self).__init__(**kwargs) + self.provisioning_operation = None self.provisioning_state = None self.timestamp = None self.duration = None @@ -1339,7 +1348,7 @@ class ProviderResourceType(Model): :type locations: list[str] :param aliases: The aliases that are supported by this resource type. :type aliases: - list[~azure.mgmt.resource.resources.v2019_10_01.models.AliasType1] + list[~azure.mgmt.resource.resources.v2019_10_01.models.Alias] :param api_versions: The API version. :type api_versions: list[str] :param capabilities: The additional capabilities offered by this resource @@ -1352,7 +1361,7 @@ class ProviderResourceType(Model): _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'locations': {'key': 'locations', 'type': '[str]'}, - 'aliases': {'key': 'aliases', 'type': '[AliasType1]'}, + 'aliases': {'key': 'aliases', 'type': '[Alias]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, @@ -1735,37 +1744,6 @@ def __init__(self, *, tag_name: str=None, count=None, values=None, **kwargs) -> self.values = values -class TagValue(Model): - """Tag information. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The tag value ID. - :vartype id: str - :param tag_value: The tag value. - :type tag_value: str - :param count: The tag value count. - :type count: ~azure.mgmt.resource.resources.v2019_10_01.models.TagCount - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'tag_value': {'key': 'tagValue', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'TagCount'}, - } - - def __init__(self, *, tag_value: str=None, count=None, **kwargs) -> None: - super(TagValue, self).__init__(**kwargs) - self.id = None - self.tag_value = tag_value - self.count = count - - class Tags(Model): """A dictionary of name and value pairs. @@ -1844,6 +1822,37 @@ def __init__(self, *, properties, **kwargs) -> None: self.properties = properties +class TagValue(Model): + """Tag information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag value ID. + :vartype id: str + :param tag_value: The tag value. + :type tag_value: str + :param count: The tag value count. + :type count: ~azure.mgmt.resource.resources.v2019_10_01.models.TagCount + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + } + + def __init__(self, *, tag_value: str=None, count=None, **kwargs) -> None: + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = tag_value + self.count = count + + class TargetResource(Model): """Target resource. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_resource_management_client_enums.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_resource_management_client_enums.py index cf0a4ee2d873..7acc830d93c3 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_resource_management_client_enums.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_resource_management_client_enums.py @@ -51,6 +51,20 @@ class ResourceIdentityType(str, Enum): none = "None" +class ProvisioningOperation(str, Enum): + + not_specified = "NotSpecified" #: The provisioning operation is not specified. + create = "Create" #: The provisioning operation is create. + delete = "Delete" #: The provisioning operation is delete. + waiting = "Waiting" #: The provisioning operation is waiting. + azure_async_operation_waiting = "AzureAsyncOperationWaiting" #: The provisioning operation is waiting Azure async operation. + resource_cache_waiting = "ResourceCacheWaiting" #: The provisioning operation is waiting for resource cache. + action = "Action" #: The provisioning operation is action. + read = "Read" #: The provisioning operation is read. + evaluate_deployment_output = "EvaluateDeploymentOutput" #: The provisioning operation is evaluate output. + deployment_cleanup = "DeploymentCleanup" #: The provisioning operation is cleanup. This operation is part of the 'complete' mode deployment. + + class PropertyChangeType(str, Enum): create = "Create" #: The property does not exist in the current state but is present in the desired state. The property will be created when the deployment is executed. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_deployment_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_deployment_operations.py index 1b37b39c2d44..0a0bfbe9ab4f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_deployment_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_deployment_operations.py @@ -63,7 +63,7 @@ def get_at_scope( # Construct URL url = self.get_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'operationId': self._serialize.url("operation_id", operation_id, 'str') } @@ -128,7 +128,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_deployments_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_deployments_operations.py index c7fcd071377a..8041052da3cc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_deployments_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_deployments_operations.py @@ -47,7 +47,7 @@ def _delete_at_scope_initial( # Construct URL url = self.delete_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') } url = self._client.format_url(url, **path_format_arguments) @@ -150,7 +150,7 @@ def check_existence_at_scope( # Construct URL url = self.check_existence_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') } url = self._client.format_url(url, **path_format_arguments) @@ -190,7 +190,7 @@ def _create_or_update_at_scope_initial( # Construct URL url = self.create_or_update_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') } url = self._client.format_url(url, **path_format_arguments) @@ -311,7 +311,7 @@ def get_at_scope( # Construct URL url = self.get_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') } url = self._client.format_url(url, **path_format_arguments) @@ -376,7 +376,7 @@ def cancel_at_scope( # Construct URL url = self.cancel_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') } url = self._client.format_url(url, **path_format_arguments) @@ -408,33 +408,13 @@ def cancel_at_scope( return client_raw_response cancel_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} - def validate_at_scope( - self, scope, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): - """Validates whether the specified template is syntactically correct and - will be accepted by Azure Resource Manager.. - :param scope: The resource scope. - :type scope: str - :param deployment_name: The name of the deployment. - :type deployment_name: str - :param parameters: Parameters to validate. - :type parameters: - ~azure.mgmt.resource.resources.v2019_10_01.models.Deployment - :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: DeploymentValidateResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _validate_at_scope_initial( + self, scope, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.validate_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') } url = self._client.format_url(url, **path_format_arguments) @@ -461,12 +441,13 @@ def validate_at_scope( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 400]: + if response.status_code not in [200, 202, 400]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None + if response.status_code == 200: deserialized = self._deserialize('DeploymentValidateResult', response) if response.status_code == 400: @@ -477,6 +458,58 @@ def validate_at_scope( return client_raw_response return deserialized + + def validate_at_scope( + self, scope, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.Deployment + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_at_scope_initial( + scope=scope, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) validate_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} def export_template_at_scope( @@ -501,7 +534,7 @@ def export_template_at_scope( # Construct URL url = self.export_template_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') } url = self._client.format_url(url, **path_format_arguments) @@ -567,7 +600,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str') + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) @@ -968,27 +1001,9 @@ def cancel_at_tenant_scope( return client_raw_response cancel_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} - def validate_at_tenant_scope( - self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): - """Validates whether the specified template is syntactically correct and - will be accepted by Azure Resource Manager.. - :param deployment_name: The name of the deployment. - :type deployment_name: str - :param parameters: Parameters to validate. - :type parameters: - ~azure.mgmt.resource.resources.v2019_10_01.models.ScopedDeployment - :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: DeploymentValidateResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _validate_at_tenant_scope_initial( + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.validate_at_tenant_scope.metadata['url'] path_format_arguments = { @@ -1018,12 +1033,13 @@ def validate_at_tenant_scope( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 400]: + if response.status_code not in [200, 202, 400]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None + if response.status_code == 200: deserialized = self._deserialize('DeploymentValidateResult', response) if response.status_code == 400: @@ -1034,6 +1050,55 @@ def validate_at_tenant_scope( return client_raw_response return deserialized + + def validate_at_tenant_scope( + self, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.ScopedDeployment + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_at_tenant_scope_initial( + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) validate_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} def export_template_at_tenant_scope( @@ -1533,29 +1598,9 @@ def cancel_at_management_group_scope( return client_raw_response cancel_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} - def validate_at_management_group_scope( - self, group_id, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): - """Validates whether the specified template is syntactically correct and - will be accepted by Azure Resource Manager.. - :param group_id: The management group ID. - :type group_id: str - :param deployment_name: The name of the deployment. - :type deployment_name: str - :param parameters: Parameters to validate. - :type parameters: - ~azure.mgmt.resource.resources.v2019_10_01.models.ScopedDeployment - :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: DeploymentValidateResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _validate_at_management_group_scope_initial( + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.validate_at_management_group_scope.metadata['url'] path_format_arguments = { @@ -1586,12 +1631,13 @@ def validate_at_management_group_scope( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 400]: + if response.status_code not in [200, 202, 400]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None + if response.status_code == 200: deserialized = self._deserialize('DeploymentValidateResult', response) if response.status_code == 400: @@ -1602,6 +1648,58 @@ def validate_at_management_group_scope( return client_raw_response return deserialized + + def validate_at_management_group_scope( + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.ScopedDeployment + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_at_management_group_scope_initial( + group_id=group_id, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) validate_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} def export_template_at_management_group_scope( @@ -2098,27 +2196,9 @@ def cancel_at_subscription_scope( return client_raw_response cancel_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} - def validate_at_subscription_scope( - self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): - """Validates whether the specified template is syntactically correct and - will be accepted by Azure Resource Manager.. - :param deployment_name: The name of the deployment. - :type deployment_name: str - :param parameters: Parameters to validate. - :type parameters: - ~azure.mgmt.resource.resources.v2019_10_01.models.Deployment - :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: DeploymentValidateResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _validate_at_subscription_scope_initial( + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.validate_at_subscription_scope.metadata['url'] path_format_arguments = { @@ -2149,12 +2229,13 @@ def validate_at_subscription_scope( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 400]: + if response.status_code not in [200, 202, 400]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None + if response.status_code == 200: deserialized = self._deserialize('DeploymentValidateResult', response) if response.status_code == 400: @@ -2165,6 +2246,55 @@ def validate_at_subscription_scope( return client_raw_response return deserialized + + def validate_at_subscription_scope( + self, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.Deployment + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_at_subscription_scope_initial( + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) validate_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} @@ -2795,30 +2925,9 @@ def cancel( return client_raw_response cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} - def validate( - self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): - """Validates whether the specified template is syntactically correct and - will be accepted by Azure Resource Manager.. - :param resource_group_name: The name of the resource group the - template will be deployed to. The name is case insensitive. - :type resource_group_name: str - :param deployment_name: The name of the deployment. - :type deployment_name: str - :param parameters: Parameters to validate. - :type parameters: - ~azure.mgmt.resource.resources.v2019_10_01.models.Deployment - :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: DeploymentValidateResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _validate_initial( + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.validate.metadata['url'] path_format_arguments = { @@ -2850,12 +2959,13 @@ def validate( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 400]: + if response.status_code not in [200, 202, 400]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None + if response.status_code == 200: deserialized = self._deserialize('DeploymentValidateResult', response) if response.status_code == 400: @@ -2866,6 +2976,59 @@ def validate( return client_raw_response return deserialized + + def validate( + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param resource_group_name: The name of the resource group the + template will be deployed to. The name is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2019_10_01.models.Deployment + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_initial( + resource_group_name=resource_group_name, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_tags_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_tags_operations.py index e65913b7f528..f8a10b2de303 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_tags_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_tags_operations.py @@ -386,7 +386,7 @@ def create_or_update_at_scope( # Construct URL url = self.create_or_update_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str') + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) @@ -464,7 +464,7 @@ def update_at_scope( # Construct URL url = self.update_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str') + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) @@ -525,7 +525,7 @@ def get_at_scope( # Construct URL url = self.get_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str') + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) @@ -581,7 +581,7 @@ def delete_at_scope( # Construct URL url = self.delete_at_scope.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str') + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/resources/azure-mgmt-resource/setup.py b/sdk/resources/azure-mgmt-resource/setup.py index 692efecd9da3..0a7a428236e5 100644 --- a/sdk/resources/azure-mgmt-resource/setup.py +++ b/sdk/resources/azure-mgmt-resource/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)