diff --git a/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py index 73de573d1aa2..85212d33086a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py @@ -116,6 +116,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2016-12-01: :mod:`v2016_12_01.models` * 2017-06-01: :mod:`v2017_06_01.models` * 2017-10-01: :mod:`v2017_10_01.models` + * 2018-02-01: :mod:`v2018_02_01.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -132,20 +133,39 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2017-10-01': from .v2017_10_01 import models return models + elif api_version == '2018-02-01': + from .v2018_02_01 import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + @property + def blob_containers(self): + """Instance depends on the API version: + + * 2018-02-01: :class:`BlobContainersOperations` + """ + api_version = self._get_api_version('blob_containers') + if api_version == '2018-02-01': + from .v2018_02_01.operations import BlobContainersOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def operations(self): """Instance depends on the API version: * 2017-06-01: :class:`Operations` * 2017-10-01: :class:`Operations` + * 2018-02-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-06-01': from .v2017_06_01.operations import Operations as OperationClass elif api_version == '2017-10-01': from .v2017_10_01.operations import Operations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_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))) @@ -156,12 +176,15 @@ def skus(self): * 2017-06-01: :class:`SkusOperations` * 2017-10-01: :class:`SkusOperations` + * 2018-02-01: :class:`SkusOperations` """ api_version = self._get_api_version('skus') if api_version == '2017-06-01': from .v2017_06_01.operations import SkusOperations as OperationClass elif api_version == '2017-10-01': from .v2017_10_01.operations import SkusOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import SkusOperations 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))) @@ -175,6 +198,7 @@ def storage_accounts(self): * 2016-12-01: :class:`StorageAccountsOperations` * 2017-06-01: :class:`StorageAccountsOperations` * 2017-10-01: :class:`StorageAccountsOperations` + * 2018-02-01: :class:`StorageAccountsOperations` """ api_version = self._get_api_version('storage_accounts') if api_version == '2015-06-15': @@ -187,6 +211,8 @@ def storage_accounts(self): from .v2017_06_01.operations import StorageAccountsOperations as OperationClass elif api_version == '2017-10-01': from .v2017_10_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import StorageAccountsOperations 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))) @@ -200,6 +226,7 @@ def usage(self): * 2016-12-01: :class:`UsageOperations` * 2017-06-01: :class:`UsageOperations` * 2017-10-01: :class:`UsageOperations` + * 2018-02-01: :class:`UsageOperations` """ api_version = self._get_api_version('usage') if api_version == '2015-06-15': @@ -212,6 +239,8 @@ def usage(self): from .v2017_06_01.operations import UsageOperations as OperationClass elif api_version == '2017-10-01': from .v2017_10_01.operations import UsageOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import UsageOperations 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))) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/__init__.py index b5c48a6c0b8d..c3427e9e6690 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/__init__.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/__init__.py @@ -9,18 +9,32 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters -from .check_name_availability_result import CheckNameAvailabilityResult -from .storage_account_create_parameters import StorageAccountCreateParameters -from .endpoints import Endpoints -from .custom_domain import CustomDomain -from .storage_account import StorageAccount -from .storage_account_keys import StorageAccountKeys -from .storage_account_update_parameters import StorageAccountUpdateParameters -from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters -from .usage_name import UsageName -from .usage import Usage -from .resource import Resource +try: + from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .endpoints_py3 import Endpoints + from .custom_domain_py3 import CustomDomain + from .storage_account_py3 import StorageAccount + from .storage_account_keys_py3 import StorageAccountKeys + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .resource_py3 import Resource +except (SyntaxError, ImportError): + from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters + from .check_name_availability_result import CheckNameAvailabilityResult + from .storage_account_create_parameters import StorageAccountCreateParameters + from .endpoints import Endpoints + from .custom_domain import CustomDomain + from .storage_account import StorageAccount + from .storage_account_keys import StorageAccountKeys + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters + from .usage_name import UsageName + from .usage import Usage + from .resource import Resource from .storage_account_paged import StorageAccountPaged from .usage_paged import UsagePaged from .storage_management_client_enums import ( diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result.py index c838caff1250..1548dba81ccc 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result.py @@ -34,8 +34,8 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, name_available=None, reason=None, message=None): - super(CheckNameAvailabilityResult, self).__init__() - self.name_available = name_available - self.reason = reason - self.message = message + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..807be8e571c9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + :param name_available: Boolean value that indicates whether the name is + available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :type name_available: bool + :param reason: The reason that a storage account name could not be used. + The Reason element is only returned if NameAvailable is false. Possible + values include: 'AccountNameInvalid', 'AlreadyExists' + :type reason: str or ~azure.mgmt.storage.v2015_06_15.models.Reason + :param message: The error message explaining the Reason value in more + detail. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason=None, message: str=None, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain.py index 539722b6bd8a..e3a9f56d4b47 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain.py @@ -16,7 +16,9 @@ class CustomDomain(Model): """The custom domain assigned to this storage account. This can be set via Update. - :param name: The custom domain name. Name is the CNAME source. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The custom domain name. Name is the CNAME source. :type name: str :param use_sub_domain: Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates @@ -32,7 +34,7 @@ class CustomDomain(Model): 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, } - def __init__(self, name, use_sub_domain=None): - super(CustomDomain, self).__init__() - self.name = name - self.use_sub_domain = use_sub_domain + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain = kwargs.get('use_sub_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain_py3.py new file mode 100644 index 000000000000..c3fd9f4f47c3 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The custom domain name. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain = use_sub_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints.py index 551f4dbe241f..a79d2687f891 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints.py @@ -33,9 +33,9 @@ class Endpoints(Model): 'file': {'key': 'file', 'type': 'str'}, } - def __init__(self, blob=None, queue=None, table=None, file=None): - super(Endpoints, self).__init__() - self.blob = blob - self.queue = queue - self.table = table - self.file = file + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.queue = kwargs.get('queue', None) + self.table = kwargs.get('table', None) + self.file = kwargs.get('file', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints_py3.py new file mode 100644 index 000000000000..f05bb4b0aec3 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue or + table object. + + :param blob: The blob endpoint. + :type blob: str + :param queue: The queue endpoint. + :type queue: str + :param table: The table endpoint. + :type table: str + :param file: The file endpoint. + :type file: str + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, *, blob: str=None, queue: str=None, table: str=None, file: str=None, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = blob + self.queue = queue + self.table = table + self.file = file diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource.py index a07a187cbcd1..00300c71662b 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource.py @@ -44,10 +44,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource_py3.py new file mode 100644 index 000000000000..bcd12774c0c9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account.py index fa1274d98042..93989a1a1871 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account.py @@ -104,16 +104,16 @@ class StorageAccount(Resource): 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, } - def __init__(self, location=None, tags=None, provisioning_state=None, account_type=None, primary_endpoints=None, primary_location=None, status_of_primary=None, last_geo_failover_time=None, secondary_location=None, status_of_secondary=None, creation_time=None, custom_domain=None, secondary_endpoints=None): - super(StorageAccount, self).__init__(location=location, tags=tags) - self.provisioning_state = provisioning_state - self.account_type = account_type - self.primary_endpoints = primary_endpoints - self.primary_location = primary_location - self.status_of_primary = status_of_primary - self.last_geo_failover_time = last_geo_failover_time - self.secondary_location = secondary_location - self.status_of_secondary = status_of_secondary - self.creation_time = creation_time - self.custom_domain = custom_domain - self.secondary_endpoints = secondary_endpoints + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.account_type = kwargs.get('account_type', None) + self.primary_endpoints = kwargs.get('primary_endpoints', None) + self.primary_location = kwargs.get('primary_location', None) + self.status_of_primary = kwargs.get('status_of_primary', None) + self.last_geo_failover_time = kwargs.get('last_geo_failover_time', None) + self.secondary_location = kwargs.get('secondary_location', None) + self.status_of_secondary = kwargs.get('status_of_secondary', None) + self.creation_time = kwargs.get('creation_time', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.secondary_endpoints = kwargs.get('secondary_endpoints', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters.py index 545941f7142b..298a405533fe 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters.py @@ -15,7 +15,9 @@ class StorageAccountCheckNameAvailabilityParameters(Model): """The parameters used to check the availabity of the storage account name. - :param name: + All required parameters must be populated in order to send to Azure. + + :param name: Required. :type name: str :param type: Default value: "Microsoft.Storage/storageAccounts" . :type type: str @@ -30,7 +32,7 @@ class StorageAccountCheckNameAvailabilityParameters(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, name, type="Microsoft.Storage/storageAccounts"): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__() - self.name = name - self.type = type + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', "Microsoft.Storage/storageAccounts") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..db7cbf7521d5 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the storage account name. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param type: Default value: "Microsoft.Storage/storageAccounts" . + :type type: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str, type: str="Microsoft.Storage/storageAccounts", **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + self.type = type diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters.py index 0a06e592b9ad..852d51b76294 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters.py @@ -15,8 +15,10 @@ class StorageAccountCreateParameters(Model): """The parameters to provide for the account. - :param location: The location of the resource. This will be one of the - supported and registered Azure Geo Regions (e.g. West US, East US, + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. This will be one + of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. @@ -27,10 +29,10 @@ class StorageAccountCreateParameters(Model): must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. :type tags: dict[str, str] - :param account_type: The sku name. Required for account creation; optional - for update. Note that in older versions, sku name was called accountType. - Possible values include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', - 'Standard_RAGRS', 'Premium_LRS' + :param account_type: Required. The sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', 'Premium_LRS' :type account_type: str or ~azure.mgmt.storage.v2015_06_15.models.AccountType """ @@ -46,8 +48,8 @@ class StorageAccountCreateParameters(Model): 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, } - def __init__(self, location, account_type, tags=None): - super(StorageAccountCreateParameters, self).__init__() - self.location = location - self.tags = tags - self.account_type = account_type + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.account_type = kwargs.get('account_type', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..e90af5ec5564 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters to provide for the account. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. This will be one + of the supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). The geo region of a resource cannot be changed once + it is created, but if an identical geo region is specified on update, the + request will succeed. + :type location: str + :param tags: A list of key value pairs that describe the resource. These + tags can be used for viewing and grouping this resource (across resource + groups). A maximum of 15 tags can be provided for a resource. Each tag + must have a key with a length no greater than 128 characters and a value + with a length no greater than 256 characters. + :type tags: dict[str, str] + :param account_type: Required. The sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountType + """ + + _validation = { + 'location': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, + } + + def __init__(self, *, location: str, account_type, tags=None, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.account_type = account_type diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys.py index bfe8dec89d80..8bf214b2625a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys.py @@ -26,7 +26,7 @@ class StorageAccountKeys(Model): 'key2': {'key': 'key2', 'type': 'str'}, } - def __init__(self, key1=None, key2=None): - super(StorageAccountKeys, self).__init__() - self.key1 = key1 - self.key2 = key2 + def __init__(self, **kwargs): + super(StorageAccountKeys, self).__init__(**kwargs) + self.key1 = kwargs.get('key1', None) + self.key2 = kwargs.get('key2', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys_py3.py new file mode 100644 index 000000000000..34d336be577d --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountKeys(Model): + """The access keys for the storage account. + + :param key1: The value of key 1. + :type key1: str + :param key2: The value of key 2. + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: + super(StorageAccountKeys, self).__init__(**kwargs) + self.key1 = key1 + self.key2 = key2 diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_py3.py new file mode 100644 index 000000000000..d36495a29fc7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_py3.py @@ -0,0 +1,119 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param provisioning_state: The status of the storage account at the time + the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :type provisioning_state: str or + ~azure.mgmt.storage.v2015_06_15.models.ProvisioningState + :param account_type: The type of the storage account. Possible values + include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', + 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountType + :param primary_endpoints: The URLs that are used to perform a retrieval of + a public blob, queue, or table object. Note that Standard_ZRS and + Premium_LRS accounts only return the blob endpoint. + :type primary_endpoints: ~azure.mgmt.storage.v2015_06_15.models.Endpoints + :param primary_location: The location of the primary data center for the + storage account. + :type primary_location: str + :param status_of_primary: The status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'Available', 'Unavailable' + :type status_of_primary: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountStatus + :param last_geo_failover_time: The timestamp of the most recent instance + of a failover to the secondary location. Only the most recent timestamp is + retained. This element is not returned if there has never been a failover + instance. Only available if the accountType is Standard_GRS or + Standard_RAGRS. + :type last_geo_failover_time: datetime + :param secondary_location: The location of the geo-replicated secondary + for the storage account. Only available if the accountType is Standard_GRS + or Standard_RAGRS. + :type secondary_location: str + :param status_of_secondary: The status indicating whether the secondary + location of the storage account is available or unavailable. Only + available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'Available', 'Unavailable' + :type status_of_secondary: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountStatus + :param creation_time: The creation date and time of the storage account in + UTC. + :type creation_time: datetime + :param custom_domain: The custom domain the user assigned to this storage + account. + :type custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain + :param secondary_endpoints: The URLs that are used to perform a retrieval + of a public blob, queue, or table object from the secondary location of + the storage account. Only available if the SKU name is Standard_RAGRS. + :type secondary_endpoints: + ~azure.mgmt.storage.v2015_06_15.models.Endpoints + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + } + + def __init__(self, *, location: str=None, tags=None, provisioning_state=None, account_type=None, primary_endpoints=None, primary_location: str=None, status_of_primary=None, last_geo_failover_time=None, secondary_location: str=None, status_of_secondary=None, creation_time=None, custom_domain=None, secondary_endpoints=None, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.account_type = account_type + self.primary_endpoints = primary_endpoints + self.primary_location = primary_location + self.status_of_primary = status_of_primary + self.last_geo_failover_time = last_geo_failover_time + self.secondary_location = secondary_location + self.status_of_secondary = status_of_secondary + self.creation_time = creation_time + self.custom_domain = custom_domain + self.secondary_endpoints = secondary_endpoints diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters.py index 84c9188dc0a6..2c7a28c67fcb 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters.py @@ -15,7 +15,9 @@ class StorageAccountRegenerateKeyParameters(Model): """The parameters used to regenerate the storage account key. - :param key_name: + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. :type key_name: str """ @@ -27,6 +29,6 @@ class StorageAccountRegenerateKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, key_name): - super(StorageAccountRegenerateKeyParameters, self).__init__() - self.key_name = key_name + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..7db8cb2a22c8 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters.py index dd7c07a3e7c7..fe75ca2c19d7 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters.py @@ -37,8 +37,8 @@ class StorageAccountUpdateParameters(Model): 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, } - def __init__(self, tags=None, account_type=None, custom_domain=None): - super(StorageAccountUpdateParameters, self).__init__() - self.tags = tags - self.account_type = account_type - self.custom_domain = custom_domain + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.account_type = kwargs.get('account_type', None) + self.custom_domain = kwargs.get('custom_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..209bbe72a289 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters to update on the account. + + :param tags: Resource tags + :type tags: dict[str, str] + :param account_type: The account type. Note that StandardZRS and + PremiumLRS accounts cannot be changed to other account types, and other + account types cannot be changed to StandardZRS or PremiumLRS. Possible + values include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', + 'Standard_RAGRS', 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountType + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + } + + def __init__(self, *, tags=None, account_type=None, custom_domain=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.account_type = account_type + self.custom_domain = custom_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_management_client_enums.py index 658b97b944f0..1dcc79636a1c 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_management_client_enums.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class Reason(Enum): +class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" already_exists = "AlreadyExists" -class AccountType(Enum): +class AccountType(str, Enum): standard_lrs = "Standard_LRS" standard_zrs = "Standard_ZRS" @@ -27,20 +27,20 @@ class AccountType(Enum): premium_lrs = "Premium_LRS" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" resolving_dns = "ResolvingDNS" succeeded = "Succeeded" -class AccountStatus(Enum): +class AccountStatus(str, Enum): available = "Available" unavailable = "Unavailable" -class UsageUnit(Enum): +class UsageUnit(str, Enum): count = "Count" bytes = "Bytes" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage.py index 20fce4915404..ccf7c87a712a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage.py @@ -15,16 +15,19 @@ class Usage(Model): """Describes Storage Resource Usage. - :param unit: The unit of measurement. Possible values include: 'Count', - 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond' + All required parameters must be populated in order to send to Azure. + + :param unit: Required. The unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' :type unit: str or ~azure.mgmt.storage.v2015_06_15.models.UsageUnit - :param current_value: The current count of the allocated resources in the - subscription. + :param current_value: Required. The current count of the allocated + resources in the subscription. :type current_value: int - :param limit: The maximum count of the resources that can be allocated in - the subscription. + :param limit: Required. The maximum count of the resources that can be + allocated in the subscription. :type limit: int - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.storage.v2015_06_15.models.UsageName """ @@ -42,9 +45,9 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self, unit, current_value, limit, name): - super(Usage, self).__init__() - self.unit = unit - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = kwargs.get('unit', None) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name.py index 4349a2459bd0..1c1c30fcd44f 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name_py3.py new file mode 100644 index 000000000000..f6177205032b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The Usage Names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_py3.py new file mode 100644 index 000000000000..2f833b9c55bb --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + All required parameters must be populated in order to send to Azure. + + :param unit: Required. The unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :type unit: str or ~azure.mgmt.storage.v2015_06_15.models.UsageUnit + :param current_value: Required. The current count of the allocated + resources in the subscription. + :type current_value: int + :param limit: Required. The maximum count of the resources that can be + allocated in the subscription. + :type limit: int + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.storage.v2015_06_15.models.UsageName + """ + + _validation = { + 'unit': {'required': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, *, unit, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = unit + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/storage_accounts_operations.py index b28840ee5972..b74fb3f18808 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/storage_accounts_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/storage_accounts_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class StorageAccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -62,7 +62,7 @@ def check_name_availability( account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name, type=type) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -105,12 +105,13 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} def _create_initial( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -157,7 +158,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties @@ -176,13 +177,16 @@ def create( :type parameters: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - StorageAccount or ClientRawResponse if raw=true + :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 StorageAccount or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2015_06_15.models.StorageAccount] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2015_06_15.models.StorageAccount]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -193,30 +197,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('StorageAccount', response) if raw: @@ -225,12 +207,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def delete( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -253,7 +237,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -287,6 +271,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def get_properties( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -312,7 +297,7 @@ def get_properties( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.get_properties.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -353,6 +338,7 @@ def get_properties( return client_raw_response return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def update( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -388,7 +374,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -433,6 +419,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -454,7 +441,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -499,6 +486,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -523,7 +511,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -569,6 +557,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -592,7 +581,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -633,6 +622,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} def regenerate_key( self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): @@ -660,7 +650,7 @@ def regenerate_key( regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -705,3 +695,4 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/usage_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/usage_operations.py index d48030dca417..06a094462479 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/usage_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/storage_management_client.py index 05158a4b7e37..650b2da7afd5 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/storage_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -52,7 +52,7 @@ def __init__( self.subscription_id = subscription_id -class StorageManagementClient(object): +class StorageManagementClient(SDKClient): """The Azure Storage Management API. :ivar config: Configuration for client. @@ -77,7 +77,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2015-06-15' diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/__init__.py index 52e83798962c..75c1e72f7e5a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/__init__.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/__init__.py @@ -9,23 +9,42 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters -from .check_name_availability_result import CheckNameAvailabilityResult -from .sku import Sku -from .custom_domain import CustomDomain -from .encryption_service import EncryptionService -from .encryption_services import EncryptionServices -from .encryption import Encryption -from .storage_account_create_parameters import StorageAccountCreateParameters -from .endpoints import Endpoints -from .storage_account import StorageAccount -from .storage_account_key import StorageAccountKey -from .storage_account_list_keys_result import StorageAccountListKeysResult -from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters -from .storage_account_update_parameters import StorageAccountUpdateParameters -from .usage_name import UsageName -from .usage import Usage -from .resource import Resource +try: + from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .sku_py3 import Sku + from .custom_domain_py3 import CustomDomain + from .encryption_service_py3 import EncryptionService + from .encryption_services_py3 import EncryptionServices + from .encryption_py3 import Encryption + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .endpoints_py3 import Endpoints + from .storage_account_py3 import StorageAccount + from .storage_account_key_py3 import StorageAccountKey + from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .resource_py3 import Resource +except (SyntaxError, ImportError): + from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters + from .check_name_availability_result import CheckNameAvailabilityResult + from .sku import Sku + from .custom_domain import CustomDomain + from .encryption_service import EncryptionService + from .encryption_services import EncryptionServices + from .encryption import Encryption + from .storage_account_create_parameters import StorageAccountCreateParameters + from .endpoints import Endpoints + from .storage_account import StorageAccount + from .storage_account_key import StorageAccountKey + from .storage_account_list_keys_result import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .usage_name import UsageName + from .usage import Usage + from .resource import Resource from .storage_account_paged import StorageAccountPaged from .usage_paged import UsagePaged from .storage_management_client_enums import ( diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result.py index 209d08f2b4fa..607746dcc9c6 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result.py @@ -43,8 +43,8 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(CheckNameAvailabilityResult, self).__init__() + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = None self.reason = None self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..1097df019f89 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2016_01_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain.py index 12b0f7691888..585480d7321a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain.py @@ -16,8 +16,10 @@ class CustomDomain(Model): """The custom domain assigned to this storage account. This can be set via Update. - :param name: Gets or sets the custom domain name assigned to the storage - account. Name is the CNAME source. + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. :type name: str :param use_sub_domain: Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. @@ -33,7 +35,7 @@ class CustomDomain(Model): 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, } - def __init__(self, name, use_sub_domain=None): - super(CustomDomain, self).__init__() - self.name = name - self.use_sub_domain = use_sub_domain + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain = kwargs.get('use_sub_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain_py3.py new file mode 100644 index 000000000000..4c6fe3f83e35 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain = use_sub_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption.py index cae23af7bca8..c46481adbbc4 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption.py @@ -18,11 +18,13 @@ class Encryption(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2016_01_01.models.EncryptionServices - :ivar key_source: The encryption keySource (provider). Possible values - (case-insensitive): Microsoft.Storage. Default value: "Microsoft.Storage" - . + :ivar key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage. Default value: + "Microsoft.Storage" . :vartype key_source: str """ @@ -37,6 +39,6 @@ class Encryption(Model): key_source = "Microsoft.Storage" - def __init__(self, services=None): - super(Encryption, self).__init__() - self.services = services + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_py3.py new file mode 100644 index 000000000000..383fa5043505 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Encryption(Model): + """The encryption settings on the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2016_01_01.models.EncryptionServices + :ivar key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage. Default value: + "Microsoft.Storage" . + :vartype key_source: str + """ + + _validation = { + 'key_source': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + } + + key_source = "Microsoft.Storage" + + def __init__(self, *, services=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service.py index 0e033e9fe4a8..3a020c468f64 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service.py @@ -37,7 +37,7 @@ class EncryptionService(Model): 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, } - def __init__(self, enabled=None): - super(EncryptionService, self).__init__() - self.enabled = enabled + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service_py3.py new file mode 100644 index 000000000000..0566050c6155 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services.py index a8a53be357fd..3a4b4220b30c 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services.py @@ -23,6 +23,6 @@ class EncryptionServices(Model): 'blob': {'key': 'blob', 'type': 'EncryptionService'}, } - def __init__(self, blob=None): - super(EncryptionServices, self).__init__() - self.blob = blob + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services_py3.py new file mode 100644 index 000000000000..f532ee943c44 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionServices(Model): + """A list of services that support encryption. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2016_01_01.models.EncryptionService + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints.py index 2524757f961f..ec345fceac47 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints.py @@ -43,8 +43,8 @@ class Endpoints(Model): 'file': {'key': 'file', 'type': 'str'}, } - def __init__(self): - super(Endpoints, self).__init__() + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) self.blob = None self.queue = None self.table = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints_py3.py new file mode 100644 index 000000000000..a186e9c8d6a9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource.py index 3902a130aaa3..507c1d65d1f1 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource.py @@ -45,10 +45,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource_py3.py new file mode 100644 index 000000000000..5ac41076732b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku.py index a2a9dd517afa..7c56ee2a4425 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku.py @@ -18,10 +18,12 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Gets or sets the sku name. Required for account creation; - optional for update. Note that in older versions, sku name was called - accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', - 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' :type name: str or ~azure.mgmt.storage.v2016_01_01.models.SkuName :ivar tier: Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium' @@ -38,7 +40,7 @@ class Sku(Model): 'tier': {'key': 'tier', 'type': 'SkuTier'}, } - def __init__(self, name): - super(Sku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku_py3.py new file mode 100644 index 000000000000..af05828327a9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """The SKU of the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2016_01_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2016_01_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account.py index 221371702832..12960dd593c2 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account.py @@ -132,8 +132,8 @@ class StorageAccount(Resource): 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, } - def __init__(self, location=None, tags=None): - super(StorageAccount, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) self.sku = None self.kind = None self.provisioning_state = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters.py index 407c69e144c1..9a2d8ca2606d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters.py @@ -18,9 +18,12 @@ class StorageAccountCheckNameAvailabilityParameters(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: + All required parameters must be populated in order to send to Azure. + + :param name: Required. :type name: str - :ivar type: Default value: "Microsoft.Storage/storageAccounts" . + :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" + . :vartype type: str """ @@ -36,6 +39,6 @@ class StorageAccountCheckNameAvailabilityParameters(Model): type = "Microsoft.Storage/storageAccounts" - def __init__(self, name): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..18b651d829cf --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """StorageAccountCheckNameAvailabilityParameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" + . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters.py index ab1ce4ea064d..288c7841a3e4 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters.py @@ -15,16 +15,18 @@ class StorageAccountCreateParameters(Model): """The parameters used when creating a storage account. - :param sku: Required. Gets or sets the sku name. + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku - :param kind: Required. Indicates the type of storage account. Possible - values include: 'Storage', 'BlobStorage' + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' :type kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind - :param location: Required. Gets or sets the location of the resource. This - will be one of the supported and registered Azure Geo Regions (e.g. West - US, East US, Southeast Asia, etc.). The geo region of a resource cannot be - changed once it is created, but if an identical geo region is specified on - update, the request will succeed. + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. :type location: str :param tags: Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource @@ -64,12 +66,12 @@ class StorageAccountCreateParameters(Model): 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, } - def __init__(self, sku, kind, location, tags=None, custom_domain=None, encryption=None, access_tier=None): - super(StorageAccountCreateParameters, self).__init__() - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..e97e1a0118bc --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_01_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_01_01.models.AccessTier + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, custom_domain=None, encryption=None, access_tier=None, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key.py index 8b727e4791b5..b1ffbda9be4d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key.py @@ -40,8 +40,8 @@ class StorageAccountKey(Model): 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, } - def __init__(self): - super(StorageAccountKey, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) self.key_name = None self.value = None self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key_py3.py new file mode 100644 index 000000000000..85b307d1ca63 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'READ', 'FULL' + :vartype permissions: str or + ~azure.mgmt.storage.v2016_01_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result.py index 7a9420bfcaa3..4112d1bb62eb 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result.py @@ -32,6 +32,6 @@ class StorageAccountListKeysResult(Model): 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, } - def __init__(self): - super(StorageAccountListKeysResult, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result_py3.py new file mode 100644 index 000000000000..877ab0fe34f2 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2016_01_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_py3.py new file mode 100644 index 000000000000..df821e3ca0bf --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_py3.py @@ -0,0 +1,150 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2016_01_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2016_01_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2016_01_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'Available', 'Unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2016_01_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'Available', 'Unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2016_01_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2016_01_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2016_01_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2016_01_01.models.AccessTier + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = None + self.kind = None + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters.py index 2a5a3636bdc4..594bb550c5da 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters.py @@ -15,7 +15,9 @@ class StorageAccountRegenerateKeyParameters(Model): """StorageAccountRegenerateKeyParameters. - :param key_name: + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. :type key_name: str """ @@ -27,6 +29,6 @@ class StorageAccountRegenerateKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, key_name): - super(StorageAccountRegenerateKeyParameters, self).__init__() - self.key_name = key_name + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..30cb1c6f312b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """StorageAccountRegenerateKeyParameters. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters.py index ee038b085fb7..705ccbf2421f 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters.py @@ -49,10 +49,10 @@ class StorageAccountUpdateParameters(Model): 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, } - def __init__(self, sku=None, tags=None, custom_domain=None, encryption=None, access_tier=None): - super(StorageAccountUpdateParameters, self).__init__() - self.sku = sku - self.tags = tags - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..377e7f343884 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_01_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_01_01.models.AccessTier + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + } + + def __init__(self, *, sku=None, tags=None, custom_domain=None, encryption=None, access_tier=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_management_client_enums.py index 417c2ade8def..3bf3c6dc52d8 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_management_client_enums.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class Reason(Enum): +class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" already_exists = "AlreadyExists" -class SkuName(Enum): +class SkuName(str, Enum): standard_lrs = "Standard_LRS" standard_grs = "Standard_GRS" @@ -27,44 +27,44 @@ class SkuName(Enum): premium_lrs = "Premium_LRS" -class SkuTier(Enum): +class SkuTier(str, Enum): standard = "Standard" premium = "Premium" -class AccessTier(Enum): +class AccessTier(str, Enum): hot = "Hot" cool = "Cool" -class Kind(Enum): +class Kind(str, Enum): storage = "Storage" blob_storage = "BlobStorage" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" resolving_dns = "ResolvingDNS" succeeded = "Succeeded" -class AccountStatus(Enum): +class AccountStatus(str, Enum): available = "Available" unavailable = "Unavailable" -class KeyPermission(Enum): +class KeyPermission(str, Enum): read = "READ" full = "FULL" -class UsageUnit(Enum): +class UsageUnit(str, Enum): count = "Count" bytes = "Bytes" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage.py index c6187d094c1c..bf3ddefc1e62 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage.py @@ -46,8 +46,8 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.unit = None self.current_value = None self.limit = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name.py index c09f75b38c9a..e4082bf52384 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name.py @@ -35,7 +35,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self): - super(UsageName, self).__init__() + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name_py3.py new file mode 100644 index 000000000000..f519bb5072b1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_py3.py new file mode 100644 index 000000000000..a0bbc747199c --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2016_01_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2016_01_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/storage_accounts_operations.py index 6e219e1fb6bf..19bdbef3c91d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/storage_accounts_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/storage_accounts_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class StorageAccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-01-01". """ @@ -60,7 +60,7 @@ def check_name_availability( account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -103,12 +103,13 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} def _create_initial( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -155,7 +156,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties @@ -174,13 +175,16 @@ def create( :type parameters: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - StorageAccount or ClientRawResponse if raw=true + :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 StorageAccount or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2016_01_01.models.StorageAccount] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2016_01_01.models.StorageAccount]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -191,30 +195,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('StorageAccount', response) if raw: @@ -223,12 +205,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def delete( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -251,7 +235,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -285,6 +269,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def get_properties( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -310,7 +295,7 @@ def get_properties( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.get_properties.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -351,6 +336,7 @@ def get_properties( return client_raw_response return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def update( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -386,7 +372,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -431,6 +417,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -452,7 +439,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -497,6 +484,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -521,7 +509,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -567,6 +555,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -591,7 +580,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -632,6 +621,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} def regenerate_key( self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): @@ -660,7 +650,7 @@ def regenerate_key( regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -705,3 +695,4 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/usage_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/usage_operations.py index 4f4d971bc9b5..d8caf7c34ffb 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/usage_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-01-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/storage_management_client.py index b4c588c1f98d..cd8690faf72d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/storage_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -52,7 +52,7 @@ def __init__( self.subscription_id = subscription_id -class StorageManagementClient(object): +class StorageManagementClient(SDKClient): """The Storage Management Client. :ivar config: Configuration for client. @@ -77,7 +77,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2016-01-01' diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/__init__.py index 96aa43044b35..17649f574f30 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/__init__.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/__init__.py @@ -9,27 +9,50 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters -from .check_name_availability_result import CheckNameAvailabilityResult -from .sku import Sku -from .custom_domain import CustomDomain -from .encryption_service import EncryptionService -from .encryption_services import EncryptionServices -from .encryption import Encryption -from .storage_account_create_parameters import StorageAccountCreateParameters -from .endpoints import Endpoints -from .storage_account import StorageAccount -from .storage_account_key import StorageAccountKey -from .storage_account_list_keys_result import StorageAccountListKeysResult -from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters -from .storage_account_update_parameters import StorageAccountUpdateParameters -from .usage_name import UsageName -from .usage import Usage -from .resource import Resource -from .account_sas_parameters import AccountSasParameters -from .list_account_sas_response import ListAccountSasResponse -from .service_sas_parameters import ServiceSasParameters -from .list_service_sas_response import ListServiceSasResponse +try: + from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .sku_py3 import Sku + from .custom_domain_py3 import CustomDomain + from .encryption_service_py3 import EncryptionService + from .encryption_services_py3 import EncryptionServices + from .encryption_py3 import Encryption + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .endpoints_py3 import Endpoints + from .storage_account_py3 import StorageAccount + from .storage_account_key_py3 import StorageAccountKey + from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .resource_py3 import Resource + from .account_sas_parameters_py3 import AccountSasParameters + from .list_account_sas_response_py3 import ListAccountSasResponse + from .service_sas_parameters_py3 import ServiceSasParameters + from .list_service_sas_response_py3 import ListServiceSasResponse +except (SyntaxError, ImportError): + from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters + from .check_name_availability_result import CheckNameAvailabilityResult + from .sku import Sku + from .custom_domain import CustomDomain + from .encryption_service import EncryptionService + from .encryption_services import EncryptionServices + from .encryption import Encryption + from .storage_account_create_parameters import StorageAccountCreateParameters + from .endpoints import Endpoints + from .storage_account import StorageAccount + from .storage_account_key import StorageAccountKey + from .storage_account_list_keys_result import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .usage_name import UsageName + from .usage import Usage + from .resource import Resource + from .account_sas_parameters import AccountSasParameters + from .list_account_sas_response import ListAccountSasResponse + from .service_sas_parameters import ServiceSasParameters + from .list_service_sas_response import ListServiceSasResponse from .storage_account_paged import StorageAccountPaged from .usage_paged import UsagePaged from .storage_management_client_enums import ( diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters.py index e1661f150230..2d017cd9b398 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters.py @@ -15,20 +15,22 @@ class AccountSasParameters(Model): """The parameters to list SAS credentials of a storage account. - :param services: The signed services accessible with the account SAS. - Possible values include: Blob (b), Queue (q), Table (t), File (f). + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f' :type services: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param resource_types: The signed resource types that are accessible with - the account SAS. Service (s): Access to service-level APIs; Container (c): - Access to container-level APIs; Object (o): Access to object-level APIs - for blobs, queue messages, table entities, and files. Possible values - include: 's', 'c', 'o' + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' :type resource_types: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param permissions: The signed permissions for the account SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum :param ip_address_or_range: An IP address or a range of IP addresses from which to accept requests. @@ -39,8 +41,8 @@ class AccountSasParameters(Model): ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol :param shared_access_start_time: The time at which the SAS becomes valid. :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. :type shared_access_expiry_time: datetime :param key_to_sign: The key to sign the account SAS token with. :type key_to_sign: str @@ -64,13 +66,13 @@ class AccountSasParameters(Model): 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, } - def __init__(self, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range=None, protocols=None, shared_access_start_time=None, key_to_sign=None): - super(AccountSasParameters, self).__init__() - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters_py3.py new file mode 100644 index 000000000000..c8475408c008 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result.py index d1db8ad1e04a..af912f7c3b07 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result.py @@ -43,8 +43,8 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(CheckNameAvailabilityResult, self).__init__() + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = None self.reason = None self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..144a9164dd8b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2016_12_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain.py index 12b0f7691888..585480d7321a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain.py @@ -16,8 +16,10 @@ class CustomDomain(Model): """The custom domain assigned to this storage account. This can be set via Update. - :param name: Gets or sets the custom domain name assigned to the storage - account. Name is the CNAME source. + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. :type name: str :param use_sub_domain: Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. @@ -33,7 +35,7 @@ class CustomDomain(Model): 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, } - def __init__(self, name, use_sub_domain=None): - super(CustomDomain, self).__init__() - self.name = name - self.use_sub_domain = use_sub_domain + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain = kwargs.get('use_sub_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain_py3.py new file mode 100644 index 000000000000..4c6fe3f83e35 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain = use_sub_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption.py index eeea7426d2b5..dbc7f6963178 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption.py @@ -18,11 +18,13 @@ class Encryption(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2016_12_01.models.EncryptionServices - :ivar key_source: The encryption keySource (provider). Possible values - (case-insensitive): Microsoft.Storage. Default value: "Microsoft.Storage" - . + :ivar key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage. Default value: + "Microsoft.Storage" . :vartype key_source: str """ @@ -37,6 +39,6 @@ class Encryption(Model): key_source = "Microsoft.Storage" - def __init__(self, services=None): - super(Encryption, self).__init__() - self.services = services + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_py3.py new file mode 100644 index 000000000000..8ebcceb015b8 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Encryption(Model): + """The encryption settings on the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2016_12_01.models.EncryptionServices + :ivar key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage. Default value: + "Microsoft.Storage" . + :vartype key_source: str + """ + + _validation = { + 'key_source': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + } + + key_source = "Microsoft.Storage" + + def __init__(self, *, services=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service.py index 0e033e9fe4a8..3a020c468f64 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service.py @@ -37,7 +37,7 @@ class EncryptionService(Model): 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, } - def __init__(self, enabled=None): - super(EncryptionService, self).__init__() - self.enabled = enabled + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service_py3.py new file mode 100644 index 000000000000..0566050c6155 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services.py index 561e4eb812d1..47fdda835f1e 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services.py @@ -40,9 +40,9 @@ class EncryptionServices(Model): 'queue': {'key': 'queue', 'type': 'EncryptionService'}, } - def __init__(self, blob=None, file=None): - super(EncryptionServices, self).__init__() - self.blob = blob - self.file = file + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) self.table = None self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services_py3.py new file mode 100644 index 000000000000..9bb0c2c5928a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints.py index 2524757f961f..ec345fceac47 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints.py @@ -43,8 +43,8 @@ class Endpoints(Model): 'file': {'key': 'file', 'type': 'str'}, } - def __init__(self): - super(Endpoints, self).__init__() + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) self.blob = None self.queue = None self.table = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints_py3.py new file mode 100644 index 000000000000..a186e9c8d6a9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response.py index 5d8b8c53cd6f..a56e959a34bd 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response.py @@ -30,6 +30,6 @@ class ListAccountSasResponse(Model): 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, } - def __init__(self): - super(ListAccountSasResponse, self).__init__() + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response_py3.py new file mode 100644 index 000000000000..b8b9a314d9f6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response.py index e3c12854fe67..800c0298af61 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response.py @@ -31,6 +31,6 @@ class ListServiceSasResponse(Model): 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, } - def __init__(self): - super(ListServiceSasResponse, self).__init__() + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response_py3.py new file mode 100644 index 000000000000..cffd962e2041 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of speicific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource.py index dda2316a332f..125d6e4790b9 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource.py @@ -45,10 +45,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource_py3.py new file mode 100644 index 000000000000..7c1ccbf3aae1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters.py index baa726e85535..409165cad585 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters.py @@ -15,11 +15,14 @@ class ServiceSasParameters(Model): """The parameters to list service SAS credentials of a speicific resource. - :param canonicalized_resource: The canonical path to the signed resource. + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' :type resource: str or ~azure.mgmt.storage.v2016_12_01.models.enum :param permissions: The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create @@ -94,23 +97,23 @@ class ServiceSasParameters(Model): 'content_type': {'key': 'rsct', 'type': 'str'}, } - def __init__(self, canonicalized_resource, resource, permissions=None, ip_address_or_range=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier=None, partition_key_start=None, partition_key_end=None, row_key_start=None, row_key_end=None, key_to_sign=None, cache_control=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None): - super(ServiceSasParameters, self).__init__() - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters_py3.py new file mode 100644 index 000000000000..f5692795d7c6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters_py3.py @@ -0,0 +1,119 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a speicific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku.py index 15a2d3ff4178..82fc001bf07b 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku.py @@ -18,10 +18,12 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Gets or sets the sku name. Required for account creation; - optional for update. Note that in older versions, sku name was called - accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', - 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' :type name: str or ~azure.mgmt.storage.v2016_12_01.models.SkuName :ivar tier: Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium' @@ -38,7 +40,7 @@ class Sku(Model): 'tier': {'key': 'tier', 'type': 'SkuTier'}, } - def __init__(self, name): - super(Sku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku_py3.py new file mode 100644 index 000000000000..62eb64d55d00 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """The SKU of the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2016_12_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2016_12_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account.py index 560774035ce3..95621cc3b8de 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account.py @@ -136,8 +136,8 @@ class StorageAccount(Resource): 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, } - def __init__(self, location=None, tags=None, enable_https_traffic_only=False): - super(StorageAccount, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) self.sku = None self.kind = None self.provisioning_state = None @@ -152,4 +152,4 @@ def __init__(self, location=None, tags=None, enable_https_traffic_only=False): self.secondary_endpoints = None self.encryption = None self.access_tier = None - self.enable_https_traffic_only = enable_https_traffic_only + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters.py index 93dbd18c6f51..ffc402741b90 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters.py @@ -18,9 +18,12 @@ class StorageAccountCheckNameAvailabilityParameters(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: + All required parameters must be populated in order to send to Azure. + + :param name: Required. :type name: str - :ivar type: Default value: "Microsoft.Storage/storageAccounts" . + :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" + . :vartype type: str """ @@ -36,6 +39,6 @@ class StorageAccountCheckNameAvailabilityParameters(Model): type = "Microsoft.Storage/storageAccounts" - def __init__(self, name): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..e877df0e7854 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the storage account name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" + . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters.py index 190aa4cbff25..24bcdd36975d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters.py @@ -15,16 +15,18 @@ class StorageAccountCreateParameters(Model): """The parameters used when creating a storage account. - :param sku: Required. Gets or sets the sku name. + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku - :param kind: Required. Indicates the type of storage account. Possible - values include: 'Storage', 'BlobStorage' + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' :type kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind - :param location: Required. Gets or sets the location of the resource. This - will be one of the supported and registered Azure Geo Regions (e.g. West - US, East US, Southeast Asia, etc.). The geo region of a resource cannot be - changed once it is created, but if an identical geo region is specified on - update, the request will succeed. + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. :type location: str :param tags: Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource @@ -68,13 +70,13 @@ class StorageAccountCreateParameters(Model): 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, } - def __init__(self, sku, kind, location, tags=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only=False): - super(StorageAccountCreateParameters, self).__init__() - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..c6132db9c30c --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters_py3.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_12_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_12_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key.py index cd3af6e71ca1..8d9349326908 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key.py @@ -40,8 +40,8 @@ class StorageAccountKey(Model): 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, } - def __init__(self): - super(StorageAccountKey, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) self.key_name = None self.value = None self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key_py3.py new file mode 100644 index 000000000000..cb0ab68d14e9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2016_12_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result.py index 603e822c624c..cbe3092f67cd 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result.py @@ -32,6 +32,6 @@ class StorageAccountListKeysResult(Model): 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, } - def __init__(self): - super(StorageAccountListKeysResult, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result_py3.py new file mode 100644 index 000000000000..e87482fcd087 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2016_12_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_py3.py new file mode 100644 index 000000000000..b1eeeb04bd55 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_py3.py @@ -0,0 +1,155 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2016_12_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2016_12_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2016_12_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2016_12_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2016_12_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2016_12_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2016_12_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2016_12_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, location: str=None, tags=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = None + self.kind = None + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters.py index 84c9188dc0a6..2c7a28c67fcb 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters.py @@ -15,7 +15,9 @@ class StorageAccountRegenerateKeyParameters(Model): """The parameters used to regenerate the storage account key. - :param key_name: + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. :type key_name: str """ @@ -27,6 +29,6 @@ class StorageAccountRegenerateKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, key_name): - super(StorageAccountRegenerateKeyParameters, self).__init__() - self.key_name = key_name + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..7db8cb2a22c8 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py index 9b97bf82101d..f48e0ae87161 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py @@ -53,11 +53,11 @@ class StorageAccountUpdateParameters(Model): 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, } - def __init__(self, sku=None, tags=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only=False): - super(StorageAccountUpdateParameters, self).__init__() - self.sku = sku - self.tags = tags - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..9642815c7436 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_12_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_12_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku=None, tags=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_management_client_enums.py index 00f533d896f7..c5fff72ced34 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_management_client_enums.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class Reason(Enum): +class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" already_exists = "AlreadyExists" -class SkuName(Enum): +class SkuName(str, Enum): standard_lrs = "Standard_LRS" standard_grs = "Standard_GRS" @@ -27,44 +27,44 @@ class SkuName(Enum): premium_lrs = "Premium_LRS" -class SkuTier(Enum): +class SkuTier(str, Enum): standard = "Standard" premium = "Premium" -class AccessTier(Enum): +class AccessTier(str, Enum): hot = "Hot" cool = "Cool" -class Kind(Enum): +class Kind(str, Enum): storage = "Storage" blob_storage = "BlobStorage" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" resolving_dns = "ResolvingDNS" succeeded = "Succeeded" -class AccountStatus(Enum): +class AccountStatus(str, Enum): available = "available" unavailable = "unavailable" -class KeyPermission(Enum): +class KeyPermission(str, Enum): read = "Read" full = "Full" -class UsageUnit(Enum): +class UsageUnit(str, Enum): count = "Count" bytes = "Bytes" @@ -74,7 +74,7 @@ class UsageUnit(Enum): bytes_per_second = "BytesPerSecond" -class HttpProtocol(Enum): +class HttpProtocol(str, Enum): httpshttp = "https,http" https = "https" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage.py index 3917db7540ad..6aad2888dbca 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage.py @@ -46,8 +46,8 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.unit = None self.current_value = None self.limit = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name.py index c09f75b38c9a..e4082bf52384 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name.py @@ -35,7 +35,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self): - super(UsageName, self).__init__() + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name_py3.py new file mode 100644 index 000000000000..f519bb5072b1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_py3.py new file mode 100644 index 000000000000..26928cf23d85 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2016_12_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2016_12_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/storage_accounts_operations.py index ed6df8302580..eb337be00bc8 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/storage_accounts_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/storage_accounts_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class StorageAccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-12-01". """ @@ -60,7 +60,7 @@ def check_name_availability( account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -103,12 +103,13 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} def _create_initial( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -155,7 +156,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties @@ -174,13 +175,16 @@ def create( :type parameters: ~azure.mgmt.storage.v2016_12_01.models.StorageAccountCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - StorageAccount or ClientRawResponse if raw=true + :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 StorageAccount or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2016_12_01.models.StorageAccount] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2016_12_01.models.StorageAccount]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -191,30 +195,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('StorageAccount', response) if raw: @@ -223,12 +205,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def delete( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -251,7 +235,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -285,6 +269,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def get_properties( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -310,7 +295,7 @@ def get_properties( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.get_properties.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -351,6 +336,7 @@ def get_properties( return client_raw_response return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def update( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -386,7 +372,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -431,6 +417,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -452,7 +439,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -497,6 +484,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -521,7 +509,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -567,6 +555,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -591,7 +580,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -632,6 +621,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} def regenerate_key( self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): @@ -660,7 +650,7 @@ def regenerate_key( regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -705,6 +695,7 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} def list_account_sas( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -732,7 +723,7 @@ def list_account_sas( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas' + url = self.list_account_sas.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -777,6 +768,7 @@ def list_account_sas( return client_raw_response return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} def list_service_sas( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -804,7 +796,7 @@ def list_service_sas( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas' + url = self.list_service_sas.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -849,3 +841,4 @@ def list_service_sas( return client_raw_response return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/usage_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/usage_operations.py index 236baad51d92..5ea32cd89d82 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/usage_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-12-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/storage_management_client.py index 105967b9c7f7..0f668eb0225e 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/storage_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -52,7 +52,7 @@ def __init__( self.subscription_id = subscription_id -class StorageManagementClient(object): +class StorageManagementClient(SDKClient): """The Azure Storage Management API. :ivar config: Configuration for client. @@ -77,7 +77,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2016-12-01' diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py index 8e493a3a2641..d3d602c0775b 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py @@ -9,39 +9,74 @@ # regenerated. # -------------------------------------------------------------------------- -from .operation_display import OperationDisplay -from .dimension import Dimension -from .metric_specification import MetricSpecification -from .service_specification import ServiceSpecification -from .operation import Operation -from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters -from .sku_capability import SKUCapability -from .restriction import Restriction -from .sku import Sku -from .check_name_availability_result import CheckNameAvailabilityResult -from .custom_domain import CustomDomain -from .encryption_service import EncryptionService -from .encryption_services import EncryptionServices -from .key_vault_properties import KeyVaultProperties -from .encryption import Encryption -from .virtual_network_rule import VirtualNetworkRule -from .ip_rule import IPRule -from .network_rule_set import NetworkRuleSet -from .identity import Identity -from .storage_account_create_parameters import StorageAccountCreateParameters -from .endpoints import Endpoints -from .storage_account import StorageAccount -from .storage_account_key import StorageAccountKey -from .storage_account_list_keys_result import StorageAccountListKeysResult -from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters -from .storage_account_update_parameters import StorageAccountUpdateParameters -from .usage_name import UsageName -from .usage import Usage -from .resource import Resource -from .account_sas_parameters import AccountSasParameters -from .list_account_sas_response import ListAccountSasResponse -from .service_sas_parameters import ServiceSasParameters -from .list_service_sas_response import ListServiceSasResponse +try: + from .operation_display_py3 import OperationDisplay + from .dimension_py3 import Dimension + from .metric_specification_py3 import MetricSpecification + from .service_specification_py3 import ServiceSpecification + from .operation_py3 import Operation + from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters + from .sku_capability_py3 import SKUCapability + from .restriction_py3 import Restriction + from .sku_py3 import Sku + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .custom_domain_py3 import CustomDomain + from .encryption_service_py3 import EncryptionService + from .encryption_services_py3 import EncryptionServices + from .key_vault_properties_py3 import KeyVaultProperties + from .encryption_py3 import Encryption + from .virtual_network_rule_py3 import VirtualNetworkRule + from .ip_rule_py3 import IPRule + from .network_rule_set_py3 import NetworkRuleSet + from .identity_py3 import Identity + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .endpoints_py3 import Endpoints + from .storage_account_py3 import StorageAccount + from .storage_account_key_py3 import StorageAccountKey + from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .resource_py3 import Resource + from .account_sas_parameters_py3 import AccountSasParameters + from .list_account_sas_response_py3 import ListAccountSasResponse + from .service_sas_parameters_py3 import ServiceSasParameters + from .list_service_sas_response_py3 import ListServiceSasResponse +except (SyntaxError, ImportError): + from .operation_display import OperationDisplay + from .dimension import Dimension + from .metric_specification import MetricSpecification + from .service_specification import ServiceSpecification + from .operation import Operation + from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters + from .sku_capability import SKUCapability + from .restriction import Restriction + from .sku import Sku + from .check_name_availability_result import CheckNameAvailabilityResult + from .custom_domain import CustomDomain + from .encryption_service import EncryptionService + from .encryption_services import EncryptionServices + from .key_vault_properties import KeyVaultProperties + from .encryption import Encryption + from .virtual_network_rule import VirtualNetworkRule + from .ip_rule import IPRule + from .network_rule_set import NetworkRuleSet + from .identity import Identity + from .storage_account_create_parameters import StorageAccountCreateParameters + from .endpoints import Endpoints + from .storage_account import StorageAccount + from .storage_account_key import StorageAccountKey + from .storage_account_list_keys_result import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .usage_name import UsageName + from .usage import Usage + from .resource import Resource + from .account_sas_parameters import AccountSasParameters + from .list_account_sas_response import ListAccountSasResponse + from .service_sas_parameters import ServiceSasParameters + from .list_service_sas_response import ListServiceSasResponse from .operation_paged import OperationPaged from .sku_paged import SkuPaged from .storage_account_paged import StorageAccountPaged diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters.py index 7f79a82412fb..754adb2c7441 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters.py @@ -15,21 +15,23 @@ class AccountSasParameters(Model): """The parameters to list SAS credentials of a storage account. - :param services: The signed services accessible with the account SAS. - Possible values include: Blob (b), Queue (q), Table (t), File (f). + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f' :type services: str or ~azure.mgmt.storage.v2017_06_01.models.Services - :param resource_types: The signed resource types that are accessible with - the account SAS. Service (s): Access to service-level APIs; Container (c): - Access to container-level APIs; Object (o): Access to object-level APIs - for blobs, queue messages, table entities, and files. Possible values - include: 's', 'c', 'o' + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' :type resource_types: str or ~azure.mgmt.storage.v2017_06_01.models.SignedResourceTypes - :param permissions: The signed permissions for the account SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' :type permissions: str or ~azure.mgmt.storage.v2017_06_01.models.Permissions :param ip_address_or_range: An IP address or a range of IP addresses from @@ -41,8 +43,8 @@ class AccountSasParameters(Model): ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol :param shared_access_start_time: The time at which the SAS becomes valid. :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. :type shared_access_expiry_time: datetime :param key_to_sign: The key to sign the account SAS token with. :type key_to_sign: str @@ -66,13 +68,13 @@ class AccountSasParameters(Model): 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, } - def __init__(self, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range=None, protocols=None, shared_access_start_time=None, key_to_sign=None): - super(AccountSasParameters, self).__init__() - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters_py3.py new file mode 100644 index 000000000000..3fc320834ec4 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2017_06_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2017_06_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result.py index 40ff88b90d63..22058e79e7ee 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result.py @@ -43,8 +43,8 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(CheckNameAvailabilityResult, self).__init__() + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = None self.reason = None self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..5b5ce7c34f2a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2017_06_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain.py index 12b0f7691888..585480d7321a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain.py @@ -16,8 +16,10 @@ class CustomDomain(Model): """The custom domain assigned to this storage account. This can be set via Update. - :param name: Gets or sets the custom domain name assigned to the storage - account. Name is the CNAME source. + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. :type name: str :param use_sub_domain: Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. @@ -33,7 +35,7 @@ class CustomDomain(Model): 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, } - def __init__(self, name, use_sub_domain=None): - super(CustomDomain, self).__init__() - self.name = name - self.use_sub_domain = use_sub_domain + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain = kwargs.get('use_sub_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain_py3.py new file mode 100644 index 000000000000..4c6fe3f83e35 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain = use_sub_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py index bf7b9383880f..0a0cdaf75da7 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py @@ -26,7 +26,7 @@ class Dimension(Model): 'display_name': {'key': 'displayName', 'type': 'str'}, } - def __init__(self, name=None, display_name=None): - super(Dimension, self).__init__() - self.name = name - self.display_name = display_name + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension_py3.py new file mode 100644 index 000000000000..6845aa528b4b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dimension(Model): + """Dimension of blobs, possiblly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption.py index e870314ca8c4..63e35db813c6 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption.py @@ -15,12 +15,14 @@ class Encryption(Model): """The encryption settings on the storage account. + All required parameters must be populated in order to send to Azure. + :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2017_06_01.models.EncryptionServices - :param key_source: The encryption keySource (provider). Possible values - (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible - values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. Default value: - "Microsoft.Storage" . + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . :type key_source: str or ~azure.mgmt.storage.v2017_06_01.models.KeySource :param key_vault_properties: Properties provided by key vault. :type key_vault_properties: @@ -37,8 +39,8 @@ class Encryption(Model): 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, } - def __init__(self, services=None, key_source="Microsoft.Storage", key_vault_properties=None): - super(Encryption, self).__init__() - self.services = services - self.key_source = key_source - self.key_vault_properties = key_vault_properties + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_py3.py new file mode 100644 index 000000000000..20c4c4c51120 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2017_06_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2017_06_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2017_06_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service.py index 0e033e9fe4a8..3a020c468f64 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service.py @@ -37,7 +37,7 @@ class EncryptionService(Model): 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, } - def __init__(self, enabled=None): - super(EncryptionService, self).__init__() - self.enabled = enabled + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service_py3.py new file mode 100644 index 000000000000..0566050c6155 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services.py index bb24ea11bb3d..4eaebd087b08 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services.py @@ -40,9 +40,9 @@ class EncryptionServices(Model): 'queue': {'key': 'queue', 'type': 'EncryptionService'}, } - def __init__(self, blob=None, file=None): - super(EncryptionServices, self).__init__() - self.blob = blob - self.file = file + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) self.table = None self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services_py3.py new file mode 100644 index 000000000000..eb0e237af96a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints.py index 2524757f961f..ec345fceac47 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints.py @@ -43,8 +43,8 @@ class Endpoints(Model): 'file': {'key': 'file', 'type': 'str'}, } - def __init__(self): - super(Endpoints, self).__init__() + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) self.blob = None self.queue = None self.table = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints_py3.py new file mode 100644 index 000000000000..a186e9c8d6a9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity.py index 5e7bac70c5e2..f526b986fc70 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity.py @@ -18,11 +18,13 @@ class Identity(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar principal_id: The principal ID of resource identity. :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: The identity type. Default value: "SystemAssigned" . + :ivar type: Required. The identity type. Default value: "SystemAssigned" . :vartype type: str """ @@ -40,7 +42,7 @@ class Identity(Model): type = "SystemAssigned" - def __init__(self): - super(Identity, self).__init__() + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity_py3.py new file mode 100644 index 000000000000..22d25fdd85b7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule.py index e0a36cd8e0cd..6dbbc87301f6 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule.py @@ -15,8 +15,10 @@ class IPRule(Model): """IP rule with specific IP or IP range in CIDR format. - :param ip_address_or_range: Specifies the IP or IP range in CIDR format. - Only IPV4 address is allowed. + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. :type ip_address_or_range: str :param action: The action of IP ACL rule. Possible values include: 'Allow'. Default value: "Allow" . @@ -32,7 +34,7 @@ class IPRule(Model): 'action': {'key': 'action', 'type': 'Action'}, } - def __init__(self, ip_address_or_range, action="Allow"): - super(IPRule, self).__init__() - self.ip_address_or_range = ip_address_or_range - self.action = action + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule_py3.py new file mode 100644 index 000000000000..3224cab4d7c1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_06_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties.py index 59657c3071b7..44eaf379f6f2 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties.py @@ -29,8 +29,8 @@ class KeyVaultProperties(Model): 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, } - def __init__(self, key_name=None, key_version=None, key_vault_uri=None): - super(KeyVaultProperties, self).__init__() - self.key_name = key_name - self.key_version = key_version - self.key_vault_uri = key_vault_uri + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties_py3.py new file mode 100644 index 000000000000..9e6350eec898 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response.py index 5d8b8c53cd6f..a56e959a34bd 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response.py @@ -30,6 +30,6 @@ class ListAccountSasResponse(Model): 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, } - def __init__(self): - super(ListAccountSasResponse, self).__init__() + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response_py3.py new file mode 100644 index 000000000000..b8b9a314d9f6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response.py index e3c12854fe67..800c0298af61 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response.py @@ -31,6 +31,6 @@ class ListServiceSasResponse(Model): 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, } - def __init__(self): - super(ListServiceSasResponse, self).__init__() + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response_py3.py new file mode 100644 index 000000000000..cffd962e2041 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of speicific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py index 82441f44e82a..b186b5d354e5 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py @@ -50,14 +50,14 @@ class MetricSpecification(Model): 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, display_description=None, unit=None, dimensions=None, aggregation_type=None, fill_gap_with_zero=None, category=None, resource_id_dimension_name_override=None): - super(MetricSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.dimensions = dimensions - self.aggregation_type = aggregation_type - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.resource_id_dimension_name_override = resource_id_dimension_name_override + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification_py3.py new file mode 100644 index 000000000000..0e8d1989c9f5 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2017_06_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py index 8ead92c80897..1f8226c1ccf1 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py @@ -15,6 +15,8 @@ class NetworkRuleSet(Model): """Network rule set. + All required parameters must be populated in order to send to Azure. + :param bypass: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None @@ -26,9 +28,9 @@ class NetworkRuleSet(Model): list[~azure.mgmt.storage.v2017_06_01.models.VirtualNetworkRule] :param ip_rules: Sets the IP ACL rules :type ip_rules: list[~azure.mgmt.storage.v2017_06_01.models.IPRule] - :param default_action: Specifies the default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . :type default_action: str or ~azure.mgmt.storage.v2017_06_01.models.DefaultAction """ @@ -44,9 +46,9 @@ class NetworkRuleSet(Model): 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, } - def __init__(self, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow"): - super(NetworkRuleSet, self).__init__() - self.bypass = bypass - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules - self.default_action = default_action + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set_py3.py new file mode 100644 index 000000000000..8380cbe38c6f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2017_06_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2017_06_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2017_06_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2017_06_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation.py index c82f8deeca38..4dc334ae71b8 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation.py @@ -34,9 +34,9 @@ class Operation(Model): 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, } - def __init__(self, name=None, display=None, origin=None, service_specification=None): - super(Operation, self).__init__() - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display.py index d31779b2891c..12d72186c4f2 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display.py @@ -29,8 +29,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display_py3.py new file mode 100644 index 000000000000..632a6393c99f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_py3.py new file mode 100644 index 000000000000..e78c4fa89bcd --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2017_06_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2017_06_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource.py index dda2316a332f..125d6e4790b9 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource.py @@ -45,10 +45,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource_py3.py new file mode 100644 index 000000000000..7c1ccbf3aae1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py index 68480a936ad4..fbbca74ff6a1 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py @@ -44,8 +44,8 @@ class Restriction(Model): 'reason_code': {'key': 'reasonCode', 'type': 'str'}, } - def __init__(self, reason_code=None): - super(Restriction, self).__init__() + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) self.type = None self.values = None - self.reason_code = reason_code + self.reason_code = kwargs.get('reason_code', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction_py3.py new file mode 100644 index 000000000000..762ae8e58374 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + “QuotaId” or “NotAvailableForSubscription”. Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The “NotAvailableForSubscription” is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2017_06_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters.py index e9e4b615799c..82ee97e72f43 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters.py @@ -15,11 +15,14 @@ class ServiceSasParameters(Model): """The parameters to list service SAS credentials of a speicific resource. - :param canonicalized_resource: The canonical path to the signed resource. + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' :type resource: str or ~azure.mgmt.storage.v2017_06_01.models.SignedResource :param permissions: The signed permissions for the service SAS. Possible @@ -96,23 +99,23 @@ class ServiceSasParameters(Model): 'content_type': {'key': 'rsct', 'type': 'str'}, } - def __init__(self, canonicalized_resource, resource, permissions=None, ip_address_or_range=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier=None, partition_key_start=None, partition_key_end=None, row_key_start=None, row_key_end=None, key_to_sign=None, cache_control=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None): - super(ServiceSasParameters, self).__init__() - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters_py3.py new file mode 100644 index 000000000000..eefd8c8308dc --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters_py3.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a speicific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2017_06_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification.py index a13689cd2dfd..56a5310b2b54 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification.py @@ -24,6 +24,6 @@ class ServiceSpecification(Model): 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, } - def __init__(self, metric_specifications=None): - super(ServiceSpecification, self).__init__() - self.metric_specifications = metric_specifications + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification_py3.py new file mode 100644 index 000000000000..3887c105db26 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2017_06_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py index e766e2f40d2f..36a138ff7a3e 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py @@ -18,10 +18,12 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Gets or sets the sku name. Required for account creation; - optional for update. Note that in older versions, sku name was called - accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', - 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' :type name: str or ~azure.mgmt.storage.v2017_06_01.models.SkuName :ivar tier: Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium' @@ -65,12 +67,12 @@ class Sku(Model): 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, } - def __init__(self, name, restrictions=None): - super(Sku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None self.resource_type = None self.kind = None self.locations = None self.capabilities = None - self.restrictions = restrictions + self.restrictions = kwargs.get('restrictions', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py index 70ee58e9fe89..b8fa68ce7778 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py @@ -38,7 +38,7 @@ class SKUCapability(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(SKUCapability, self).__init__() + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) self.name = None self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability_py3.py new file mode 100644 index 000000000000..f349a08eda21 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_py3.py new file mode 100644 index 000000000000..8bb382d64810 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """The SKU of the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2017_06_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2017_06_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2017_06_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2017_06_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py index 067ab49e28d4..b0efd1ae89e6 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py @@ -144,11 +144,11 @@ class StorageAccount(Resource): 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, } - def __init__(self, location=None, tags=None, identity=None, enable_https_traffic_only=False): - super(StorageAccount, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) self.sku = None self.kind = None - self.identity = identity + self.identity = kwargs.get('identity', None) self.provisioning_state = None self.primary_endpoints = None self.primary_location = None @@ -161,5 +161,5 @@ def __init__(self, location=None, tags=None, identity=None, enable_https_traffic self.secondary_endpoints = None self.encryption = None self.access_tier = None - self.enable_https_traffic_only = enable_https_traffic_only + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters.py index c67c674db438..42cf88a074a0 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters.py @@ -18,10 +18,13 @@ class StorageAccountCheckNameAvailabilityParameters(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The storage account name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The storage account name. :type name: str - :ivar type: The type of resource, Microsoft.Storage/storageAccounts. - Default value: "Microsoft.Storage/storageAccounts" . + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . :vartype type: str """ @@ -37,6 +40,6 @@ class StorageAccountCheckNameAvailabilityParameters(Model): type = "Microsoft.Storage/storageAccounts" - def __init__(self, name): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..e6f50a456902 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the storage account name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py index bcc49a503a6b..0ec87bb649c5 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py @@ -15,16 +15,18 @@ class StorageAccountCreateParameters(Model): """The parameters used when creating a storage account. - :param sku: Required. Gets or sets the sku name. + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku - :param kind: Required. Indicates the type of storage account. Possible - values include: 'Storage', 'BlobStorage' + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' :type kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind - :param location: Required. Gets or sets the location of the resource. This - will be one of the supported and registered Azure Geo Regions (e.g. West - US, East US, Southeast Asia, etc.). The geo region of a resource cannot be - changed once it is created, but if an identical geo region is specified on - update, the request will succeed. + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. :type location: str :param tags: Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource @@ -75,15 +77,15 @@ class StorageAccountCreateParameters(Model): 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, } - def __init__(self, sku, kind, location, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only=False): - super(StorageAccountCreateParameters, self).__init__() - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.network_rule_set = network_rule_set - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..77ecca9ce28e --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_06_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_06_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key.py index 2a5afd51b165..55028b0d3fef 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key.py @@ -40,8 +40,8 @@ class StorageAccountKey(Model): 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, } - def __init__(self): - super(StorageAccountKey, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) self.key_name = None self.value = None self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key_py3.py new file mode 100644 index 000000000000..ba59047babc0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2017_06_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result.py index 778728e930e2..67ac8d362f13 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result.py @@ -32,6 +32,6 @@ class StorageAccountListKeysResult(Model): 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, } - def __init__(self): - super(StorageAccountListKeysResult, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result_py3.py new file mode 100644 index 000000000000..8bc6439d5974 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2017_06_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_py3.py new file mode 100644 index 000000000000..d8714125411f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_py3.py @@ -0,0 +1,165 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2017_06_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2017_06_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2017_06_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2017_06_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2017_06_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2017_06_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2017_06_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2017_06_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str=None, tags=None, identity=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters.py index 0665efaf0a1b..ca7f33b25112 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters.py @@ -15,8 +15,10 @@ class StorageAccountRegenerateKeyParameters(Model): """The parameters used to regenerate the storage account key. - :param key_name: The name of storage keys that want to be regenerated, - possible vaules are key1, key2. + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible vaules are key1, key2. :type key_name: str """ @@ -28,6 +30,6 @@ class StorageAccountRegenerateKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, key_name): - super(StorageAccountRegenerateKeyParameters, self).__init__() - self.key_name = key_name + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..42f3c0b2e94a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible vaules are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py index 05d9de5210f3..6bfa979c2622 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py @@ -60,13 +60,13 @@ class StorageAccountUpdateParameters(Model): 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, } - def __init__(self, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only=False, network_rule_set=None): - super(StorageAccountUpdateParameters, self).__init__() - self.sku = sku - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = network_rule_set + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..9b331731d561 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters_py3.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_06_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_06_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py index b0070a6dd4e3..1153f7913492 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class ReasonCode(Enum): +class ReasonCode(str, Enum): quota_id = "QuotaId" not_available_for_subscription = "NotAvailableForSubscription" -class SkuName(Enum): +class SkuName(str, Enum): standard_lrs = "Standard_LRS" standard_grs = "Standard_GRS" @@ -27,36 +27,36 @@ class SkuName(Enum): premium_lrs = "Premium_LRS" -class SkuTier(Enum): +class SkuTier(str, Enum): standard = "Standard" premium = "Premium" -class Kind(Enum): +class Kind(str, Enum): storage = "Storage" blob_storage = "BlobStorage" -class Reason(Enum): +class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" already_exists = "AlreadyExists" -class KeySource(Enum): +class KeySource(str, Enum): microsoft_storage = "Microsoft.Storage" microsoft_keyvault = "Microsoft.Keyvault" -class Action(Enum): +class Action(str, Enum): allow = "Allow" -class State(Enum): +class State(str, Enum): provisioning = "provisioning" deprovisioning = "deprovisioning" @@ -65,7 +65,7 @@ class State(Enum): network_source_deleted = "networkSourceDeleted" -class Bypass(Enum): +class Bypass(str, Enum): none = "None" logging = "Logging" @@ -73,38 +73,38 @@ class Bypass(Enum): azure_services = "AzureServices" -class DefaultAction(Enum): +class DefaultAction(str, Enum): allow = "Allow" deny = "Deny" -class AccessTier(Enum): +class AccessTier(str, Enum): hot = "Hot" cool = "Cool" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" resolving_dns = "ResolvingDNS" succeeded = "Succeeded" -class AccountStatus(Enum): +class AccountStatus(str, Enum): available = "available" unavailable = "unavailable" -class KeyPermission(Enum): +class KeyPermission(str, Enum): read = "Read" full = "Full" -class UsageUnit(Enum): +class UsageUnit(str, Enum): count = "Count" bytes = "Bytes" @@ -114,7 +114,7 @@ class UsageUnit(Enum): bytes_per_second = "BytesPerSecond" -class Services(Enum): +class Services(str, Enum): b = "b" q = "q" @@ -122,14 +122,14 @@ class Services(Enum): f = "f" -class SignedResourceTypes(Enum): +class SignedResourceTypes(str, Enum): s = "s" c = "c" o = "o" -class Permissions(Enum): +class Permissions(str, Enum): r = "r" d = "d" @@ -141,13 +141,13 @@ class Permissions(Enum): p = "p" -class HttpProtocol(Enum): +class HttpProtocol(str, Enum): httpshttp = "https,http" https = "https" -class SignedResource(Enum): +class SignedResource(str, Enum): b = "b" c = "c" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage.py index 926878d01e79..c9bf28ceb25a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage.py @@ -46,8 +46,8 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.unit = None self.current_value = None self.limit = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name.py index c09f75b38c9a..e4082bf52384 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name.py @@ -35,7 +35,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self): - super(UsageName, self).__init__() + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name_py3.py new file mode 100644 index 000000000000..f519bb5072b1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_py3.py new file mode 100644 index 000000000000..d96ce4fe8177 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2017_06_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2017_06_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py index d7b4e274ea7f..0724a4bae9ae 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py @@ -15,7 +15,10 @@ class VirtualNetworkRule(Model): """Virtual Network rule. - :param virtual_network_resource_id: Resource ID of a subnet, for example: + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str :param action: The action of virtual network rule. Possible values @@ -37,8 +40,8 @@ class VirtualNetworkRule(Model): 'state': {'key': 'state', 'type': 'State'}, } - def __init__(self, virtual_network_resource_id, action="Allow", state=None): - super(VirtualNetworkRule, self).__init__() - self.virtual_network_resource_id = virtual_network_resource_id - self.action = action - self.state = state + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..b0bf9e282280 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_06_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2017_06_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/operations.py index ab88503d8bb5..acf3fd6834e4 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-06-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Storage/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -96,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py index 4ce7bf72863f..ace3b7af30fe 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py @@ -22,7 +22,7 @@ class SkusOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-06-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/storage_accounts_operations.py index 30acaec4ca09..06f4b0681273 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/storage_accounts_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/storage_accounts_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class StorageAccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-06-01". """ @@ -60,7 +60,7 @@ def check_name_availability( account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -103,12 +103,13 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} def _create_initial( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -155,7 +156,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties @@ -174,13 +175,16 @@ def create( :type parameters: ~azure.mgmt.storage.v2017_06_01.models.StorageAccountCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - StorageAccount or ClientRawResponse if raw=true + :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 StorageAccount or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2017_06_01.models.StorageAccount] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2017_06_01.models.StorageAccount]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -191,30 +195,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('StorageAccount', response) if raw: @@ -223,12 +205,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def delete( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -251,7 +235,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -285,6 +269,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def get_properties( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -310,7 +295,7 @@ def get_properties( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.get_properties.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -351,6 +336,7 @@ def get_properties( return client_raw_response return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def update( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -386,7 +372,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -431,6 +417,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -452,7 +439,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -497,6 +484,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -521,7 +509,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -567,6 +555,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -591,7 +580,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -632,6 +621,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} def regenerate_key( self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): @@ -661,7 +651,7 @@ def regenerate_key( regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -706,6 +696,7 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} def list_account_sas( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -733,7 +724,7 @@ def list_account_sas( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas' + url = self.list_account_sas.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -778,6 +769,7 @@ def list_account_sas( return client_raw_response return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} def list_service_sas( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -805,7 +797,7 @@ def list_service_sas( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas' + url = self.list_service_sas.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -850,3 +842,4 @@ def list_service_sas( return client_raw_response return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/usage_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/usage_operations.py index da88c394e36d..b67b64336173 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/usage_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-06-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py index 836bdc60aa25..db90f97ed22f 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -54,7 +54,7 @@ def __init__( self.subscription_id = subscription_id -class StorageManagementClient(object): +class StorageManagementClient(SDKClient): """The Azure Storage Management API. :ivar config: Configuration for client. @@ -83,7 +83,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2017-06-01' diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/__init__.py index 8e493a3a2641..d3d602c0775b 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/__init__.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/__init__.py @@ -9,39 +9,74 @@ # regenerated. # -------------------------------------------------------------------------- -from .operation_display import OperationDisplay -from .dimension import Dimension -from .metric_specification import MetricSpecification -from .service_specification import ServiceSpecification -from .operation import Operation -from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters -from .sku_capability import SKUCapability -from .restriction import Restriction -from .sku import Sku -from .check_name_availability_result import CheckNameAvailabilityResult -from .custom_domain import CustomDomain -from .encryption_service import EncryptionService -from .encryption_services import EncryptionServices -from .key_vault_properties import KeyVaultProperties -from .encryption import Encryption -from .virtual_network_rule import VirtualNetworkRule -from .ip_rule import IPRule -from .network_rule_set import NetworkRuleSet -from .identity import Identity -from .storage_account_create_parameters import StorageAccountCreateParameters -from .endpoints import Endpoints -from .storage_account import StorageAccount -from .storage_account_key import StorageAccountKey -from .storage_account_list_keys_result import StorageAccountListKeysResult -from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters -from .storage_account_update_parameters import StorageAccountUpdateParameters -from .usage_name import UsageName -from .usage import Usage -from .resource import Resource -from .account_sas_parameters import AccountSasParameters -from .list_account_sas_response import ListAccountSasResponse -from .service_sas_parameters import ServiceSasParameters -from .list_service_sas_response import ListServiceSasResponse +try: + from .operation_display_py3 import OperationDisplay + from .dimension_py3 import Dimension + from .metric_specification_py3 import MetricSpecification + from .service_specification_py3 import ServiceSpecification + from .operation_py3 import Operation + from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters + from .sku_capability_py3 import SKUCapability + from .restriction_py3 import Restriction + from .sku_py3 import Sku + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .custom_domain_py3 import CustomDomain + from .encryption_service_py3 import EncryptionService + from .encryption_services_py3 import EncryptionServices + from .key_vault_properties_py3 import KeyVaultProperties + from .encryption_py3 import Encryption + from .virtual_network_rule_py3 import VirtualNetworkRule + from .ip_rule_py3 import IPRule + from .network_rule_set_py3 import NetworkRuleSet + from .identity_py3 import Identity + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .endpoints_py3 import Endpoints + from .storage_account_py3 import StorageAccount + from .storage_account_key_py3 import StorageAccountKey + from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .resource_py3 import Resource + from .account_sas_parameters_py3 import AccountSasParameters + from .list_account_sas_response_py3 import ListAccountSasResponse + from .service_sas_parameters_py3 import ServiceSasParameters + from .list_service_sas_response_py3 import ListServiceSasResponse +except (SyntaxError, ImportError): + from .operation_display import OperationDisplay + from .dimension import Dimension + from .metric_specification import MetricSpecification + from .service_specification import ServiceSpecification + from .operation import Operation + from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters + from .sku_capability import SKUCapability + from .restriction import Restriction + from .sku import Sku + from .check_name_availability_result import CheckNameAvailabilityResult + from .custom_domain import CustomDomain + from .encryption_service import EncryptionService + from .encryption_services import EncryptionServices + from .key_vault_properties import KeyVaultProperties + from .encryption import Encryption + from .virtual_network_rule import VirtualNetworkRule + from .ip_rule import IPRule + from .network_rule_set import NetworkRuleSet + from .identity import Identity + from .storage_account_create_parameters import StorageAccountCreateParameters + from .endpoints import Endpoints + from .storage_account import StorageAccount + from .storage_account_key import StorageAccountKey + from .storage_account_list_keys_result import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .usage_name import UsageName + from .usage import Usage + from .resource import Resource + from .account_sas_parameters import AccountSasParameters + from .list_account_sas_response import ListAccountSasResponse + from .service_sas_parameters import ServiceSasParameters + from .list_service_sas_response import ListServiceSasResponse from .operation_paged import OperationPaged from .sku_paged import SkuPaged from .storage_account_paged import StorageAccountPaged diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters.py index 0a7e746852a9..3fff0b8de573 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters.py @@ -15,21 +15,23 @@ class AccountSasParameters(Model): """The parameters to list SAS credentials of a storage account. - :param services: The signed services accessible with the account SAS. - Possible values include: Blob (b), Queue (q), Table (t), File (f). + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f' :type services: str or ~azure.mgmt.storage.v2017_10_01.models.Services - :param resource_types: The signed resource types that are accessible with - the account SAS. Service (s): Access to service-level APIs; Container (c): - Access to container-level APIs; Object (o): Access to object-level APIs - for blobs, queue messages, table entities, and files. Possible values - include: 's', 'c', 'o' + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' :type resource_types: str or ~azure.mgmt.storage.v2017_10_01.models.SignedResourceTypes - :param permissions: The signed permissions for the account SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' :type permissions: str or ~azure.mgmt.storage.v2017_10_01.models.Permissions :param ip_address_or_range: An IP address or a range of IP addresses from @@ -41,8 +43,8 @@ class AccountSasParameters(Model): ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol :param shared_access_start_time: The time at which the SAS becomes valid. :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. :type shared_access_expiry_time: datetime :param key_to_sign: The key to sign the account SAS token with. :type key_to_sign: str @@ -66,13 +68,13 @@ class AccountSasParameters(Model): 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, } - def __init__(self, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range=None, protocols=None, shared_access_start_time=None, key_to_sign=None): - super(AccountSasParameters, self).__init__() - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters_py3.py new file mode 100644 index 000000000000..5bae2b318f48 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2017_10_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2017_10_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_10_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result.py index c39b4becabe9..f2bfb36e391c 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result.py @@ -43,8 +43,8 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(CheckNameAvailabilityResult, self).__init__() + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = None self.reason = None self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..e2a8b2937c91 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2017_10_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain.py index 12b0f7691888..585480d7321a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain.py @@ -16,8 +16,10 @@ class CustomDomain(Model): """The custom domain assigned to this storage account. This can be set via Update. - :param name: Gets or sets the custom domain name assigned to the storage - account. Name is the CNAME source. + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. :type name: str :param use_sub_domain: Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. @@ -33,7 +35,7 @@ class CustomDomain(Model): 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, } - def __init__(self, name, use_sub_domain=None): - super(CustomDomain, self).__init__() - self.name = name - self.use_sub_domain = use_sub_domain + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain = kwargs.get('use_sub_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain_py3.py new file mode 100644 index 000000000000..4c6fe3f83e35 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain = use_sub_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension.py index bf7b9383880f..0a0cdaf75da7 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension.py @@ -26,7 +26,7 @@ class Dimension(Model): 'display_name': {'key': 'displayName', 'type': 'str'}, } - def __init__(self, name=None, display_name=None): - super(Dimension, self).__init__() - self.name = name - self.display_name = display_name + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension_py3.py new file mode 100644 index 000000000000..6845aa528b4b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dimension(Model): + """Dimension of blobs, possiblly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption.py index d8b6c6977444..34ad6bac386d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption.py @@ -15,12 +15,14 @@ class Encryption(Model): """The encryption settings on the storage account. + All required parameters must be populated in order to send to Azure. + :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2017_10_01.models.EncryptionServices - :param key_source: The encryption keySource (provider). Possible values - (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible - values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. Default value: - "Microsoft.Storage" . + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . :type key_source: str or ~azure.mgmt.storage.v2017_10_01.models.KeySource :param key_vault_properties: Properties provided by key vault. :type key_vault_properties: @@ -37,8 +39,8 @@ class Encryption(Model): 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, } - def __init__(self, services=None, key_source="Microsoft.Storage", key_vault_properties=None): - super(Encryption, self).__init__() - self.services = services - self.key_source = key_source - self.key_vault_properties = key_vault_properties + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_py3.py new file mode 100644 index 000000000000..d819a127105d --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2017_10_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2017_10_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2017_10_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service.py index 0e033e9fe4a8..3a020c468f64 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service.py @@ -37,7 +37,7 @@ class EncryptionService(Model): 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, } - def __init__(self, enabled=None): - super(EncryptionService, self).__init__() - self.enabled = enabled + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service_py3.py new file mode 100644 index 000000000000..0566050c6155 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services.py index 84d82e2b7875..0b47a300149f 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services.py @@ -40,9 +40,9 @@ class EncryptionServices(Model): 'queue': {'key': 'queue', 'type': 'EncryptionService'}, } - def __init__(self, blob=None, file=None): - super(EncryptionServices, self).__init__() - self.blob = blob - self.file = file + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) self.table = None self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services_py3.py new file mode 100644 index 000000000000..f9efae41c782 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints.py index 2524757f961f..ec345fceac47 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints.py @@ -43,8 +43,8 @@ class Endpoints(Model): 'file': {'key': 'file', 'type': 'str'}, } - def __init__(self): - super(Endpoints, self).__init__() + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) self.blob = None self.queue = None self.table = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints_py3.py new file mode 100644 index 000000000000..a186e9c8d6a9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity.py index 5e7bac70c5e2..f526b986fc70 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity.py @@ -18,11 +18,13 @@ class Identity(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar principal_id: The principal ID of resource identity. :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: The identity type. Default value: "SystemAssigned" . + :ivar type: Required. The identity type. Default value: "SystemAssigned" . :vartype type: str """ @@ -40,7 +42,7 @@ class Identity(Model): type = "SystemAssigned" - def __init__(self): - super(Identity, self).__init__() + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity_py3.py new file mode 100644 index 000000000000..22d25fdd85b7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py index b5d51e370909..fba0ad0623d3 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py @@ -15,8 +15,10 @@ class IPRule(Model): """IP rule with specific IP or IP range in CIDR format. - :param ip_address_or_range: Specifies the IP or IP range in CIDR format. - Only IPV4 address is allowed. + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. :type ip_address_or_range: str :param action: The action of IP ACL rule. Possible values include: 'Allow'. Default value: "Allow" . @@ -32,7 +34,7 @@ class IPRule(Model): 'action': {'key': 'action', 'type': 'Action'}, } - def __init__(self, ip_address_or_range, action="Allow"): - super(IPRule, self).__init__() - self.ip_address_or_range = ip_address_or_range - self.action = action + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule_py3.py new file mode 100644 index 000000000000..bd3688ccc8dd --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_10_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties.py index 59657c3071b7..44eaf379f6f2 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties.py @@ -29,8 +29,8 @@ class KeyVaultProperties(Model): 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, } - def __init__(self, key_name=None, key_version=None, key_vault_uri=None): - super(KeyVaultProperties, self).__init__() - self.key_name = key_name - self.key_version = key_version - self.key_vault_uri = key_vault_uri + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties_py3.py new file mode 100644 index 000000000000..9e6350eec898 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response.py index 5d8b8c53cd6f..a56e959a34bd 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response.py @@ -30,6 +30,6 @@ class ListAccountSasResponse(Model): 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, } - def __init__(self): - super(ListAccountSasResponse, self).__init__() + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response_py3.py new file mode 100644 index 000000000000..b8b9a314d9f6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response.py index e3c12854fe67..800c0298af61 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response.py @@ -31,6 +31,6 @@ class ListServiceSasResponse(Model): 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, } - def __init__(self): - super(ListServiceSasResponse, self).__init__() + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response_py3.py new file mode 100644 index 000000000000..cffd962e2041 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of speicific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification.py index 57d491b9c886..ccc70beb4672 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification.py @@ -50,14 +50,14 @@ class MetricSpecification(Model): 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, display_description=None, unit=None, dimensions=None, aggregation_type=None, fill_gap_with_zero=None, category=None, resource_id_dimension_name_override=None): - super(MetricSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.dimensions = dimensions - self.aggregation_type = aggregation_type - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.resource_id_dimension_name_override = resource_id_dimension_name_override + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification_py3.py new file mode 100644 index 000000000000..c6bffaa6d061 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2017_10_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set.py index ca391cfe337f..0ccf88552835 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set.py @@ -15,6 +15,8 @@ class NetworkRuleSet(Model): """Network rule set. + All required parameters must be populated in order to send to Azure. + :param bypass: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None @@ -26,9 +28,9 @@ class NetworkRuleSet(Model): list[~azure.mgmt.storage.v2017_10_01.models.VirtualNetworkRule] :param ip_rules: Sets the IP ACL rules :type ip_rules: list[~azure.mgmt.storage.v2017_10_01.models.IPRule] - :param default_action: Specifies the default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . :type default_action: str or ~azure.mgmt.storage.v2017_10_01.models.DefaultAction """ @@ -44,9 +46,9 @@ class NetworkRuleSet(Model): 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, } - def __init__(self, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow"): - super(NetworkRuleSet, self).__init__() - self.bypass = bypass - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules - self.default_action = default_action + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set_py3.py new file mode 100644 index 000000000000..ac8fb83a6a69 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2017_10_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2017_10_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2017_10_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2017_10_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation.py index beda90ab4602..20ccef7197b1 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation.py @@ -34,9 +34,9 @@ class Operation(Model): 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, } - def __init__(self, name=None, display=None, origin=None, service_specification=None): - super(Operation, self).__init__() - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display.py index d31779b2891c..12d72186c4f2 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display.py @@ -29,8 +29,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display_py3.py new file mode 100644 index 000000000000..632a6393c99f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_py3.py new file mode 100644 index 000000000000..f7c827b4d135 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2017_10_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2017_10_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource.py index dda2316a332f..125d6e4790b9 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource.py @@ -45,10 +45,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource_py3.py new file mode 100644 index 000000000000..7c1ccbf3aae1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction.py index d5fd7fd912d9..8379a99eeab3 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction.py @@ -44,8 +44,8 @@ class Restriction(Model): 'reason_code': {'key': 'reasonCode', 'type': 'str'}, } - def __init__(self, reason_code=None): - super(Restriction, self).__init__() + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) self.type = None self.values = None - self.reason_code = reason_code + self.reason_code = kwargs.get('reason_code', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction_py3.py new file mode 100644 index 000000000000..6ce9d0560adc --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + “QuotaId” or “NotAvailableForSubscription”. Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The “NotAvailableForSubscription” is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2017_10_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters.py index 35e39b341a0f..aa9cdb2746da 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters.py @@ -15,11 +15,14 @@ class ServiceSasParameters(Model): """The parameters to list service SAS credentials of a speicific resource. - :param canonicalized_resource: The canonical path to the signed resource. + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' :type resource: str or ~azure.mgmt.storage.v2017_10_01.models.SignedResource :param permissions: The signed permissions for the service SAS. Possible @@ -96,23 +99,23 @@ class ServiceSasParameters(Model): 'content_type': {'key': 'rsct', 'type': 'str'}, } - def __init__(self, canonicalized_resource, resource, permissions=None, ip_address_or_range=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier=None, partition_key_start=None, partition_key_end=None, row_key_start=None, row_key_end=None, key_to_sign=None, cache_control=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None): - super(ServiceSasParameters, self).__init__() - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters_py3.py new file mode 100644 index 000000000000..faef9de59f77 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters_py3.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a speicific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2017_10_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_10_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification.py index 22a08bc44df4..19ffc2606edf 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification.py @@ -24,6 +24,6 @@ class ServiceSpecification(Model): 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, } - def __init__(self, metric_specifications=None): - super(ServiceSpecification, self).__init__() - self.metric_specifications = metric_specifications + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification_py3.py new file mode 100644 index 000000000000..e8f5e5d967ba --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2017_10_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku.py index c995710b515b..e6332d42e439 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku.py @@ -18,10 +18,12 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Gets or sets the sku name. Required for account creation; - optional for update. Note that in older versions, sku name was called - accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', - 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' :type name: str or ~azure.mgmt.storage.v2017_10_01.models.SkuName :ivar tier: Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium' @@ -65,12 +67,12 @@ class Sku(Model): 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, } - def __init__(self, name, restrictions=None): - super(Sku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None self.resource_type = None self.kind = None self.locations = None self.capabilities = None - self.restrictions = restrictions + self.restrictions = kwargs.get('restrictions', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability.py index 70ee58e9fe89..b8fa68ce7778 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability.py @@ -38,7 +38,7 @@ class SKUCapability(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(SKUCapability, self).__init__() + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) self.name = None self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability_py3.py new file mode 100644 index 000000000000..f349a08eda21 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_py3.py new file mode 100644 index 000000000000..266d2791b110 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """The SKU of the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2017_10_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2017_10_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2017_10_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2017_10_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account.py index 68d1bc29af30..59b7dc7c00d4 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account.py @@ -144,11 +144,11 @@ class StorageAccount(Resource): 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, } - def __init__(self, location=None, tags=None, identity=None, enable_https_traffic_only=False): - super(StorageAccount, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) self.sku = None self.kind = None - self.identity = identity + self.identity = kwargs.get('identity', None) self.provisioning_state = None self.primary_endpoints = None self.primary_location = None @@ -161,5 +161,5 @@ def __init__(self, location=None, tags=None, identity=None, enable_https_traffic self.secondary_endpoints = None self.encryption = None self.access_tier = None - self.enable_https_traffic_only = enable_https_traffic_only + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters.py index c67c674db438..42cf88a074a0 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters.py @@ -18,10 +18,13 @@ class StorageAccountCheckNameAvailabilityParameters(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The storage account name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The storage account name. :type name: str - :ivar type: The type of resource, Microsoft.Storage/storageAccounts. - Default value: "Microsoft.Storage/storageAccounts" . + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . :vartype type: str """ @@ -37,6 +40,6 @@ class StorageAccountCheckNameAvailabilityParameters(Model): type = "Microsoft.Storage/storageAccounts" - def __init__(self, name): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..e6f50a456902 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the storage account name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters.py index ad417e190151..37cc4242b6a8 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters.py @@ -15,16 +15,18 @@ class StorageAccountCreateParameters(Model): """The parameters used when creating a storage account. - :param sku: Required. Gets or sets the sku name. + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku - :param kind: Required. Indicates the type of storage account. Possible - values include: 'Storage', 'StorageV2', 'BlobStorage' + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind - :param location: Required. Gets or sets the location of the resource. This - will be one of the supported and registered Azure Geo Regions (e.g. West - US, East US, Southeast Asia, etc.). The geo region of a resource cannot be - changed once it is created, but if an identical geo region is specified on - update, the request will succeed. + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. :type location: str :param tags: Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource @@ -75,15 +77,15 @@ class StorageAccountCreateParameters(Model): 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, } - def __init__(self, sku, kind, location, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only=False): - super(StorageAccountCreateParameters, self).__init__() - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.network_rule_set = network_rule_set - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..4e8178225042 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_10_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_10_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key.py index 9b2430c41f0a..36c5ff08c17d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key.py @@ -40,8 +40,8 @@ class StorageAccountKey(Model): 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, } - def __init__(self): - super(StorageAccountKey, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) self.key_name = None self.value = None self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key_py3.py new file mode 100644 index 000000000000..3213397ba2c1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2017_10_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result.py index a2519099c3d5..671855ba2ecb 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result.py @@ -32,6 +32,6 @@ class StorageAccountListKeysResult(Model): 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, } - def __init__(self): - super(StorageAccountListKeysResult, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result_py3.py new file mode 100644 index 000000000000..663db15e442a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2017_10_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_py3.py new file mode 100644 index 000000000000..a616177af7a4 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_py3.py @@ -0,0 +1,165 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2017_10_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2017_10_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2017_10_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2017_10_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2017_10_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2017_10_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2017_10_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2017_10_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str=None, tags=None, identity=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters.py index 0665efaf0a1b..ca7f33b25112 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters.py @@ -15,8 +15,10 @@ class StorageAccountRegenerateKeyParameters(Model): """The parameters used to regenerate the storage account key. - :param key_name: The name of storage keys that want to be regenerated, - possible vaules are key1, key2. + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible vaules are key1, key2. :type key_name: str """ @@ -28,6 +30,6 @@ class StorageAccountRegenerateKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, key_name): - super(StorageAccountRegenerateKeyParameters, self).__init__() - self.key_name = key_name + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..42f3c0b2e94a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible vaules are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters.py index 5f5aed46f831..7e4d7d66f97c 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters.py @@ -65,14 +65,14 @@ class StorageAccountUpdateParameters(Model): 'kind': {'key': 'kind', 'type': 'Kind'}, } - def __init__(self, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only=False, network_rule_set=None, kind=None): - super(StorageAccountUpdateParameters, self).__init__() - self.sku = sku - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = network_rule_set - self.kind = kind + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..757adf362e5b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_10_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_10_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, kind=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.kind = kind diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_management_client_enums.py index 6dc1e5a5bd9b..6322455cd469 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_management_client_enums.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class ReasonCode(Enum): +class ReasonCode(str, Enum): quota_id = "QuotaId" not_available_for_subscription = "NotAvailableForSubscription" -class SkuName(Enum): +class SkuName(str, Enum): standard_lrs = "Standard_LRS" standard_grs = "Standard_GRS" @@ -27,37 +27,37 @@ class SkuName(Enum): premium_lrs = "Premium_LRS" -class SkuTier(Enum): +class SkuTier(str, Enum): standard = "Standard" premium = "Premium" -class Kind(Enum): +class Kind(str, Enum): storage = "Storage" storage_v2 = "StorageV2" blob_storage = "BlobStorage" -class Reason(Enum): +class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" already_exists = "AlreadyExists" -class KeySource(Enum): +class KeySource(str, Enum): microsoft_storage = "Microsoft.Storage" microsoft_keyvault = "Microsoft.Keyvault" -class Action(Enum): +class Action(str, Enum): allow = "Allow" -class State(Enum): +class State(str, Enum): provisioning = "provisioning" deprovisioning = "deprovisioning" @@ -66,7 +66,7 @@ class State(Enum): network_source_deleted = "networkSourceDeleted" -class Bypass(Enum): +class Bypass(str, Enum): none = "None" logging = "Logging" @@ -74,38 +74,38 @@ class Bypass(Enum): azure_services = "AzureServices" -class DefaultAction(Enum): +class DefaultAction(str, Enum): allow = "Allow" deny = "Deny" -class AccessTier(Enum): +class AccessTier(str, Enum): hot = "Hot" cool = "Cool" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" resolving_dns = "ResolvingDNS" succeeded = "Succeeded" -class AccountStatus(Enum): +class AccountStatus(str, Enum): available = "available" unavailable = "unavailable" -class KeyPermission(Enum): +class KeyPermission(str, Enum): read = "Read" full = "Full" -class UsageUnit(Enum): +class UsageUnit(str, Enum): count = "Count" bytes = "Bytes" @@ -115,7 +115,7 @@ class UsageUnit(Enum): bytes_per_second = "BytesPerSecond" -class Services(Enum): +class Services(str, Enum): b = "b" q = "q" @@ -123,14 +123,14 @@ class Services(Enum): f = "f" -class SignedResourceTypes(Enum): +class SignedResourceTypes(str, Enum): s = "s" c = "c" o = "o" -class Permissions(Enum): +class Permissions(str, Enum): r = "r" d = "d" @@ -142,13 +142,13 @@ class Permissions(Enum): p = "p" -class HttpProtocol(Enum): +class HttpProtocol(str, Enum): httpshttp = "https,http" https = "https" -class SignedResource(Enum): +class SignedResource(str, Enum): b = "b" c = "c" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage.py index 97d387ac89cc..103482b94b0f 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage.py @@ -46,8 +46,8 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.unit = None self.current_value = None self.limit = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name.py index c09f75b38c9a..e4082bf52384 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name.py @@ -35,7 +35,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self): - super(UsageName, self).__init__() + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name_py3.py new file mode 100644 index 000000000000..f519bb5072b1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_py3.py new file mode 100644 index 000000000000..8f40f289293a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2017_10_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2017_10_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule.py index c7cfb0bc87d5..23706c107a6f 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule.py @@ -15,7 +15,10 @@ class VirtualNetworkRule(Model): """Virtual Network rule. - :param virtual_network_resource_id: Resource ID of a subnet, for example: + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str :param action: The action of virtual network rule. Possible values @@ -37,8 +40,8 @@ class VirtualNetworkRule(Model): 'state': {'key': 'state', 'type': 'State'}, } - def __init__(self, virtual_network_resource_id, action="Allow", state=None): - super(VirtualNetworkRule, self).__init__() - self.virtual_network_resource_id = virtual_network_resource_id - self.action = action - self.state = state + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..064d3c3e6730 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_10_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2017_10_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/operations.py index 8a53c74f6d0b..61cb0b666c71 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Storage/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -96,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/skus_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/skus_operations.py index 31030135fe25..e207d3d64657 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/skus_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/skus_operations.py @@ -22,7 +22,7 @@ class SkusOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/storage_accounts_operations.py index bf36fb047d94..8f51e895b19b 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/storage_accounts_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/storage_accounts_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class StorageAccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ @@ -60,7 +60,7 @@ def check_name_availability( account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -103,12 +103,13 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} def _create_initial( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -155,7 +156,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties @@ -174,13 +175,16 @@ def create( :type parameters: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - StorageAccount or ClientRawResponse if raw=true + :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 StorageAccount or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2017_10_01.models.StorageAccount] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -191,30 +195,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('StorageAccount', response) if raw: @@ -223,12 +205,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def delete( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -251,7 +235,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -285,6 +269,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def get_properties( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -310,7 +295,7 @@ def get_properties( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.get_properties.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -351,6 +336,7 @@ def get_properties( return client_raw_response return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def update( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -386,7 +372,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -431,6 +417,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -452,7 +439,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -497,6 +484,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -521,7 +509,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -567,6 +555,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -591,7 +580,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -632,6 +621,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} def regenerate_key( self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): @@ -661,7 +651,7 @@ def regenerate_key( regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -706,6 +696,7 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} def list_account_sas( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -733,7 +724,7 @@ def list_account_sas( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas' + url = self.list_account_sas.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -778,6 +769,7 @@ def list_account_sas( return client_raw_response return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} def list_service_sas( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -805,7 +797,7 @@ def list_service_sas( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas' + url = self.list_service_sas.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -850,3 +842,4 @@ def list_service_sas( return client_raw_response return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py index 208259eb29ec..1af3b6f8d6ed 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/storage_management_client.py index 4e930c826f31..cc2712bd90b7 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/storage_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -54,7 +54,7 @@ def __init__( self.subscription_id = subscription_id -class StorageManagementClient(object): +class StorageManagementClient(SDKClient): """The Azure Storage Management API. :ivar config: Configuration for client. @@ -83,7 +83,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2017-10-01' diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/__init__.py new file mode 100644 index 000000000000..0854715e0c10 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .storage_management_client import StorageManagementClient +from .version import VERSION + +__all__ = ['StorageManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py new file mode 100644 index 000000000000..010d2c212913 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py @@ -0,0 +1,213 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .operation_display_py3 import OperationDisplay + from .dimension_py3 import Dimension + from .metric_specification_py3 import MetricSpecification + from .service_specification_py3 import ServiceSpecification + from .operation_py3 import Operation + from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters + from .sku_capability_py3 import SKUCapability + from .restriction_py3 import Restriction + from .sku_py3 import Sku + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .custom_domain_py3 import CustomDomain + from .encryption_service_py3 import EncryptionService + from .encryption_services_py3 import EncryptionServices + from .key_vault_properties_py3 import KeyVaultProperties + from .encryption_py3 import Encryption + from .virtual_network_rule_py3 import VirtualNetworkRule + from .ip_rule_py3 import IPRule + from .network_rule_set_py3 import NetworkRuleSet + from .identity_py3 import Identity + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .endpoints_py3 import Endpoints + from .storage_account_py3 import StorageAccount + from .storage_account_key_py3 import StorageAccountKey + from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .account_sas_parameters_py3 import AccountSasParameters + from .list_account_sas_response_py3 import ListAccountSasResponse + from .service_sas_parameters_py3 import ServiceSasParameters + from .list_service_sas_response_py3 import ListServiceSasResponse + from .proxy_resource_py3 import ProxyResource + from .azure_entity_resource_py3 import AzureEntityResource + from .resource_py3 import Resource + from .tracked_resource_py3 import TrackedResource + from .update_history_property_py3 import UpdateHistoryProperty + from .immutability_policy_properties_py3 import ImmutabilityPolicyProperties + from .tag_property_py3 import TagProperty + from .legal_hold_properties_py3 import LegalHoldProperties + from .blob_container_py3 import BlobContainer + from .immutability_policy_py3 import ImmutabilityPolicy + from .legal_hold_py3 import LegalHold + from .list_container_item_py3 import ListContainerItem + from .list_container_items_py3 import ListContainerItems +except (SyntaxError, ImportError): + from .operation_display import OperationDisplay + from .dimension import Dimension + from .metric_specification import MetricSpecification + from .service_specification import ServiceSpecification + from .operation import Operation + from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters + from .sku_capability import SKUCapability + from .restriction import Restriction + from .sku import Sku + from .check_name_availability_result import CheckNameAvailabilityResult + from .custom_domain import CustomDomain + from .encryption_service import EncryptionService + from .encryption_services import EncryptionServices + from .key_vault_properties import KeyVaultProperties + from .encryption import Encryption + from .virtual_network_rule import VirtualNetworkRule + from .ip_rule import IPRule + from .network_rule_set import NetworkRuleSet + from .identity import Identity + from .storage_account_create_parameters import StorageAccountCreateParameters + from .endpoints import Endpoints + from .storage_account import StorageAccount + from .storage_account_key import StorageAccountKey + from .storage_account_list_keys_result import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .usage_name import UsageName + from .usage import Usage + from .account_sas_parameters import AccountSasParameters + from .list_account_sas_response import ListAccountSasResponse + from .service_sas_parameters import ServiceSasParameters + from .list_service_sas_response import ListServiceSasResponse + from .proxy_resource import ProxyResource + from .azure_entity_resource import AzureEntityResource + from .resource import Resource + from .tracked_resource import TrackedResource + from .update_history_property import UpdateHistoryProperty + from .immutability_policy_properties import ImmutabilityPolicyProperties + from .tag_property import TagProperty + from .legal_hold_properties import LegalHoldProperties + from .blob_container import BlobContainer + from .immutability_policy import ImmutabilityPolicy + from .legal_hold import LegalHold + from .list_container_item import ListContainerItem + from .list_container_items import ListContainerItems +from .operation_paged import OperationPaged +from .sku_paged import SkuPaged +from .storage_account_paged import StorageAccountPaged +from .usage_paged import UsagePaged +from .storage_management_client_enums import ( + ReasonCode, + SkuName, + SkuTier, + Kind, + Reason, + KeySource, + Action, + State, + Bypass, + DefaultAction, + AccessTier, + ProvisioningState, + AccountStatus, + KeyPermission, + UsageUnit, + Services, + SignedResourceTypes, + Permissions, + HttpProtocol, + SignedResource, + PublicAccess, + LeaseStatus, + LeaseState, + LeaseDuration, + ImmutabilityPolicyState, + ImmutabilityPolicyUpdateType, +) + +__all__ = [ + 'OperationDisplay', + 'Dimension', + 'MetricSpecification', + 'ServiceSpecification', + 'Operation', + 'StorageAccountCheckNameAvailabilityParameters', + 'SKUCapability', + 'Restriction', + 'Sku', + 'CheckNameAvailabilityResult', + 'CustomDomain', + 'EncryptionService', + 'EncryptionServices', + 'KeyVaultProperties', + 'Encryption', + 'VirtualNetworkRule', + 'IPRule', + 'NetworkRuleSet', + 'Identity', + 'StorageAccountCreateParameters', + 'Endpoints', + 'StorageAccount', + 'StorageAccountKey', + 'StorageAccountListKeysResult', + 'StorageAccountRegenerateKeyParameters', + 'StorageAccountUpdateParameters', + 'UsageName', + 'Usage', + 'AccountSasParameters', + 'ListAccountSasResponse', + 'ServiceSasParameters', + 'ListServiceSasResponse', + 'ProxyResource', + 'AzureEntityResource', + 'Resource', + 'TrackedResource', + 'UpdateHistoryProperty', + 'ImmutabilityPolicyProperties', + 'TagProperty', + 'LegalHoldProperties', + 'BlobContainer', + 'ImmutabilityPolicy', + 'LegalHold', + 'ListContainerItem', + 'ListContainerItems', + 'OperationPaged', + 'SkuPaged', + 'StorageAccountPaged', + 'UsagePaged', + 'ReasonCode', + 'SkuName', + 'SkuTier', + 'Kind', + 'Reason', + 'KeySource', + 'Action', + 'State', + 'Bypass', + 'DefaultAction', + 'AccessTier', + 'ProvisioningState', + 'AccountStatus', + 'KeyPermission', + 'UsageUnit', + 'Services', + 'SignedResourceTypes', + 'Permissions', + 'HttpProtocol', + 'SignedResource', + 'PublicAccess', + 'LeaseStatus', + 'LeaseState', + 'LeaseDuration', + 'ImmutabilityPolicyState', + 'ImmutabilityPolicyUpdateType', +] diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters.py new file mode 100644 index 000000000000..7acf3ff04e92 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2018_02_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2018_02_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters_py3.py new file mode 100644 index 000000000000..3d0bb4cd3adc --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2018_02_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2018_02_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource.py new file mode 100644 index 000000000000..3bffaab8d35b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource_py3.py new file mode 100644 index 000000000000..c93d1b04bfd7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container.py new file mode 100644 index 000000000000..96909e68f452 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container.py @@ -0,0 +1,119 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .azure_entity_resource import AzureEntityResource + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BlobContainer, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container_py3.py new file mode 100644 index 000000000000..26f32e8e4737 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container_py3.py @@ -0,0 +1,119 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .azure_entity_resource import AzureEntityResource + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(BlobContainer, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result.py new file mode 100644 index 000000000000..d4fdcfdf8589 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2018_02_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..41a2fada1f87 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2018_02_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain.py new file mode 100644 index 000000000000..585480d7321a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain = kwargs.get('use_sub_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain_py3.py new file mode 100644 index 000000000000..4c6fe3f83e35 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain = use_sub_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension.py new file mode 100644 index 000000000000..0a0cdaf75da7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dimension(Model): + """Dimension of blobs, possiblly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension_py3.py new file mode 100644 index 000000000000..6845aa528b4b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dimension(Model): + """Dimension of blobs, possiblly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption.py new file mode 100644 index 000000000000..c9fcc801ead9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2018_02_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2018_02_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_02_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_py3.py new file mode 100644 index 000000000000..d4f941b70bff --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2018_02_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2018_02_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_02_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service.py new file mode 100644 index 000000000000..3a020c468f64 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service_py3.py new file mode 100644 index 000000000000..0566050c6155 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services.py new file mode 100644 index 000000000000..e47d51e5e2ef --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = None + self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services_py3.py new file mode 100644 index 000000000000..02f2f95c73ee --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints.py new file mode 100644 index 000000000000..ec345fceac47 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints_py3.py new file mode 100644 index 000000000000..a186e9c8d6a9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity.py new file mode 100644 index 000000000000..f526b986fc70 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity_py3.py new file mode 100644 index 000000000000..22d25fdd85b7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy.py new file mode 100644 index 000000000000..2b8eb01dea0f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .azure_entity_resource import AzureEntityResource + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties.py new file mode 100644 index 000000000000..60d6e13f0c05 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2018_02_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.etag = None + self.update_history = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties_py3.py new file mode 100644 index 000000000000..3f0434d3c7c7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2018_02_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.etag = None + self.update_history = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_py3.py new file mode 100644 index 000000000000..1c0300a983d7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .azure_entity_resource import AzureEntityResource + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule.py new file mode 100644 index 000000000000..cd2416118e59 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule_py3.py new file mode 100644 index 000000000000..34516b5233c0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties.py new file mode 100644 index 000000000000..44eaf379f6f2 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties_py3.py new file mode 100644 index 000000000000..9e6350eec898 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold.py new file mode 100644 index 000000000000..4eb93df1d9fe --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties.py new file mode 100644 index 000000000000..1c018f0b0940 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2018_02_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, **kwargs): + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties_py3.py new file mode 100644 index 000000000000..5dd782fdd092 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2018_02_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_py3.py new file mode 100644 index 000000000000..a4bc196cb604 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, *, tags, **kwargs) -> None: + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response.py new file mode 100644 index 000000000000..a56e959a34bd --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response_py3.py new file mode 100644 index 000000000000..b8b9a314d9f6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item.py new file mode 100644 index 000000000000..f6a50512740f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item.py @@ -0,0 +1,118 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .azure_entity_resource import AzureEntityResource + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item_py3.py new file mode 100644 index 000000000000..a178276fbaa5 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item_py3.py @@ -0,0 +1,118 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .azure_entity_resource import AzureEntityResource + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items.py new file mode 100644 index 000000000000..84fd5aa03307 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListContainerItems(Model): + """The list of blob containers. + + :param value: The list of blob containers. + :type value: + list[~azure.mgmt.storage.v2018_02_01.models.ListContainerItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + } + + def __init__(self, **kwargs): + super(ListContainerItems, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items_py3.py new file mode 100644 index 000000000000..a9ad58faf3d8 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListContainerItems(Model): + """The list of blob containers. + + :param value: The list of blob containers. + :type value: + list[~azure.mgmt.storage.v2018_02_01.models.ListContainerItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ListContainerItems, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response.py new file mode 100644 index 000000000000..800c0298af61 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of speicific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response_py3.py new file mode 100644 index 000000000000..cffd962e2041 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of speicific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification.py new file mode 100644 index 000000000000..79d318a41660 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2018_02_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification_py3.py new file mode 100644 index 000000000000..b0d40efc543a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2018_02_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set.py new file mode 100644 index 000000000000..c9a546c136e2 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2018_02_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_02_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2018_02_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2018_02_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set_py3.py new file mode 100644 index 000000000000..58b08a0e1419 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2018_02_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_02_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2018_02_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2018_02_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation.py new file mode 100644 index 000000000000..37982657dc4d --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2018_02_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2018_02_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display.py new file mode 100644 index 000000000000..12d72186c4f2 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display_py3.py new file mode 100644 index 000000000000..632a6393c99f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_paged.py new file mode 100644 index 000000000000..826e80757e1f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_py3.py new file mode 100644 index 000000000000..8e12d0d37abc --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2018_02_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2018_02_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource.py new file mode 100644 index 000000000000..0de8fb6bd420 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource_py3.py new file mode 100644 index 000000000000..c557c8c8125d --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource.py new file mode 100644 index 000000000000..9333a2ac49ef --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource_py3.py new file mode 100644 index 000000000000..370e6c506581 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction.py new file mode 100644 index 000000000000..9201ec225a1e --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + “QuotaId” or “NotAvailableForSubscription”. Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The “NotAvailableForSubscription” is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2018_02_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction_py3.py new file mode 100644 index 000000000000..e081f446828e --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + “QuotaId” or “NotAvailableForSubscription”. Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The “NotAvailableForSubscription” is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2018_02_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters.py new file mode 100644 index 000000000000..e53925809343 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a speicific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2018_02_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters_py3.py new file mode 100644 index 000000000000..aa7283ec6230 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters_py3.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a speicific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2018_02_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification.py new file mode 100644 index 000000000000..a2cdf93ecdeb --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2018_02_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification_py3.py new file mode 100644 index 000000000000..aadc0db02787 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2018_02_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku.py new file mode 100644 index 000000000000..51535cde8139 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """The SKU of the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2018_02_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2018_02_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2018_02_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2018_02_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability.py new file mode 100644 index 000000000000..b8fa68ce7778 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability_py3.py new file mode 100644 index 000000000000..f349a08eda21 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_paged.py new file mode 100644 index 000000000000..17028976705a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`Sku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Sku]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_py3.py new file mode 100644 index 000000000000..de133a47a6ff --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """The SKU of the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2018_02_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2018_02_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2018_02_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2018_02_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account.py new file mode 100644 index 000000000000..5314518db468 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account.py @@ -0,0 +1,169 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource + + +class StorageAccount(TrackedResource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2018_02_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2018_02_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2018_02_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2018_02_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2018_02_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters.py new file mode 100644 index 000000000000..42cf88a074a0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the storage account name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..e6f50a456902 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the storage account name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters.py new file mode 100644 index 000000000000..5070e2af3b61 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..0fe748ef6ee3 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key.py new file mode 100644 index 000000000000..991103a56300 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key_py3.py new file mode 100644 index 000000000000..3dfbadc6938c --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result.py new file mode 100644 index 000000000000..7c9a1133e1f0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2018_02_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result_py3.py new file mode 100644 index 000000000000..725a2e529a81 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2018_02_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_paged.py new file mode 100644 index 000000000000..7097a3ea95e1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_py3.py new file mode 100644 index 000000000000..acdbd0c26614 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_py3.py @@ -0,0 +1,169 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource + + +class StorageAccount(TrackedResource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2018_02_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2018_02_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2018_02_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2018_02_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2018_02_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters.py new file mode 100644 index 000000000000..ca7f33b25112 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible vaules are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..42f3c0b2e94a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible vaules are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters.py new file mode 100644 index 000000000000..1bbf8c2f58a1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..b361d85fc5f9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, kind=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.kind = kind diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_management_client_enums.py new file mode 100644 index 000000000000..a5a7f3c7171e --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_management_client_enums.py @@ -0,0 +1,197 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ReasonCode(str, Enum): + + quota_id = "QuotaId" + not_available_for_subscription = "NotAvailableForSubscription" + + +class SkuName(str, Enum): + + standard_lrs = "Standard_LRS" + standard_grs = "Standard_GRS" + standard_ragrs = "Standard_RAGRS" + standard_zrs = "Standard_ZRS" + premium_lrs = "Premium_LRS" + + +class SkuTier(str, Enum): + + standard = "Standard" + premium = "Premium" + + +class Kind(str, Enum): + + storage = "Storage" + storage_v2 = "StorageV2" + blob_storage = "BlobStorage" + + +class Reason(str, Enum): + + account_name_invalid = "AccountNameInvalid" + already_exists = "AlreadyExists" + + +class KeySource(str, Enum): + + microsoft_storage = "Microsoft.Storage" + microsoft_keyvault = "Microsoft.Keyvault" + + +class Action(str, Enum): + + allow = "Allow" + + +class State(str, Enum): + + provisioning = "provisioning" + deprovisioning = "deprovisioning" + succeeded = "succeeded" + failed = "failed" + network_source_deleted = "networkSourceDeleted" + + +class Bypass(str, Enum): + + none = "None" + logging = "Logging" + metrics = "Metrics" + azure_services = "AzureServices" + + +class DefaultAction(str, Enum): + + allow = "Allow" + deny = "Deny" + + +class AccessTier(str, Enum): + + hot = "Hot" + cool = "Cool" + + +class ProvisioningState(str, Enum): + + creating = "Creating" + resolving_dns = "ResolvingDNS" + succeeded = "Succeeded" + + +class AccountStatus(str, Enum): + + available = "available" + unavailable = "unavailable" + + +class KeyPermission(str, Enum): + + read = "Read" + full = "Full" + + +class UsageUnit(str, Enum): + + count = "Count" + bytes = "Bytes" + seconds = "Seconds" + percent = "Percent" + counts_per_second = "CountsPerSecond" + bytes_per_second = "BytesPerSecond" + + +class Services(str, Enum): + + b = "b" + q = "q" + t = "t" + f = "f" + + +class SignedResourceTypes(str, Enum): + + s = "s" + c = "c" + o = "o" + + +class Permissions(str, Enum): + + r = "r" + d = "d" + w = "w" + l = "l" + a = "a" + c = "c" + u = "u" + p = "p" + + +class HttpProtocol(str, Enum): + + httpshttp = "https,http" + https = "https" + + +class SignedResource(str, Enum): + + b = "b" + c = "c" + f = "f" + s = "s" + + +class PublicAccess(str, Enum): + + container = "Container" + blob = "Blob" + none = "None" + + +class LeaseStatus(str, Enum): + + locked = "Locked" + unlocked = "Unlocked" + + +class LeaseState(str, Enum): + + available = "Available" + leased = "Leased" + expired = "Expired" + breaking = "Breaking" + broken = "Broken" + + +class LeaseDuration(str, Enum): + + infinite = "Infinite" + fixed = "Fixed" + + +class ImmutabilityPolicyState(str, Enum): + + locked = "Locked" + unlocked = "Unlocked" + + +class ImmutabilityPolicyUpdateType(str, Enum): + + put = "put" + lock = "lock" + extend = "extend" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property.py new file mode 100644 index 000000000000..3b879061fd2b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property_py3.py new file mode 100644 index 000000000000..22aaf6cb82ba --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource.py new file mode 100644 index 000000000000..27ab94c7a8dd --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource_py3.py new file mode 100644 index 000000000000..0e389546a588 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property.py new file mode 100644 index 000000000000..e45713204822 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property_py3.py new file mode 100644 index 000000000000..b5b4964e9fde --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage.py new file mode 100644 index 000000000000..2668cb716b16 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2018_02_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2018_02_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name.py new file mode 100644 index 000000000000..e4082bf52384 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name_py3.py new file mode 100644 index 000000000000..f519bb5072b1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_paged.py new file mode 100644 index 000000000000..b681564312e9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_py3.py new file mode 100644 index 000000000000..eb7bbdc2f151 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2018_02_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2018_02_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule.py new file mode 100644 index 000000000000..f8c08b6000e0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2018_02_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..43673a374a5b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2018_02_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/__init__.py new file mode 100644 index 000000000000..b9b73b2babc4 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/__init__.py @@ -0,0 +1,24 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .operations import Operations +from .skus_operations import SkusOperations +from .storage_accounts_operations import StorageAccountsOperations +from .usage_operations import UsageOperations +from .blob_containers_operations import BlobContainersOperations + +__all__ = [ + 'Operations', + 'SkusOperations', + 'StorageAccountsOperations', + 'UsageOperations', + 'BlobContainersOperations', +] diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/blob_containers_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/blob_containers_operations.py new file mode 100644 index 000000000000..dcf30438e5be --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/blob_containers_operations.py @@ -0,0 +1,1045 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class BlobContainersOperations(object): + """BlobContainersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + self.immutability_policy_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists all containers and does not support a prefix like data plane. + Also SRP today does not return continuation token. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :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: ListContainerItems or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListContainerItems or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ListContainerItems', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} + + def create( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Creates a new container under the specified account as described by + request body. The container resource includes metadata and properties + for that container. It does not include a list of the blobs contained + by the container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :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: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def update( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Updates container properties as specified in request body. Properties + not mentioned in the request will be unchanged. Update fails if the + specified container doesn't already exist. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :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: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def get( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Gets properties of a specified container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :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: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def delete( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Deletes specified container under its account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def set_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Sets legal hold tags. Setting the same tag results in an idempotent + operation. SetLegalHold follows an append pattern and does not clear + out the existing tags that are not specified in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[str] + :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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.set_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} + + def clear_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Clears legal hold tags. Clearing the same or non-existent tag results + in an idempotent operation. ClearLegalHold clears out only the + specified tags in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[str] + :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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.clear_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} + + def create_or_update_immutability_policy( + self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an unlocked immutability policy. ETag in If-Match is + honored if given but not required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.create_or_update_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def get_immutability_policy( + self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): + """Gets the existing immutability policy along with the corresponding ETag + in response headers and body. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def delete_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Aborts an unlocked immutability policy. The response of delete has + immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is + required for this operation. Deleting a locked immutability policy is + not allowed, only way is to delete the container after deleting all + blobs inside the container. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def lock_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Sets the ImmutabilityPolicy to Locked state. The only action allowed on + a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is + required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lock_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} + + def extend_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): + """Extends the immutabilityPeriodSinceCreationInDays of a locked + immutabilityPolicy. The only action allowed on a Locked policy will be + this action. ETag in If-Match is required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.extend_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/operations.py new file mode 100644 index 000000000000..c7049ade6b06 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/operations.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Storage Rest API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.OperationPaged[~azure.mgmt.storage.v2018_02_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/skus_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/skus_operations.py new file mode 100644 index 000000000000..16d00abe29d7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/skus_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SkusOperations(object): + """SkusOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the available SKUs supported by Microsoft.Storage for given + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Sku + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.SkuPaged[~azure.mgmt.storage.v2018_02_01.models.Sku] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SkuPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/storage_accounts_operations.py new file mode 100644 index 000000000000..75e62a807756 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/storage_accounts_operations.py @@ -0,0 +1,845 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: The storage account name. + :type name: str + :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountCreateParameters + :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 StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2018_02_01.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2018_02_01.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', 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) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountUpdateParameters + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of StorageAccount + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_02_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of StorageAccount + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_02_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: The name of storage keys that want to be regenerated, + possible vaules are key1, key2. + :type key_name: str + :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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(regenerate_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} + + def list_account_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials + for the storage account. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.AccountSasParameters + :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: ListAccountSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListAccountSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_account_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AccountSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('ListAccountSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} + + def list_service_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS + credentials. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.ServiceSasParameters + :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: ListServiceSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListServiceSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_service_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ServiceSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('ListServiceSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/usage_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/usage_operations.py new file mode 100644 index 000000000000..edbb101b587f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/usage_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class UsageOperations(object): + """UsageOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources under the + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Usage + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.UsagePaged[~azure.mgmt.storage.v2018_02_01.models.Usage] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/storage_management_client.py new file mode 100644 index 000000000000..a70542395629 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/storage_management_client.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.operations import Operations +from .operations.skus_operations import SkusOperations +from .operations.storage_accounts_operations import StorageAccountsOperations +from .operations.usage_operations import UsageOperations +from .operations.blob_containers_operations import BlobContainersOperations +from . import models + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(StorageManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class StorageManagementClient(SDKClient): + """The Azure Storage Management API. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2018_02_01.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2018_02_01.operations.SkusOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2018_02_01.operations.StorageAccountsOperations + :ivar usage: Usage operations + :vartype usage: azure.mgmt.storage.v2018_02_01.operations.UsageOperations + :ivar blob_containers: BlobContainers operations + :vartype blob_containers: azure.mgmt.storage.v2018_02_01.operations.BlobContainersOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-02-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/version.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/version.py new file mode 100644 index 000000000000..848a6c9f9e92 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2018-02-01" +