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 40b0c51a3aca..26e779d5f139 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py @@ -115,6 +115,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2017-10-01: :mod:`v2017_10_01.models` * 2018-02-01: :mod:`v2018_02_01.models` * 2018-03-01-preview: :mod:`v2018_03_01_preview.models` + * 2018-07-01: :mod:`v2018_07_01.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -137,20 +138,39 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2018-03-01-preview': from .v2018_03_01_preview import models return models + elif api_version == '2018-07-01': + from .v2018_07_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` * 2018-03-01-preview: :class:`BlobContainersOperations` + * 2018-07-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 elif api_version == '2018-03-01-preview': from .v2018_03_01_preview.operations import BlobContainersOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_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 management_policies(self): + """Instance depends on the API version: + + * 2018-07-01: :class:`ManagementPoliciesOperations` + """ + api_version = self._get_api_version('management_policies') + if api_version == '2018-07-01': + from .v2018_07_01.operations import ManagementPoliciesOperations 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))) @@ -163,6 +183,7 @@ def operations(self): * 2017-10-01: :class:`Operations` * 2018-02-01: :class:`Operations` * 2018-03-01-preview: :class:`Operations` + * 2018-07-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-06-01': @@ -173,6 +194,8 @@ def operations(self): from .v2018_02_01.operations import Operations as OperationClass elif api_version == '2018-03-01-preview': from .v2018_03_01_preview.operations import Operations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_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))) @@ -185,6 +208,7 @@ def skus(self): * 2017-10-01: :class:`SkusOperations` * 2018-02-01: :class:`SkusOperations` * 2018-03-01-preview: :class:`SkusOperations` + * 2018-07-01: :class:`SkusOperations` """ api_version = self._get_api_version('skus') if api_version == '2017-06-01': @@ -195,6 +219,8 @@ def skus(self): from .v2018_02_01.operations import SkusOperations as OperationClass elif api_version == '2018-03-01-preview': from .v2018_03_01_preview.operations import SkusOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_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))) @@ -210,6 +236,7 @@ def storage_accounts(self): * 2017-10-01: :class:`StorageAccountsOperations` * 2018-02-01: :class:`StorageAccountsOperations` * 2018-03-01-preview: :class:`StorageAccountsOperations` + * 2018-07-01: :class:`StorageAccountsOperations` """ api_version = self._get_api_version('storage_accounts') if api_version == '2015-06-15': @@ -226,6 +253,8 @@ def storage_accounts(self): from .v2018_02_01.operations import StorageAccountsOperations as OperationClass elif api_version == '2018-03-01-preview': from .v2018_03_01_preview.operations import StorageAccountsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_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))) @@ -263,10 +292,13 @@ def usages(self): """Instance depends on the API version: * 2018-03-01-preview: :class:`UsagesOperations` + * 2018-07-01: :class:`UsagesOperations` """ api_version = self._get_api_version('usages') if api_version == '2018-03-01-preview': from .v2018_03_01_preview.operations import UsagesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import UsagesOperations 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/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/storage_accounts_operations.py index b74fb3f18808..c44cd75ef9c8 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 @@ -74,6 +74,7 @@ def check_name_availability( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -86,9 +87,8 @@ def check_name_availability( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -125,6 +125,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -137,9 +138,8 @@ def _create_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -251,7 +251,6 @@ def delete( # 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: @@ -260,8 +259,8 @@ def delete( 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) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -311,7 +310,7 @@ def get_properties( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -320,8 +319,8 @@ def get_properties( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -388,6 +387,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -400,9 +400,8 @@ def update( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -457,7 +456,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -466,9 +465,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -528,7 +526,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -537,9 +535,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -595,7 +592,7 @@ def list_keys( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -604,8 +601,8 @@ def list_keys( 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) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -664,6 +661,7 @@ def regenerate_key( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -676,9 +674,8 @@ def regenerate_key( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 06a094462479..12c0cbc8f433 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 @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 19bdbef3c91d..941708372035 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 @@ -72,6 +72,7 @@ def check_name_availability( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -84,9 +85,8 @@ def check_name_availability( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -123,6 +123,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -135,9 +136,8 @@ def _create_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -249,7 +249,6 @@ def delete( # 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: @@ -258,8 +257,8 @@ def delete( 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) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -309,7 +308,7 @@ def get_properties( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -318,8 +317,8 @@ def get_properties( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -386,6 +385,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -398,9 +398,8 @@ def update( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -455,7 +454,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -464,9 +463,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -526,7 +524,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -535,9 +533,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -594,7 +591,7 @@ def list_keys( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -603,8 +600,8 @@ def list_keys( 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) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -664,6 +661,7 @@ def regenerate_key( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -676,9 +674,8 @@ def regenerate_key( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 d8caf7c34ffb..6a8c6b2ad368 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 @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 eb337be00bc8..18b97db3d41d 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 @@ -72,6 +72,7 @@ def check_name_availability( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -84,9 +85,8 @@ def check_name_availability( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -123,6 +123,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -135,9 +136,8 @@ def _create_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -249,7 +249,6 @@ def delete( # 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: @@ -258,8 +257,8 @@ def delete( 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) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -309,7 +308,7 @@ def get_properties( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -318,8 +317,8 @@ def get_properties( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -386,6 +385,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -398,9 +398,8 @@ def update( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -455,7 +454,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -464,9 +463,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -526,7 +524,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -535,9 +533,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -594,7 +591,7 @@ def list_keys( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -603,8 +600,8 @@ def list_keys( 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) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -664,6 +661,7 @@ def regenerate_key( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -676,9 +674,8 @@ def regenerate_key( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -737,6 +734,7 @@ def list_account_sas( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -749,9 +747,8 @@ def list_account_sas( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -810,6 +807,7 @@ def list_service_sas( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -822,9 +820,8 @@ def list_service_sas( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 5ea32cd89d82..0fe016a11e92 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 @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 acf3fd6834e4..844fbfc04cab 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 @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 ace3b7af30fe..f83eb52da8bf 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 @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 06f4b0681273..297085f294f0 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 @@ -72,6 +72,7 @@ def check_name_availability( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -84,9 +85,8 @@ def check_name_availability( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -123,6 +123,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -135,9 +136,8 @@ def _create_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -249,7 +249,6 @@ def delete( # 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: @@ -258,8 +257,8 @@ def delete( 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) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -309,7 +308,7 @@ def get_properties( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -318,8 +317,8 @@ def get_properties( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -386,6 +385,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -398,9 +398,8 @@ def update( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -455,7 +454,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -464,9 +463,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -526,7 +524,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -535,9 +533,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -594,7 +591,7 @@ def list_keys( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -603,8 +600,8 @@ def list_keys( 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) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -665,6 +662,7 @@ def regenerate_key( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -677,9 +675,8 @@ def regenerate_key( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -738,6 +735,7 @@ def list_account_sas( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -750,9 +748,8 @@ def list_account_sas( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -811,6 +808,7 @@ def list_service_sas( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -823,9 +821,8 @@ def list_service_sas( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 b67b64336173..7c27e3421f4c 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 @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 61cb0b666c71..fe098e3575ce 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 @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 e207d3d64657..b24932805644 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 @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 8f51e895b19b..80040dc1f84d 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 @@ -72,6 +72,7 @@ def check_name_availability( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -84,9 +85,8 @@ def check_name_availability( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -123,6 +123,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -135,9 +136,8 @@ def _create_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -249,7 +249,6 @@ def delete( # 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: @@ -258,8 +257,8 @@ def delete( 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) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -309,7 +308,7 @@ def get_properties( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -318,8 +317,8 @@ def get_properties( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -386,6 +385,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -398,9 +398,8 @@ def update( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -455,7 +454,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -464,9 +463,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -526,7 +524,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -535,9 +533,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -594,7 +591,7 @@ def list_keys( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -603,8 +600,8 @@ def list_keys( 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) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -665,6 +662,7 @@ def regenerate_key( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -677,9 +675,8 @@ def regenerate_key( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -738,6 +735,7 @@ def list_account_sas( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -750,9 +748,8 @@ def list_account_sas( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -811,6 +808,7 @@ def list_service_sas( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -823,9 +821,8 @@ def list_service_sas( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 1af3b6f8d6ed..f743de91631d 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 @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 index dcf30438e5be..5d79aa599054 100644 --- 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 @@ -76,7 +76,7 @@ def list( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -85,8 +85,8 @@ def list( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -161,6 +161,7 @@ def create( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -173,9 +174,8 @@ def create( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -249,6 +249,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -261,9 +262,8 @@ def update( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -325,7 +325,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -334,8 +334,8 @@ def get( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -396,7 +396,6 @@ def delete( # 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: @@ -405,8 +404,8 @@ def delete( 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) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -468,6 +467,7 @@ def set_legal_hold( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -480,9 +480,8 @@ def set_legal_hold( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -551,6 +550,7 @@ def clear_legal_hold( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -563,9 +563,8 @@ def clear_legal_hold( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -642,6 +641,7 @@ def create_or_update_immutability_policy( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -659,9 +659,8 @@ def create_or_update_immutability_policy( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -735,7 +734,7 @@ def get_immutability_policy( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -746,8 +745,8 @@ def get_immutability_policy( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -824,7 +823,7 @@ def delete_immutability_policy( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -834,8 +833,8 @@ def delete_immutability_policy( 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) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -909,7 +908,7 @@ def lock_immutability_policy( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -919,8 +918,8 @@ def lock_immutability_policy( 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) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -1002,6 +1001,7 @@ def extend_immutability_policy( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -1018,9 +1018,8 @@ def extend_immutability_policy( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 index c7049ade6b06..b18726355861 100644 --- 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 @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 index 16d00abe29d7..e3804a38ffc4 100644 --- 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 @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 index 75e62a807756..38b2ae877a41 100644 --- 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 @@ -72,6 +72,7 @@ def check_name_availability( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -84,9 +85,8 @@ def check_name_availability( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -123,6 +123,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -135,9 +136,8 @@ def _create_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -249,7 +249,6 @@ def delete( # 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: @@ -258,8 +257,8 @@ def delete( 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) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -309,7 +308,7 @@ def get_properties( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -318,8 +317,8 @@ def get_properties( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -386,6 +385,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -398,9 +398,8 @@ def update( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -455,7 +454,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -464,9 +463,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -526,7 +524,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -535,9 +533,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -594,7 +591,7 @@ def list_keys( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -603,8 +600,8 @@ def list_keys( 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) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -665,6 +662,7 @@ def regenerate_key( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -677,9 +675,8 @@ def regenerate_key( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -738,6 +735,7 @@ def list_account_sas( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -750,9 +748,8 @@ def list_account_sas( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -811,6 +808,7 @@ def list_service_sas( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -823,9 +821,8 @@ def list_service_sas( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 index 327ed44d1b84..08245d5e1201 100644 --- 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 @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -141,7 +140,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -150,9 +149,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/blob_containers_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/blob_containers_operations.py index 56fe57423fc9..8d69bbcdf38e 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/blob_containers_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/blob_containers_operations.py @@ -77,7 +77,7 @@ def list( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -86,8 +86,8 @@ def list( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -162,6 +162,7 @@ def create( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -174,9 +175,8 @@ def create( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -250,6 +250,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -262,9 +263,8 @@ def update( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -326,7 +326,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -335,8 +335,8 @@ def get( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -397,7 +397,6 @@ def delete( # 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: @@ -406,8 +405,8 @@ def delete( 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) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -469,6 +468,7 @@ def set_legal_hold( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -481,9 +481,8 @@ def set_legal_hold( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -552,6 +551,7 @@ def clear_legal_hold( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -564,9 +564,8 @@ def clear_legal_hold( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -644,6 +643,7 @@ def create_or_update_immutability_policy( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -661,9 +661,8 @@ def create_or_update_immutability_policy( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -738,7 +737,7 @@ def get_immutability_policy( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -749,8 +748,8 @@ def get_immutability_policy( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -828,7 +827,7 @@ def delete_immutability_policy( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -838,8 +837,8 @@ def delete_immutability_policy( 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) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -914,7 +913,7 @@ def lock_immutability_policy( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -924,8 +923,8 @@ def lock_immutability_policy( 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) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -1008,6 +1007,7 @@ def extend_immutability_policy( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -1024,9 +1024,8 @@ def extend_immutability_policy( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/operations.py index 445d1003e64c..3acb8e5f66f9 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/operations.py @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/skus_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/skus_operations.py index e0ca2a05942d..03ba08d79b11 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/skus_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/skus_operations.py @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/storage_accounts_operations.py index 3709199456c1..51377b13f35a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/storage_accounts_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/storage_accounts_operations.py @@ -74,6 +74,7 @@ def check_name_availability( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -86,9 +87,8 @@ def check_name_availability( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -125,6 +125,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -137,9 +138,8 @@ def _create_initial( 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) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -251,7 +251,6 @@ def delete( # 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: @@ -260,8 +259,8 @@ def delete( 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) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -311,7 +310,7 @@ def get_properties( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -320,8 +319,8 @@ def get_properties( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -388,6 +387,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -400,9 +400,8 @@ def update( 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) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -457,7 +456,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -466,9 +465,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -528,7 +526,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -537,9 +535,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -596,7 +593,7 @@ def list_keys( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -605,8 +602,8 @@ def list_keys( 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) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -667,6 +664,7 @@ def regenerate_key( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -679,9 +677,8 @@ def regenerate_key( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -741,6 +738,7 @@ def list_account_sas( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -753,9 +751,8 @@ def list_account_sas( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -815,6 +812,7 @@ def list_service_sas( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -827,9 +825,8 @@ def list_service_sas( 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) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -888,7 +885,7 @@ def get_management_policies( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -897,8 +894,8 @@ def get_management_policies( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -963,6 +960,7 @@ def create_or_update_management_policies( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -975,9 +973,8 @@ def create_or_update_management_policies( body_content = self._serialize.body(properties, 'ManagementPoliciesRulesSetParameter') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -1033,7 +1030,6 @@ def delete_management_policies( # 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: @@ -1042,8 +1038,8 @@ def delete_management_policies( 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) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/usages_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/usages_operations.py index 1adfde6245d0..f47d740798f0 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/usages_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/usages_operations.py @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -141,7 +140,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -150,9 +149,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/__init__.py new file mode 100644 index 000000000000..0854715e0c10 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/__init__.py new file mode 100644 index 000000000000..7af0b0e1a1e1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/__init__.py @@ -0,0 +1,219 @@ +# 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 + from .storage_account_management_policies_py3 import StorageAccountManagementPolicies + from .management_policies_rules_set_parameter_py3 import ManagementPoliciesRulesSetParameter +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 .storage_account_management_policies import StorageAccountManagementPolicies + from .management_policies_rules_set_parameter import ManagementPoliciesRulesSetParameter +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', + 'StorageAccountManagementPolicies', + 'ManagementPoliciesRulesSetParameter', + '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_07_01/models/account_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/account_sas_parameters.py new file mode 100644 index 000000000000..2684b847f902 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_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_07_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_07_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_07_01/models/account_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/account_sas_parameters_py3.py new file mode 100644 index 000000000000..bafb5b3e65f2 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_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_07_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_07_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_07_01/models/azure_entity_resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/azure_entity_resource.py new file mode 100644 index 000000000000..3bffaab8d35b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/azure_entity_resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/azure_entity_resource_py3.py new file mode 100644 index 000000000000..d3f80d87498a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_py3 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_07_01/models/blob_container.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_container.py new file mode 100644 index 000000000000..7116fe02923d --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_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_07_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_07_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_07_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_07_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_07_01/models/blob_container_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_container_py3.py new file mode 100644 index 000000000000..c4dc0079b3ba --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_py3 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_07_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_07_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_07_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_07_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_07_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_07_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_07_01/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/check_name_availability_result.py new file mode 100644 index 000000000000..80798d59633b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..6d09f2814e76 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/custom_domain.py new file mode 100644 index 000000000000..585480d7321a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/custom_domain_py3.py new file mode 100644 index 000000000000..4c6fe3f83e35 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/dimension.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/dimension.py new file mode 100644 index 000000000000..0a0cdaf75da7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/dimension_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/dimension_py3.py new file mode 100644 index 000000000000..6845aa528b4b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/encryption.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption.py new file mode 100644 index 000000000000..b7579543feed --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_07_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_07_01/models/encryption_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_py3.py new file mode 100644 index 000000000000..7b12b027cbe9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_07_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_07_01/models/encryption_service.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_service.py new file mode 100644 index 000000000000..3a020c468f64 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/encryption_service_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_service_py3.py new file mode 100644 index 000000000000..0566050c6155 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/encryption_services.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_services.py new file mode 100644 index 000000000000..12606368487d --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2018_07_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_07_01/models/encryption_services_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_services_py3.py new file mode 100644 index 000000000000..2385b58cd95b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2018_07_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_07_01/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/endpoints.py new file mode 100644 index 000000000000..66b1c3459a5e --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/endpoints.py @@ -0,0 +1,61 @@ +# 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, + table, web or dfs 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 + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/endpoints_py3.py new file mode 100644 index 000000000000..ced561acd85b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/endpoints_py3.py @@ -0,0 +1,61 @@ +# 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, + table, web or dfs 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 + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/identity.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/identity.py new file mode 100644 index 000000000000..f526b986fc70 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/identity_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/identity_py3.py new file mode 100644 index 000000000000..22d25fdd85b7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/immutability_policy.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy.py new file mode 100644 index 000000000000..a1fd181e57f7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/immutability_policy_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy_properties.py new file mode 100644 index 000000000000..dd21a8a48d65 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_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_07_01/models/immutability_policy_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy_properties_py3.py new file mode 100644 index 000000000000..32ff9c58ae2b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_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_07_01/models/immutability_policy_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy_py3.py new file mode 100644 index 000000000000..1c17d360cc01 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_py3 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_07_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_07_01/models/ip_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/ip_rule.py new file mode 100644 index 000000000000..decfb4bec67c --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/ip_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/ip_rule_py3.py new file mode 100644 index 000000000000..6cc874cb6e8e --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/key_vault_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/key_vault_properties.py new file mode 100644 index 000000000000..44eaf379f6f2 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/key_vault_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/key_vault_properties_py3.py new file mode 100644 index 000000000000..9e6350eec898 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/legal_hold.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold.py new file mode 100644 index 000000000000..4eb93df1d9fe --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/legal_hold_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold_properties.py new file mode 100644 index 000000000000..fcf2cd1a681b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/legal_hold_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold_properties_py3.py new file mode 100644 index 000000000000..e6066c97b396 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/legal_hold_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold_py3.py new file mode 100644 index 000000000000..a4bc196cb604 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/list_account_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_account_sas_response.py new file mode 100644 index 000000000000..a56e959a34bd --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/list_account_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/list_container_item.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_item.py new file mode 100644 index 000000000000..5fe7cc1b0ce7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_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_07_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_07_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_07_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_07_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_07_01/models/list_container_item_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_item_py3.py new file mode 100644 index 000000000000..1e67232a5a61 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_py3 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_07_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_07_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_07_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_07_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_07_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_07_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_07_01/models/list_container_items.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_items.py new file mode 100644 index 000000000000..9fc5346e5102 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/list_container_items_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_items_py3.py new file mode 100644 index 000000000000..a689dc1e3f14 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/list_service_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_service_sas_response.py new file mode 100644 index 000000000000..800c0298af61 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/list_service_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/management_policies_rules_set_parameter.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/management_policies_rules_set_parameter.py new file mode 100644 index 000000000000..c814a5b9391f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/management_policies_rules_set_parameter.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 ManagementPoliciesRulesSetParameter(Model): + """The Storage Account ManagementPolicies Rules, in JSON format. See more + details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + """ + + _attribute_map = { + 'policy': {'key': 'properties.policy', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ManagementPoliciesRulesSetParameter, self).__init__(**kwargs) + self.policy = kwargs.get('policy', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/management_policies_rules_set_parameter_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/management_policies_rules_set_parameter_py3.py new file mode 100644 index 000000000000..7fb665877844 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/management_policies_rules_set_parameter_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 ManagementPoliciesRulesSetParameter(Model): + """The Storage Account ManagementPolicies Rules, in JSON format. See more + details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + """ + + _attribute_map = { + 'policy': {'key': 'properties.policy', 'type': 'object'}, + } + + def __init__(self, *, policy=None, **kwargs) -> None: + super(ManagementPoliciesRulesSetParameter, self).__init__(**kwargs) + self.policy = policy diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/metric_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/metric_specification.py new file mode 100644 index 000000000000..0b12a11ef865 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/metric_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/metric_specification_py3.py new file mode 100644 index 000000000000..7a2c4777e90b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/network_rule_set.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/network_rule_set.py new file mode 100644 index 000000000000..9ec169475870 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_07_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2018_07_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_07_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_07_01/models/network_rule_set_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/network_rule_set_py3.py new file mode 100644 index 000000000000..50fc223d26f6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_07_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2018_07_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_07_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_07_01/models/operation.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation.py new file mode 100644 index 000000000000..b75742f63b76 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_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_07_01/models/operation_display.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_display.py new file mode 100644 index 000000000000..029cfa2a8304 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_display.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 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 + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_display_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_display_py3.py new file mode 100644 index 000000000000..318ba2236d3e --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_display_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 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 + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_paged.py new file mode 100644 index 000000000000..a24f58ac96c1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/operation_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_py3.py new file mode 100644 index 000000000000..b89d9bd94606 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_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_07_01/models/proxy_resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/proxy_resource.py new file mode 100644 index 000000000000..0de8fb6bd420 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/proxy_resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/proxy_resource_py3.py new file mode 100644 index 000000000000..2e8391f912d6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_py3 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_07_01/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/resource.py new file mode 100644 index 000000000000..9333a2ac49ef --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/resource_py3.py new file mode 100644 index 000000000000..370e6c506581 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/restriction.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/restriction.py new file mode 100644 index 000000000000..f23b0c7f6f1a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/restriction_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/restriction_py3.py new file mode 100644 index 000000000000..35b1b47b8988 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/service_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_sas_parameters.py new file mode 100644 index 000000000000..d40e43b44a6e --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_sas_parameters.py @@ -0,0 +1,120 @@ +# 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: 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_07_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_07_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_07_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}, + '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_07_01/models/service_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_sas_parameters_py3.py new file mode 100644 index 000000000000..3d528f6664e8 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_sas_parameters_py3.py @@ -0,0 +1,120 @@ +# 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: 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_07_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_07_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_07_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}, + '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=None, 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_07_01/models/service_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_specification.py new file mode 100644 index 000000000000..f2def7472dc0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/service_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_specification_py3.py new file mode 100644 index 000000000000..aa4f6e34f791 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/sku.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku.py new file mode 100644 index 000000000000..b3040e8a6031 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku.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 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', + 'Premium_ZRS' + :type name: str or ~azure.mgmt.storage.v2018_07_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_07_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', 'FileStorage', + 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_07_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_07_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_07_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_07_01/models/sku_capability.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_capability.py new file mode 100644 index 000000000000..b8fa68ce7778 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/sku_capability_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_capability_py3.py new file mode 100644 index 000000000000..f349a08eda21 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/sku_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_paged.py new file mode 100644 index 000000000000..8956385239ae --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/sku_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_py3.py new file mode 100644 index 000000000000..6a55d280f547 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_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 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', + 'Premium_ZRS' + :type name: str or ~azure.mgmt.storage.v2018_07_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_07_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', 'FileStorage', + 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_07_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_07_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_07_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_07_01/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account.py new file mode 100644 index 000000000000..379f54fc2b9f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account.py @@ -0,0 +1,179 @@ +# 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_07_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_07_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_07_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_07_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_07_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_07_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_07_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_07_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2018_07_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_07_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + """ + + _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_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + 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_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = None + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_create_parameters.py new file mode 100644 index 000000000000..35623ebc3ce3 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_create_parameters.py @@ -0,0 +1,102 @@ +# 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_07_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_07_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_07_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_07_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_07_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_07_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_07_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: 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_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', '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_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..404ad6f14db0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_create_parameters_py3.py @@ -0,0 +1,102 @@ +# 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_07_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_07_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_07_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_07_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_07_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_07_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_07_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: 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_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', '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_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **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_azure_files_aad_integration = enable_azure_files_aad_integration + self.enable_https_traffic_only = enable_https_traffic_only + self.is_hns_enabled = is_hns_enabled diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_key.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_key.py new file mode 100644 index 000000000000..5fafecd6a4ce --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/storage_account_key_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_key_py3.py new file mode 100644 index 000000000000..7ee7e99f2bdf --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/storage_account_list_keys_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_list_keys_result.py new file mode 100644 index 000000000000..0d5d0cbbe0bf --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/storage_account_list_keys_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_list_keys_result_py3.py new file mode 100644 index 000000000000..d14a6efa05c6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/storage_account_management_policies.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_management_policies.py new file mode 100644 index 000000000000..59ee515d9a04 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_management_policies.py @@ -0,0 +1,56 @@ +# 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 StorageAccountManagementPolicies(Resource): + """The Get Storage Account ManagementPolicies operation response. + + 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 + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + :ivar last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(StorageAccountManagementPolicies, self).__init__(**kwargs) + self.policy = kwargs.get('policy', None) + self.last_modified_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_management_policies_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_management_policies_py3.py new file mode 100644 index 000000000000..3dc977624949 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_management_policies_py3.py @@ -0,0 +1,56 @@ +# 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_py3 import Resource + + +class StorageAccountManagementPolicies(Resource): + """The Get Storage Account ManagementPolicies operation response. + + 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 + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + :ivar last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, policy=None, **kwargs) -> None: + super(StorageAccountManagementPolicies, self).__init__(**kwargs) + self.policy = policy + self.last_modified_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_paged.py new file mode 100644 index 000000000000..28b37472e3cb --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_py3.py new file mode 100644 index 000000000000..b83276b42715 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_py3.py @@ -0,0 +1,179 @@ +# 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_py3 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_07_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_07_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_07_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_07_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_07_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_07_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_07_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_07_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2018_07_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_07_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + """ + + _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_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **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_azure_files_aad_integration = enable_azure_files_aad_integration + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None + self.is_hns_enabled = is_hns_enabled diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_update_parameters.py new file mode 100644 index 000000000000..12377448b5f3 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_update_parameters.py @@ -0,0 +1,83 @@ +# 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, Premium_LRS or Premium_ZRS, nor can accounts of + those sku names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_07_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_07_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_07_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_07_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_07_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_07_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', 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_07_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_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + '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_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + 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_07_01/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..db33745b807b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_update_parameters_py3.py @@ -0,0 +1,83 @@ +# 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, Premium_LRS or Premium_ZRS, nor can accounts of + those sku names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_07_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_07_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_07_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_07_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_07_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_07_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', 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_07_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_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + '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_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, 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_azure_files_aad_integration = enable_azure_files_aad_integration + 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_07_01/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_management_client_enums.py new file mode 100644 index 000000000000..aa998284e397 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_management_client_enums.py @@ -0,0 +1,200 @@ +# 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" + premium_zrs = "Premium_ZRS" + + +class SkuTier(str, Enum): + + standard = "Standard" + premium = "Premium" + + +class Kind(str, Enum): + + storage = "Storage" + storage_v2 = "StorageV2" + blob_storage = "BlobStorage" + file_storage = "FileStorage" + block_blob_storage = "BlockBlobStorage" + + +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_07_01/models/tag_property.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tag_property.py new file mode 100644 index 000000000000..3b879061fd2b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/tag_property_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tag_property_py3.py new file mode 100644 index 000000000000..22aaf6cb82ba --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/tracked_resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tracked_resource.py new file mode 100644 index 000000000000..27ab94c7a8dd --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/tracked_resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tracked_resource_py3.py new file mode 100644 index 000000000000..b28cc1859448 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_py3 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_07_01/models/update_history_property.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/update_history_property.py new file mode 100644 index 000000000000..e8e07b3db664 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/update_history_property_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/update_history_property_py3.py new file mode 100644 index 000000000000..d503f9b91344 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_01/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage.py new file mode 100644 index 000000000000..ca31da73d629 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_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_07_01/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_name.py new file mode 100644 index 000000000000..e4082bf52384 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_name_py3.py new file mode 100644 index 000000000000..f519bb5072b1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/usage_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_paged.py new file mode 100644 index 000000000000..d5b106fd2757 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_01/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_py3.py new file mode 100644 index 000000000000..7115cd739ce7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_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_07_01/models/virtual_network_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/virtual_network_rule.py new file mode 100644 index 000000000000..22e2c834dfc0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_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_07_01/models/virtual_network_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..b1401da53ba4 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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_07_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_07_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_07_01/operations/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/__init__.py new file mode 100644 index 000000000000..455c0dc48e1c --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/__init__.py @@ -0,0 +1,26 @@ +# 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 .usages_operations import UsagesOperations +from .blob_containers_operations import BlobContainersOperations +from .management_policies_operations import ManagementPoliciesOperations + +__all__ = [ + 'Operations', + 'SkusOperations', + 'StorageAccountsOperations', + 'UsagesOperations', + 'BlobContainersOperations', + 'ManagementPoliciesOperations', +] diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/blob_containers_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/blob_containers_operations.py new file mode 100644 index 000000000000..cb251bb1aec7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/blob_containers_operations.py @@ -0,0 +1,1044 @@ +# 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-07-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-07-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_07_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_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_07_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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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_07_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_07_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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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 = {} + 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, header_parameters) + response = self._client.send(request, 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_07_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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_01/operations/management_policies_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/management_policies_operations.py new file mode 100644 index 000000000000..d81c7619fee4 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/management_policies_operations.py @@ -0,0 +1,246 @@ +# 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 ManagementPoliciesOperations(object): + """ManagementPoliciesOperations 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-03-01-preview". + :ivar management_policy_name: The name of the Storage Account Management Policy. It should always 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-03-01-preview" + self.management_policy_name = "default" + + self.config = config + + def get( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the data policy rules associated with 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: StorageAccountManagementPolicies or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.StorageAccountManagementPolicies + 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), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, 'str') + } + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountManagementPolicies', 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}/managementPolicies/{managementPolicyName}'} + + def create_or_update( + self, resource_group_name, account_name, policy=None, custom_headers=None, raw=False, **operation_config): + """Sets the data policy rules associated with 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 policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + :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: StorageAccountManagementPolicies or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.StorageAccountManagementPolicies + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + properties = models.ManagementPoliciesRulesSetParameter(policy=policy) + + # Construct URL + url = self.create_or_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), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, 'str') + } + 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['Accept'] = 'application/json' + 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(properties, 'ManagementPoliciesRulesSetParameter') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountManagementPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes the data policy rules associated with 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: 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), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, 'str') + } + 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 = {} + 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, header_parameters) + response = self._client.send(request, 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}/managementPolicies/{managementPolicyName}'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/operations.py new file mode 100644 index 000000000000..e10e2242f7fc --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/operations.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-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_07_01.models.OperationPaged[~azure.mgmt.storage.v2018_07_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/skus_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/skus_operations.py new file mode 100644 index 000000000000..248eaa0bdeca --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/skus_operations.py @@ -0,0 +1,103 @@ +# 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-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-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_07_01.models.SkuPaged[~azure.mgmt.storage.v2018_07_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.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_07_01/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/storage_accounts_operations.py new file mode 100644 index 000000000000..7b34e2cada26 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/storage_accounts_operations.py @@ -0,0 +1,842 @@ +# 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-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-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_07_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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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_07_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_07_01.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2018_07_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 = {} + 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, header_parameters) + response = self._client.send(request, 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_07_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_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_07_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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_07_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.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_07_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_07_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.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_07_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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_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_07_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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_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_07_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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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_07_01/operations/usages_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/usages_operations.py new file mode 100644 index 000000000000..9f16af2fc35d --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/usages_operations.py @@ -0,0 +1,106 @@ +# 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 UsagesOperations(object): + """UsagesOperations 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-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-01" + + self.config = config + + def list_by_location( + self, location, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources of the + location under the subscription. + + :param location: The location of the Azure Storage resource. + :type location: 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 Usage + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.UsagePaged[~azure.mgmt.storage.v2018_07_01.models.Usage] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str') + } + 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['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.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_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/storage_management_client.py new file mode 100644 index 000000000000..9158bf02e751 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/storage_management_client.py @@ -0,0 +1,105 @@ +# 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.usages_operations import UsagesOperations +from .operations.blob_containers_operations import BlobContainersOperations +from .operations.management_policies_operations import ManagementPoliciesOperations +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_07_01.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2018_07_01.operations.SkusOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2018_07_01.operations.StorageAccountsOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.storage.v2018_07_01.operations.UsagesOperations + :ivar blob_containers: BlobContainers operations + :vartype blob_containers: azure.mgmt.storage.v2018_07_01.operations.BlobContainersOperations + :ivar management_policies: ManagementPolicies operations + :vartype management_policies: azure.mgmt.storage.v2018_07_01.operations.ManagementPoliciesOperations + + :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._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.usages = UsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.management_policies = ManagementPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/version.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/version.py new file mode 100644 index 000000000000..53a203f32aaf --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_07_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 = "" + diff --git a/azure-mgmt-storage/setup.py b/azure-mgmt-storage/setup.py index 67df7c1540bd..18a3860a386f 100644 --- a/azure-mgmt-storage/setup.py +++ b/azure-mgmt-storage/setup.py @@ -78,8 +78,9 @@ zip_safe=False, packages=find_packages(exclude=["tests"]), install_requires=[ + 'msrest>=0.5.0', 'msrestazure>=0.4.32,<2.0.0', - 'azure-common~=1.1,>=1.1.10', + 'azure-common~=1.1', ], cmdclass=cmdclass )