From 67728c528c6179b6790b7e6589e712e9d4010fe6 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 23 Sep 2020 08:53:18 +0000 Subject: [PATCH] Generated from 9bb89e6b2919a42994312b5a340971392c88a5ab --- sdk/storage/azure-mgmt-storage/README.md | 2 +- .../storage/_storage_management_client.py | 68 + .../storage/v2020_08_01_preview/__init__.py | 19 + .../v2020_08_01_preview/_configuration.py | 48 + .../_storage_management_client.py | 134 + .../v2020_08_01_preview/models/__init__.py | 431 ++ .../v2020_08_01_preview/models/_models.py | 4437 +++++++++++++++++ .../v2020_08_01_preview/models/_models_py3.py | 4437 +++++++++++++++++ .../models/_paged_models.py | 183 + .../_storage_management_client_enums.py | 322 ++ .../operations/__init__.py | 50 + .../operations/_blob_containers_operations.py | 1153 +++++ .../operations/_blob_services_operations.py | 263 + .../_deleted_accounts_operations.py | 164 + .../_encryption_scopes_operations.py | 348 ++ .../operations/_file_services_operations.py | 256 + .../operations/_file_shares_operations.py | 510 ++ .../_management_policies_operations.py | 244 + ..._object_replication_policies_operations.py | 318 ++ .../operations/_operations.py | 102 + ...private_endpoint_connections_operations.py | 321 ++ .../_private_link_resources_operations.py | 107 + .../operations/_queue_operations.py | 421 ++ .../operations/_queue_services_operations.py | 254 + .../operations/_skus_operations.py | 107 + .../_storage_accounts_operations.py | 1111 +++++ .../operations/_table_operations.py | 391 ++ .../operations/_table_services_operations.py | 254 + .../operations/_usages_operations.py | 110 + .../storage/v2020_08_01_preview/version.py | 13 + 30 files changed, 16577 insertions(+), 1 deletion(-) create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_configuration.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_storage_management_client.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models_py3.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_paged_models.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_storage_management_client_enums.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_containers_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_deleted_accounts_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_encryption_scopes_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_shares_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_management_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_object_replication_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_link_resources_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_skus_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_storage_accounts_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_usages_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/version.py diff --git a/sdk/storage/azure-mgmt-storage/README.md b/sdk/storage/azure-mgmt-storage/README.md index 5416db7f2b40..ada1f9bd35d5 100644 --- a/sdk/storage/azure-mgmt-storage/README.md +++ b/sdk/storage/azure-mgmt-storage/README.md @@ -2,7 +2,7 @@ This is the Microsoft Azure Storage Management Client Library. This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. -For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). # Usage diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py index b9bd87ed80cc..17549edf1543 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py @@ -84,6 +84,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2018-11-01: :mod:`v2018_11_01.models` * 2019-04-01: :mod:`v2019_04_01.models` * 2019-06-01: :mod:`v2019_06_01.models` + * 2020-08-01-preview: :mod:`v2020_08_01_preview.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -118,6 +119,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-06-01': from .v2019_06_01 import models return models + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @property @@ -130,6 +134,7 @@ def blob_containers(self): * 2018-11-01: :class:`BlobContainersOperations` * 2019-04-01: :class:`BlobContainersOperations` * 2019-06-01: :class:`BlobContainersOperations` + * 2020-08-01-preview: :class:`BlobContainersOperations` """ api_version = self._get_api_version('blob_containers') if api_version == '2018-02-01': @@ -144,6 +149,8 @@ def blob_containers(self): from .v2019_04_01.operations import BlobContainersOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import BlobContainersOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.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))) @@ -156,6 +163,7 @@ def blob_services(self): * 2018-11-01: :class:`BlobServicesOperations` * 2019-04-01: :class:`BlobServicesOperations` * 2019-06-01: :class:`BlobServicesOperations` + * 2020-08-01-preview: :class:`BlobServicesOperations` """ api_version = self._get_api_version('blob_services') if api_version == '2018-07-01': @@ -166,6 +174,21 @@ def blob_services(self): from .v2019_04_01.operations import BlobServicesOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import BlobServicesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import BlobServicesOperations 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 deleted_accounts(self): + """Instance depends on the API version: + + * 2020-08-01-preview: :class:`DeletedAccountsOperations` + """ + api_version = self._get_api_version('deleted_accounts') + if api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import DeletedAccountsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -175,10 +198,13 @@ def encryption_scopes(self): """Instance depends on the API version: * 2019-06-01: :class:`EncryptionScopesOperations` + * 2020-08-01-preview: :class:`EncryptionScopesOperations` """ api_version = self._get_api_version('encryption_scopes') if api_version == '2019-06-01': from .v2019_06_01.operations import EncryptionScopesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import EncryptionScopesOperations 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))) @@ -189,12 +215,15 @@ def file_services(self): * 2019-04-01: :class:`FileServicesOperations` * 2019-06-01: :class:`FileServicesOperations` + * 2020-08-01-preview: :class:`FileServicesOperations` """ api_version = self._get_api_version('file_services') if api_version == '2019-04-01': from .v2019_04_01.operations import FileServicesOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import FileServicesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import FileServicesOperations 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))) @@ -205,12 +234,15 @@ def file_shares(self): * 2019-04-01: :class:`FileSharesOperations` * 2019-06-01: :class:`FileSharesOperations` + * 2020-08-01-preview: :class:`FileSharesOperations` """ api_version = self._get_api_version('file_shares') if api_version == '2019-04-01': from .v2019_04_01.operations import FileSharesOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import FileSharesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import FileSharesOperations 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))) @@ -223,6 +255,7 @@ def management_policies(self): * 2018-11-01: :class:`ManagementPoliciesOperations` * 2019-04-01: :class:`ManagementPoliciesOperations` * 2019-06-01: :class:`ManagementPoliciesOperations` + * 2020-08-01-preview: :class:`ManagementPoliciesOperations` """ api_version = self._get_api_version('management_policies') if api_version == '2018-07-01': @@ -233,6 +266,8 @@ def management_policies(self): from .v2019_04_01.operations import ManagementPoliciesOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import ManagementPoliciesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.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))) @@ -242,10 +277,13 @@ def object_replication_policies(self): """Instance depends on the API version: * 2019-06-01: :class:`ObjectReplicationPoliciesOperations` + * 2020-08-01-preview: :class:`ObjectReplicationPoliciesOperations` """ api_version = self._get_api_version('object_replication_policies') if api_version == '2019-06-01': from .v2019_06_01.operations import ObjectReplicationPoliciesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import ObjectReplicationPoliciesOperations 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))) @@ -262,6 +300,7 @@ def operations(self): * 2018-11-01: :class:`Operations` * 2019-04-01: :class:`Operations` * 2019-06-01: :class:`Operations` + * 2020-08-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-06-01': @@ -280,6 +319,8 @@ def operations(self): from .v2019_04_01.operations import Operations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import Operations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.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))) @@ -289,10 +330,13 @@ def private_endpoint_connections(self): """Instance depends on the API version: * 2019-06-01: :class:`PrivateEndpointConnectionsOperations` + * 2020-08-01-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2019-06-01': from .v2019_06_01.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import PrivateEndpointConnectionsOperations 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))) @@ -302,10 +346,13 @@ def private_link_resources(self): """Instance depends on the API version: * 2019-06-01: :class:`PrivateLinkResourcesOperations` + * 2020-08-01-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2019-06-01': from .v2019_06_01.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import PrivateLinkResourcesOperations 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))) @@ -315,10 +362,13 @@ def queue(self): """Instance depends on the API version: * 2019-06-01: :class:`QueueOperations` + * 2020-08-01-preview: :class:`QueueOperations` """ api_version = self._get_api_version('queue') if api_version == '2019-06-01': from .v2019_06_01.operations import QueueOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import QueueOperations 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))) @@ -328,10 +378,13 @@ def queue_services(self): """Instance depends on the API version: * 2019-06-01: :class:`QueueServicesOperations` + * 2020-08-01-preview: :class:`QueueServicesOperations` """ api_version = self._get_api_version('queue_services') if api_version == '2019-06-01': from .v2019_06_01.operations import QueueServicesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import QueueServicesOperations 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))) @@ -348,6 +401,7 @@ def skus(self): * 2018-11-01: :class:`SkusOperations` * 2019-04-01: :class:`SkusOperations` * 2019-06-01: :class:`SkusOperations` + * 2020-08-01-preview: :class:`SkusOperations` """ api_version = self._get_api_version('skus') if api_version == '2017-06-01': @@ -366,6 +420,8 @@ def skus(self): from .v2019_04_01.operations import SkusOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import SkusOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.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))) @@ -385,6 +441,7 @@ def storage_accounts(self): * 2018-11-01: :class:`StorageAccountsOperations` * 2019-04-01: :class:`StorageAccountsOperations` * 2019-06-01: :class:`StorageAccountsOperations` + * 2020-08-01-preview: :class:`StorageAccountsOperations` """ api_version = self._get_api_version('storage_accounts') if api_version == '2015-06-15': @@ -409,6 +466,8 @@ def storage_accounts(self): from .v2019_04_01.operations import StorageAccountsOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.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))) @@ -418,10 +477,13 @@ def table(self): """Instance depends on the API version: * 2019-06-01: :class:`TableOperations` + * 2020-08-01-preview: :class:`TableOperations` """ api_version = self._get_api_version('table') if api_version == '2019-06-01': from .v2019_06_01.operations import TableOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import TableOperations 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))) @@ -431,10 +493,13 @@ def table_services(self): """Instance depends on the API version: * 2019-06-01: :class:`TableServicesOperations` + * 2020-08-01-preview: :class:`TableServicesOperations` """ api_version = self._get_api_version('table_services') if api_version == '2019-06-01': from .v2019_06_01.operations import TableServicesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.operations import TableServicesOperations 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))) @@ -476,6 +541,7 @@ def usages(self): * 2018-11-01: :class:`UsagesOperations` * 2019-04-01: :class:`UsagesOperations` * 2019-06-01: :class:`UsagesOperations` + * 2020-08-01-preview: :class:`UsagesOperations` """ api_version = self._get_api_version('usages') if api_version == '2018-03-01-preview': @@ -488,6 +554,8 @@ def usages(self): from .v2019_04_01.operations import UsagesOperations as OperationClass elif api_version == '2019-06-01': from .v2019_06_01.operations import UsagesOperations as OperationClass + elif api_version == '2020-08-01-preview': + from .v2020_08_01_preview.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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/__init__.py new file mode 100644 index 000000000000..da2c3f969e67 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._configuration import StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_configuration.py new file mode 100644 index 000000000000..57fa5132dc82 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_configuration.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 msrestazure import AzureConfiguration + +from .version import VERSION + + +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) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + 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 diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_storage_management_client.py new file mode 100644 index 000000000000..79761550c1f4 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_storage_management_client.py @@ -0,0 +1,134 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# 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 ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import DeletedAccountsOperations +from .operations import UsagesOperations +from .operations import ManagementPoliciesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import ObjectReplicationPoliciesOperations +from .operations import EncryptionScopesOperations +from .operations import BlobServicesOperations +from .operations import BlobContainersOperations +from .operations import FileServicesOperations +from .operations import FileSharesOperations +from .operations import QueueServicesOperations +from .operations import QueueOperations +from .operations import TableServicesOperations +from .operations import TableOperations +from . import models + + +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.v2020_08_01_preview.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2020_08_01_preview.operations.SkusOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2020_08_01_preview.operations.StorageAccountsOperations + :ivar deleted_accounts: DeletedAccounts operations + :vartype deleted_accounts: azure.mgmt.storage.v2020_08_01_preview.operations.DeletedAccountsOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.storage.v2020_08_01_preview.operations.UsagesOperations + :ivar management_policies: ManagementPolicies operations + :vartype management_policies: azure.mgmt.storage.v2020_08_01_preview.operations.ManagementPoliciesOperations + :ivar private_endpoint_connections: PrivateEndpointConnections operations + :vartype private_endpoint_connections: azure.mgmt.storage.v2020_08_01_preview.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResources operations + :vartype private_link_resources: azure.mgmt.storage.v2020_08_01_preview.operations.PrivateLinkResourcesOperations + :ivar object_replication_policies: ObjectReplicationPolicies operations + :vartype object_replication_policies: azure.mgmt.storage.v2020_08_01_preview.operations.ObjectReplicationPoliciesOperations + :ivar encryption_scopes: EncryptionScopes operations + :vartype encryption_scopes: azure.mgmt.storage.v2020_08_01_preview.operations.EncryptionScopesOperations + :ivar blob_services: BlobServices operations + :vartype blob_services: azure.mgmt.storage.v2020_08_01_preview.operations.BlobServicesOperations + :ivar blob_containers: BlobContainers operations + :vartype blob_containers: azure.mgmt.storage.v2020_08_01_preview.operations.BlobContainersOperations + :ivar file_services: FileServices operations + :vartype file_services: azure.mgmt.storage.v2020_08_01_preview.operations.FileServicesOperations + :ivar file_shares: FileShares operations + :vartype file_shares: azure.mgmt.storage.v2020_08_01_preview.operations.FileSharesOperations + :ivar queue_services: QueueServices operations + :vartype queue_services: azure.mgmt.storage.v2020_08_01_preview.operations.QueueServicesOperations + :ivar queue: Queue operations + :vartype queue: azure.mgmt.storage.v2020_08_01_preview.operations.QueueOperations + :ivar table_services: TableServices operations + :vartype table_services: azure.mgmt.storage.v2020_08_01_preview.operations.TableServicesOperations + :ivar table: Table operations + :vartype table: azure.mgmt.storage.v2020_08_01_preview.operations.TableOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2020-08-01-preview' + 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.deleted_accounts = DeletedAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.management_policies = ManagementPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.object_replication_policies = ObjectReplicationPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.encryption_scopes = EncryptionScopesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_services = BlobServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.file_services = FileServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.file_shares = FileSharesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.queue_services = QueueServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.queue = QueueOperations( + self._client, self.config, self._serialize, self._deserialize) + self.table_services = TableServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.table = TableOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/__init__.py new file mode 100644 index 000000000000..e5a1f9d3297b --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/__init__.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 ._models_py3 import AccountSasParameters + from ._models_py3 import ActiveDirectoryProperties + from ._models_py3 import AzureEntityResource + from ._models_py3 import AzureFilesIdentityBasedAuthentication + from ._models_py3 import BlobContainer + from ._models_py3 import BlobRestoreParameters + from ._models_py3 import BlobRestoreRange + from ._models_py3 import BlobRestoreStatus + from ._models_py3 import BlobServiceProperties + from ._models_py3 import ChangeFeed + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CorsRule + from ._models_py3 import CorsRules + from ._models_py3 import CustomDomain + from ._models_py3 import DateAfterCreation + from ._models_py3 import DateAfterModification + from ._models_py3 import DeletedAccount + from ._models_py3 import DeletedShare + from ._models_py3 import DeleteRetentionPolicy + from ._models_py3 import Dimension + from ._models_py3 import Encryption + from ._models_py3 import EncryptionScope + from ._models_py3 import EncryptionScopeKeyVaultProperties + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ErrorResponseBody + from ._models_py3 import FileServiceItems + from ._models_py3 import FileServiceProperties + from ._models_py3 import FileShare + from ._models_py3 import FileShareItem + from ._models_py3 import GeoReplicationStats + from ._models_py3 import Identity + from ._models_py3 import ImmutabilityPolicy + from ._models_py3 import ImmutabilityPolicyProperties + from ._models_py3 import IPRule + from ._models_py3 import KeyVaultProperties + from ._models_py3 import LeaseContainerRequest + from ._models_py3 import LeaseContainerResponse + from ._models_py3 import LegalHold + from ._models_py3 import LegalHoldProperties + from ._models_py3 import ListAccountSasResponse + from ._models_py3 import ListContainerItem + from ._models_py3 import ListQueue + from ._models_py3 import ListQueueServices + from ._models_py3 import ListServiceSasResponse + from ._models_py3 import ListTableServices + from ._models_py3 import ManagementPolicy + from ._models_py3 import ManagementPolicyAction + from ._models_py3 import ManagementPolicyBaseBlob + from ._models_py3 import ManagementPolicyDefinition + from ._models_py3 import ManagementPolicyFilter + from ._models_py3 import ManagementPolicyRule + from ._models_py3 import ManagementPolicySchema + from ._models_py3 import ManagementPolicySnapShot + from ._models_py3 import MetricSpecification + from ._models_py3 import NetworkRuleSet + from ._models_py3 import ObjectReplicationPolicy + from ._models_py3 import ObjectReplicationPolicyFilter + from ._models_py3 import ObjectReplicationPolicyRule + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import ProxyResource + from ._models_py3 import QueueServiceProperties + from ._models_py3 import Resource + from ._models_py3 import ResourceAccessRule + from ._models_py3 import RestorePolicyProperties + from ._models_py3 import Restriction + from ._models_py3 import RoutingPreference + from ._models_py3 import ServiceSasParameters + from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SKUCapability + from ._models_py3 import SkuInformation + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountInternetEndpoints + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountMicrosoftEndpoints + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import StorageQueue + from ._models_py3 import Table + from ._models_py3 import TableServiceProperties + from ._models_py3 import TagFilter + from ._models_py3 import TagProperty + from ._models_py3 import TrackedResource + from ._models_py3 import UpdateHistoryProperty + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import VirtualNetworkRule +except (SyntaxError, ImportError): + from ._models import AccountSasParameters + from ._models import ActiveDirectoryProperties + from ._models import AzureEntityResource + from ._models import AzureFilesIdentityBasedAuthentication + from ._models import BlobContainer + from ._models import BlobRestoreParameters + from ._models import BlobRestoreRange + from ._models import BlobRestoreStatus + from ._models import BlobServiceProperties + from ._models import ChangeFeed + from ._models import CheckNameAvailabilityResult + from ._models import CorsRule + from ._models import CorsRules + from ._models import CustomDomain + from ._models import DateAfterCreation + from ._models import DateAfterModification + from ._models import DeletedAccount + from ._models import DeletedShare + from ._models import DeleteRetentionPolicy + from ._models import Dimension + from ._models import Encryption + from ._models import EncryptionScope + from ._models import EncryptionScopeKeyVaultProperties + from ._models import EncryptionService + from ._models import EncryptionServices + from ._models import Endpoints + from ._models import ErrorResponse, ErrorResponseException + from ._models import ErrorResponseBody + from ._models import FileServiceItems + from ._models import FileServiceProperties + from ._models import FileShare + from ._models import FileShareItem + from ._models import GeoReplicationStats + from ._models import Identity + from ._models import ImmutabilityPolicy + from ._models import ImmutabilityPolicyProperties + from ._models import IPRule + from ._models import KeyVaultProperties + from ._models import LeaseContainerRequest + from ._models import LeaseContainerResponse + from ._models import LegalHold + from ._models import LegalHoldProperties + from ._models import ListAccountSasResponse + from ._models import ListContainerItem + from ._models import ListQueue + from ._models import ListQueueServices + from ._models import ListServiceSasResponse + from ._models import ListTableServices + from ._models import ManagementPolicy + from ._models import ManagementPolicyAction + from ._models import ManagementPolicyBaseBlob + from ._models import ManagementPolicyDefinition + from ._models import ManagementPolicyFilter + from ._models import ManagementPolicyRule + from ._models import ManagementPolicySchema + from ._models import ManagementPolicySnapShot + from ._models import MetricSpecification + from ._models import NetworkRuleSet + from ._models import ObjectReplicationPolicy + from ._models import ObjectReplicationPolicyFilter + from ._models import ObjectReplicationPolicyRule + from ._models import Operation + from ._models import OperationDisplay + from ._models import PrivateEndpoint + from ._models import PrivateEndpointConnection + from ._models import PrivateLinkResource + from ._models import PrivateLinkResourceListResult + from ._models import PrivateLinkServiceConnectionState + from ._models import ProxyResource + from ._models import QueueServiceProperties + from ._models import Resource + from ._models import ResourceAccessRule + from ._models import RestorePolicyProperties + from ._models import Restriction + from ._models import RoutingPreference + from ._models import ServiceSasParameters + from ._models import ServiceSpecification + from ._models import Sku + from ._models import SKUCapability + from ._models import SkuInformation + from ._models import StorageAccount + from ._models import StorageAccountCheckNameAvailabilityParameters + from ._models import StorageAccountCreateParameters + from ._models import StorageAccountInternetEndpoints + from ._models import StorageAccountKey + from ._models import StorageAccountListKeysResult + from ._models import StorageAccountMicrosoftEndpoints + from ._models import StorageAccountRegenerateKeyParameters + from ._models import StorageAccountUpdateParameters + from ._models import StorageQueue + from ._models import Table + from ._models import TableServiceProperties + from ._models import TagFilter + from ._models import TagProperty + from ._models import TrackedResource + from ._models import UpdateHistoryProperty + from ._models import Usage + from ._models import UsageName + from ._models import VirtualNetworkRule +from ._paged_models import BlobServicePropertiesPaged +from ._paged_models import DeletedAccountPaged +from ._paged_models import EncryptionScopePaged +from ._paged_models import FileShareItemPaged +from ._paged_models import ListContainerItemPaged +from ._paged_models import ListQueuePaged +from ._paged_models import ObjectReplicationPolicyPaged +from ._paged_models import OperationPaged +from ._paged_models import PrivateEndpointConnectionPaged +from ._paged_models import SkuInformationPaged +from ._paged_models import StorageAccountPaged +from ._paged_models import TablePaged +from ._paged_models import UsagePaged +from ._storage_management_client_enums import ( + ReasonCode, + SkuName, + SkuTier, + Kind, + Reason, + KeyType, + KeySource, + Action, + State, + Bypass, + DefaultAction, + DirectoryServiceOptions, + AccessTier, + LargeFileSharesState, + RoutingChoice, + MinimumTlsVersion, + GeoReplicationStatus, + BlobRestoreProgressStatus, + ProvisioningState, + AccountStatus, + PrivateEndpointServiceConnectionStatus, + PrivateEndpointConnectionProvisioningState, + KeyPermission, + UsageUnit, + Services, + SignedResourceTypes, + Permissions, + HttpProtocol, + SignedResource, + EncryptionScopeSource, + EncryptionScopeState, + PublicAccess, + LeaseStatus, + LeaseState, + LeaseDuration, + ImmutabilityPolicyState, + ImmutabilityPolicyUpdateType, + EnabledProtocols, + RootSquashType, + ShareAccessTier, + StorageAccountExpand, + ListKeyExpand, + ListContainersInclude, + ListSharesExpand, + GetShareExpand, +) + +__all__ = [ + 'AccountSasParameters', + 'ActiveDirectoryProperties', + 'AzureEntityResource', + 'AzureFilesIdentityBasedAuthentication', + 'BlobContainer', + 'BlobRestoreParameters', + 'BlobRestoreRange', + 'BlobRestoreStatus', + 'BlobServiceProperties', + 'ChangeFeed', + 'CheckNameAvailabilityResult', + 'CorsRule', + 'CorsRules', + 'CustomDomain', + 'DateAfterCreation', + 'DateAfterModification', + 'DeletedAccount', + 'DeletedShare', + 'DeleteRetentionPolicy', + 'Dimension', + 'Encryption', + 'EncryptionScope', + 'EncryptionScopeKeyVaultProperties', + 'EncryptionService', + 'EncryptionServices', + 'Endpoints', + 'ErrorResponse', 'ErrorResponseException', + 'ErrorResponseBody', + 'FileServiceItems', + 'FileServiceProperties', + 'FileShare', + 'FileShareItem', + 'GeoReplicationStats', + 'Identity', + 'ImmutabilityPolicy', + 'ImmutabilityPolicyProperties', + 'IPRule', + 'KeyVaultProperties', + 'LeaseContainerRequest', + 'LeaseContainerResponse', + 'LegalHold', + 'LegalHoldProperties', + 'ListAccountSasResponse', + 'ListContainerItem', + 'ListQueue', + 'ListQueueServices', + 'ListServiceSasResponse', + 'ListTableServices', + 'ManagementPolicy', + 'ManagementPolicyAction', + 'ManagementPolicyBaseBlob', + 'ManagementPolicyDefinition', + 'ManagementPolicyFilter', + 'ManagementPolicyRule', + 'ManagementPolicySchema', + 'ManagementPolicySnapShot', + 'MetricSpecification', + 'NetworkRuleSet', + 'ObjectReplicationPolicy', + 'ObjectReplicationPolicyFilter', + 'ObjectReplicationPolicyRule', + 'Operation', + 'OperationDisplay', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'ProxyResource', + 'QueueServiceProperties', + 'Resource', + 'ResourceAccessRule', + 'RestorePolicyProperties', + 'Restriction', + 'RoutingPreference', + 'ServiceSasParameters', + 'ServiceSpecification', + 'Sku', + 'SKUCapability', + 'SkuInformation', + 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', + 'StorageAccountInternetEndpoints', + 'StorageAccountKey', + 'StorageAccountListKeysResult', + 'StorageAccountMicrosoftEndpoints', + 'StorageAccountRegenerateKeyParameters', + 'StorageAccountUpdateParameters', + 'StorageQueue', + 'Table', + 'TableServiceProperties', + 'TagFilter', + 'TagProperty', + 'TrackedResource', + 'UpdateHistoryProperty', + 'Usage', + 'UsageName', + 'VirtualNetworkRule', + 'OperationPaged', + 'SkuInformationPaged', + 'StorageAccountPaged', + 'DeletedAccountPaged', + 'UsagePaged', + 'PrivateEndpointConnectionPaged', + 'ObjectReplicationPolicyPaged', + 'EncryptionScopePaged', + 'BlobServicePropertiesPaged', + 'ListContainerItemPaged', + 'FileShareItemPaged', + 'ListQueuePaged', + 'TablePaged', + 'ReasonCode', + 'SkuName', + 'SkuTier', + 'Kind', + 'Reason', + 'KeyType', + 'KeySource', + 'Action', + 'State', + 'Bypass', + 'DefaultAction', + 'DirectoryServiceOptions', + 'AccessTier', + 'LargeFileSharesState', + 'RoutingChoice', + 'MinimumTlsVersion', + 'GeoReplicationStatus', + 'BlobRestoreProgressStatus', + 'ProvisioningState', + 'AccountStatus', + 'PrivateEndpointServiceConnectionStatus', + 'PrivateEndpointConnectionProvisioningState', + 'KeyPermission', + 'UsageUnit', + 'Services', + 'SignedResourceTypes', + 'Permissions', + 'HttpProtocol', + 'SignedResource', + 'EncryptionScopeSource', + 'EncryptionScopeState', + 'PublicAccess', + 'LeaseStatus', + 'LeaseState', + 'LeaseDuration', + 'ImmutabilityPolicyState', + 'ImmutabilityPolicyUpdateType', + 'EnabledProtocols', + 'RootSquashType', + 'ShareAccessTier', + 'StorageAccountExpand', + 'ListKeyExpand', + 'ListContainersInclude', + 'ListSharesExpand', + 'GetShareExpand', +] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models.py new file mode 100644 index 000000000000..964a7cba8916 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models.py @@ -0,0 +1,4437 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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) + + +class ActiveDirectoryProperties(Model): + """Settings properties for Active Directory (AD). + + All required parameters must be populated in order to send to Azure. + + :param domain_name: Required. Specifies the primary domain that the AD DNS + server is authoritative for. + :type domain_name: str + :param net_bios_domain_name: Required. Specifies the NetBIOS domain name. + :type net_bios_domain_name: str + :param forest_name: Required. Specifies the Active Directory forest to + get. + :type forest_name: str + :param domain_guid: Required. Specifies the domain GUID. + :type domain_guid: str + :param domain_sid: Required. Specifies the security identifier (SID). + :type domain_sid: str + :param azure_storage_sid: Required. Specifies the security identifier + (SID) for Azure Storage. + :type azure_storage_sid: str + """ + + _validation = { + 'domain_name': {'required': True}, + 'net_bios_domain_name': {'required': True}, + 'forest_name': {'required': True}, + 'domain_guid': {'required': True}, + 'domain_sid': {'required': True}, + 'azure_storage_sid': {'required': True}, + } + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'net_bios_domain_name': {'key': 'netBiosDomainName', 'type': 'str'}, + 'forest_name': {'key': 'forestName', 'type': 'str'}, + 'domain_guid': {'key': 'domainGuid', 'type': 'str'}, + 'domain_sid': {'key': 'domainSid', 'type': 'str'}, + 'azure_storage_sid': {'key': 'azureStorageSid', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ActiveDirectoryProperties, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.net_bios_domain_name = kwargs.get('net_bios_domain_name', None) + self.forest_name = kwargs.get('forest_name', None) + self.domain_guid = kwargs.get('domain_guid', None) + self.domain_sid = kwargs.get('domain_sid', None) + self.azure_storage_sid = kwargs.get('azure_storage_sid', None) + + +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 + + +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 + + +class AzureFilesIdentityBasedAuthentication(Model): + """Settings for Azure Files identity based authentication. + + All required parameters must be populated in order to send to Azure. + + :param directory_service_options: Required. Indicates the directory + service used. Possible values include: 'None', 'AADDS', 'AD' + :type directory_service_options: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.DirectoryServiceOptions + :param active_directory_properties: Required if choose AD. + :type active_directory_properties: + ~azure.mgmt.storage.v2020_08_01_preview.models.ActiveDirectoryProperties + """ + + _validation = { + 'directory_service_options': {'required': True}, + } + + _attribute_map = { + 'directory_service_options': {'key': 'directoryServiceOptions', 'type': 'str'}, + 'active_directory_properties': {'key': 'activeDirectoryProperties', 'type': 'ActiveDirectoryProperties'}, + } + + def __init__(self, **kwargs): + super(AzureFilesIdentityBasedAuthentication, self).__init__(**kwargs) + self.directory_service_options = kwargs.get('directory_service_options', None) + self.active_directory_properties = kwargs.get('active_directory_properties', None) + + +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 + :ivar version: The version of the deleted blob container. + :vartype version: str + :ivar deleted: Indicates whether the blob container was deleted. + :vartype deleted: bool + :ivar deleted_time: Blob container deletion time. + :vartype deleted_time: datetime + :ivar remaining_retention_days: Remaining retention days for soft deleted + blob container. + :vartype remaining_retention_days: int + :param default_encryption_scope: Default the container to use specified + encryption scope for all writes. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Block override of encryption scope + from the container default. + :type deny_encryption_scope_override: bool + :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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2020_08_01_preview.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}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'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'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'default_encryption_scope': {'key': 'properties.defaultEncryptionScope', 'type': 'str'}, + 'deny_encryption_scope_override': {'key': 'properties.denyEncryptionScopeOverride', 'type': 'bool'}, + '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.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.default_encryption_scope = kwargs.get('default_encryption_scope', None) + self.deny_encryption_scope_override = kwargs.get('deny_encryption_scope_override', None) + 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 + + +class BlobRestoreParameters(Model): + """Blob restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param time_to_restore: Required. Restore blob to the specified time. + :type time_to_restore: datetime + :param blob_ranges: Required. Blob ranges to restore. + :type blob_ranges: + list[~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreRange] + """ + + _validation = { + 'time_to_restore': {'required': True}, + 'blob_ranges': {'required': True}, + } + + _attribute_map = { + 'time_to_restore': {'key': 'timeToRestore', 'type': 'iso-8601'}, + 'blob_ranges': {'key': 'blobRanges', 'type': '[BlobRestoreRange]'}, + } + + def __init__(self, **kwargs): + super(BlobRestoreParameters, self).__init__(**kwargs) + self.time_to_restore = kwargs.get('time_to_restore', None) + self.blob_ranges = kwargs.get('blob_ranges', None) + + +class BlobRestoreRange(Model): + """Blob range. + + All required parameters must be populated in order to send to Azure. + + :param start_range: Required. Blob start range. This is inclusive. Empty + means account start. + :type start_range: str + :param end_range: Required. Blob end range. This is exclusive. Empty means + account end. + :type end_range: str + """ + + _validation = { + 'start_range': {'required': True}, + 'end_range': {'required': True}, + } + + _attribute_map = { + 'start_range': {'key': 'startRange', 'type': 'str'}, + 'end_range': {'key': 'endRange', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BlobRestoreRange, self).__init__(**kwargs) + self.start_range = kwargs.get('start_range', None) + self.end_range = kwargs.get('end_range', None) + + +class BlobRestoreStatus(Model): + """Blob restore status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of blob restore progress. Possible values are: - + InProgress: Indicates that blob restore is ongoing. - Complete: Indicates + that blob restore has been completed successfully. - Failed: Indicates + that blob restore is failed. Possible values include: 'InProgress', + 'Complete', 'Failed' + :vartype status: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreProgressStatus + :ivar failure_reason: Failure reason when blob restore is failed. + :vartype failure_reason: str + :ivar restore_id: Id for tracking blob restore request. + :vartype restore_id: str + :ivar parameters: Blob restore request parameters. + :vartype parameters: + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreParameters + """ + + _validation = { + 'status': {'readonly': True}, + 'failure_reason': {'readonly': True}, + 'restore_id': {'readonly': True}, + 'parameters': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + 'restore_id': {'key': 'restoreId', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'BlobRestoreParameters'}, + } + + def __init__(self, **kwargs): + super(BlobRestoreStatus, self).__init__(**kwargs) + self.status = None + self.failure_reason = None + self.restore_id = None + self.parameters = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + 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 cors: Specifies CORS rules for the Blob service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the + default version to use for requests to the Blob service if an incoming + request’s version is not specified. Possible values include version + 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for blob soft + delete. + :type delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :param is_versioning_enabled: Versioning is enabled if set to true. + :type is_versioning_enabled: bool + :param automatic_snapshot_policy_enabled: Deprecated in favor of + isVersioningEnabled property. + :type automatic_snapshot_policy_enabled: bool + :param change_feed: The blob service properties for change feed events. + :type change_feed: + ~azure.mgmt.storage.v2020_08_01_preview.models.ChangeFeed + :param restore_policy: The blob service properties for blob restore + policy. + :type restore_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.RestorePolicyProperties + :param container_delete_retention_policy: The blob service properties for + container soft delete. + :type container_delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'is_versioning_enabled': {'key': 'properties.isVersioningEnabled', 'type': 'bool'}, + 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, + 'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'}, + 'restore_policy': {'key': 'properties.restorePolicy', 'type': 'RestorePolicyProperties'}, + 'container_delete_retention_policy': {'key': 'properties.containerDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(BlobServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + self.default_service_version = kwargs.get('default_service_version', None) + self.delete_retention_policy = kwargs.get('delete_retention_policy', None) + self.is_versioning_enabled = kwargs.get('is_versioning_enabled', None) + self.automatic_snapshot_policy_enabled = kwargs.get('automatic_snapshot_policy_enabled', None) + self.change_feed = kwargs.get('change_feed', None) + self.restore_policy = kwargs.get('restore_policy', None) + self.container_delete_retention_policy = kwargs.get('container_delete_retention_policy', None) + self.sku = None + + +class ChangeFeed(Model): + """The blob service properties for change feed events. + + :param enabled: Indicates whether change feed event logging is enabled for + the Blob service. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ChangeFeed, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + + +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.v2020_08_01_preview.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 + + +class CloudError(Model): + """An error response from the Storage service. + + :param error: + :type error: ~azure.mgmt.storage.v2020_08_01_preview.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the Storage service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.storage.v2020_08_01_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class CorsRule(Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. + A list of origin domains that will be allowed via CORS, or "*" to allow + all domains + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. + A list of HTTP methods that are allowed to be executed by the origin. + :type allowed_methods: list[str] + :param max_age_in_seconds: Required. Required if CorsRule element is + present. The number of seconds that the client/browser should cache a + preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. + A list of response headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. + A list of headers allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = kwargs.get('allowed_origins', None) + self.allowed_methods = kwargs.get('allowed_methods', None) + self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None) + self.exposed_headers = kwargs.get('exposed_headers', None) + self.allowed_headers = kwargs.get('allowed_headers', None) + + +class CorsRules(Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the + request. . + + :param cors_rules: The List of CORS rules. You can include up to five + CorsRule elements in the request. + :type cors_rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__(self, **kwargs): + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = kwargs.get('cors_rules', None) + + +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_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class DateAfterCreation(Model): + """Object to define the number of days after creation. + + All required parameters must be populated in order to send to Azure. + + :param days_after_creation_greater_than: Required. Value indicating the + age in days after creation + :type days_after_creation_greater_than: float + """ + + _validation = { + 'days_after_creation_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(DateAfterCreation, self).__init__(**kwargs) + self.days_after_creation_greater_than = kwargs.get('days_after_creation_greater_than', None) + + +class DateAfterModification(Model): + """Object to define the number of days after last modification. + + All required parameters must be populated in order to send to Azure. + + :param days_after_modification_greater_than: Required. Value indicating + the age in days after last modification + :type days_after_modification_greater_than: float + """ + + _validation = { + 'days_after_modification_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(DateAfterModification, self).__init__(**kwargs) + self.days_after_modification_greater_than = kwargs.get('days_after_modification_greater_than', None) + + +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) + + +class DeletedAccount(ProxyResource): + """Deleted storage account. + + 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 storage_account_resource_id: Full resource id of the original + storage account. + :vartype storage_account_resource_id: str + :ivar location: Location of the deleted account. + :vartype location: str + :ivar restore_reference: Can be used to attempt recovering this deleted + account via PutStorageAccount API. + :vartype restore_reference: str + :ivar creation_time: Creation time of the deleted account. + :vartype creation_time: str + :ivar deletion_time: Deletion time of the deleted account. + :vartype deletion_time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'storage_account_resource_id': {'readonly': True}, + 'location': {'readonly': True}, + 'restore_reference': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'deletion_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'restore_reference': {'key': 'properties.restoreReference', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'deletion_time': {'key': 'properties.deletionTime', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeletedAccount, self).__init__(**kwargs) + self.storage_account_resource_id = None + self.location = None + self.restore_reference = None + self.creation_time = None + self.deletion_time = None + + +class DeletedShare(Model): + """The deleted share to be restored. + + All required parameters must be populated in order to send to Azure. + + :param deleted_share_name: Required. Required. Identify the name of the + deleted share that will be restored. + :type deleted_share_name: str + :param deleted_share_version: Required. Required. Identify the version of + the deleted share that will be restored. + :type deleted_share_version: str + """ + + _validation = { + 'deleted_share_name': {'required': True}, + 'deleted_share_version': {'required': True}, + } + + _attribute_map = { + 'deleted_share_name': {'key': 'deletedShareName', 'type': 'str'}, + 'deleted_share_version': {'key': 'deletedShareVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeletedShare, self).__init__(**kwargs) + self.deleted_share_name = kwargs.get('deleted_share_name', None) + self.deleted_share_version = kwargs.get('deleted_share_version', None) + + +class DeleteRetentionPolicy(Model): + """The service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled. + :type enabled: bool + :param days: Indicates the number of days that the deleted item should be + retained. The minimum specified value can be 1 and the maximum value can + be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.days = kwargs.get('days', None) + + +class Dimension(Model): + """Dimension of blobs, possibly 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) + + +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.v2020_08_01_preview.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.v2020_08_01_preview.models.KeySource + :param require_infrastructure_encryption: A boolean indicating whether or + not the service applies a secondary layer of encryption with platform + managed keys for data at rest. + :type require_infrastructure_encryption: bool + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2020_08_01_preview.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'require_infrastructure_encryption': {'key': 'requireInfrastructureEncryption', 'type': 'bool'}, + '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.require_infrastructure_encryption = kwargs.get('require_infrastructure_encryption', None) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionScope(Resource): + """The Encryption Scope 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 + :param source: The provider for the encryption scope. Possible values + (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible + values include: 'Microsoft.Storage', 'Microsoft.KeyVault' + :type source: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeSource + :param state: The state of the encryption scope. Possible values + (case-insensitive): Enabled, Disabled. Possible values include: + 'Enabled', 'Disabled' + :type state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeState + :ivar creation_time: Gets the creation date and time of the encryption + scope in UTC. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modification date and time of the + encryption scope in UTC. + :vartype last_modified_time: datetime + :param key_vault_properties: The key vault properties for the encryption + scope. This is a required field if encryption scope 'source' attribute is + set to 'Microsoft.KeyVault'. + :type key_vault_properties: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeKeyVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'EncryptionScopeKeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(EncryptionScope, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.creation_time = None + self.last_modified_time = None + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionScopeKeyVaultProperties(Model): + """The key vault properties for the encryption scope. This is a required field + if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + + :param key_uri: The object identifier for a key vault key object. When + applied, the encryption scope will use the key referenced by the + identifier to enable customer-managed key support on this encryption + scope. + :type key_uri: str + """ + + _attribute_map = { + 'key_uri': {'key': 'keyUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EncryptionScopeKeyVaultProperties, self).__init__(**kwargs) + self.key_uri = kwargs.get('key_uri', None) + + +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 + :param key_type: Encryption key type to be used for the encryption + service. 'Account' key type implies that an account-scoped encryption key + will be used. 'Service' key type implies that a default service key is + used. Possible values include: 'Service', 'Account' + :type key_type: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.KeyType + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + self.key_type = kwargs.get('key_type', None) + + +class EncryptionServices(Model): + """A list of services that support encryption. + + :param blob: The encryption function of the blob storage service. + :type blob: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + :param table: The encryption function of the table storage service. + :type table: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + :param queue: The encryption function of the queue storage service. + :type queue: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + """ + + _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 = kwargs.get('table', None) + self.queue = kwargs.get('queue', None) + + +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 + :param microsoft_endpoints: Gets the microsoft routing storage endpoints. + :type microsoft_endpoints: + ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountMicrosoftEndpoints + :param internet_endpoints: Gets the internet routing storage endpoints + :type internet_endpoints: + ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountInternetEndpoints + """ + + _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'}, + 'microsoft_endpoints': {'key': 'microsoftEndpoints', 'type': 'StorageAccountMicrosoftEndpoints'}, + 'internet_endpoints': {'key': 'internetEndpoints', 'type': 'StorageAccountInternetEndpoints'}, + } + + 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 + self.microsoft_endpoints = kwargs.get('microsoft_endpoints', None) + self.internet_endpoints = kwargs.get('internet_endpoints', None) + + +class ErrorResponse(Model): + """An error response from the storage resource provider. + + :param error: Azure Storage Resource Provider error response body. + :type error: + ~azure.mgmt.storage.v2020_08_01_preview.models.ErrorResponseBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ErrorResponseBody(Model): + """Error response body contract. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class FileServiceItems(Model): + """FileServiceItems. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of file services returned. + :vartype value: + list[~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileServiceProperties]'}, + } + + def __init__(self, **kwargs): + super(FileServiceItems, self).__init__(**kwargs) + self.value = None + + +class FileServiceProperties(Resource): + """The properties of File services in storage account. + + 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 cors: Specifies CORS rules for the File service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the File service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + :param share_delete_retention_policy: The file service properties for + share soft delete. + :type share_delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'share_delete_retention_policy': {'key': 'properties.shareDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(FileServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + self.share_delete_retention_policy = kwargs.get('share_delete_retention_policy', None) + self.sku = None + + +class FileShare(AzureEntityResource): + """Properties of the file share, 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 + :ivar last_modified_time: Returns the date and time the share was last + modified. + :vartype last_modified_time: datetime + :param metadata: A name-value pair to associate with the share as + metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be + greater than 0, and less than or equal to 5TB (5120). For Large File + Shares, the maximum size is 102400. + :type share_quota: int + :param enabled_protocols: The authentication protocol that is used for the + file share. Can only be specified when creating a share. Possible values + include: 'SMB', 'NFS' + :type enabled_protocols: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.EnabledProtocols + :param root_squash: The property is for NFS share only. The default is + NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', + 'AllSquash' + :type root_squash: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.RootSquashType + :ivar version: The version of the share. + :vartype version: str + :ivar deleted: Indicates whether the share was deleted. + :vartype deleted: bool + :ivar deleted_time: The deleted time if the share was deleted. + :vartype deleted_time: datetime + :ivar remaining_retention_days: Remaining retention days for share that + was soft deleted. + :vartype remaining_retention_days: int + :param access_tier: Access tier for specific share. GpV2 account can + choose between TransactionOptimized (default), Hot, and Cool. FileStorage + account can choose Premium. Possible values include: + 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + :type access_tier: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.ShareAccessTier + :ivar access_tier_change_time: Indicates the last modification time for + share access tier. + :vartype access_tier_change_time: datetime + :ivar access_tier_status: Indicates if there is a pending transition for + access tier. + :vartype access_tier_status: str + :ivar share_usage_bytes: The approximate size of the data stored on the + share. Note that this value may not include all recently created or + recently resized files. + :vartype share_usage_bytes: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'access_tier_change_time': {'readonly': True}, + 'access_tier_status': {'readonly': True}, + 'share_usage_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + 'enabled_protocols': {'key': 'properties.enabledProtocols', 'type': 'str'}, + 'root_squash': {'key': 'properties.rootSquash', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'access_tier_change_time': {'key': 'properties.accessTierChangeTime', 'type': 'iso-8601'}, + 'access_tier_status': {'key': 'properties.accessTierStatus', 'type': 'str'}, + 'share_usage_bytes': {'key': 'properties.shareUsageBytes', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(FileShare, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = kwargs.get('metadata', None) + self.share_quota = kwargs.get('share_quota', None) + self.enabled_protocols = kwargs.get('enabled_protocols', None) + self.root_squash = kwargs.get('root_squash', None) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.access_tier = kwargs.get('access_tier', None) + self.access_tier_change_time = None + self.access_tier_status = None + self.share_usage_bytes = None + + +class FileShareItem(AzureEntityResource): + """The file share 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 + :ivar last_modified_time: Returns the date and time the share was last + modified. + :vartype last_modified_time: datetime + :param metadata: A name-value pair to associate with the share as + metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be + greater than 0, and less than or equal to 5TB (5120). For Large File + Shares, the maximum size is 102400. + :type share_quota: int + :param enabled_protocols: The authentication protocol that is used for the + file share. Can only be specified when creating a share. Possible values + include: 'SMB', 'NFS' + :type enabled_protocols: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.EnabledProtocols + :param root_squash: The property is for NFS share only. The default is + NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', + 'AllSquash' + :type root_squash: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.RootSquashType + :ivar version: The version of the share. + :vartype version: str + :ivar deleted: Indicates whether the share was deleted. + :vartype deleted: bool + :ivar deleted_time: The deleted time if the share was deleted. + :vartype deleted_time: datetime + :ivar remaining_retention_days: Remaining retention days for share that + was soft deleted. + :vartype remaining_retention_days: int + :param access_tier: Access tier for specific share. GpV2 account can + choose between TransactionOptimized (default), Hot, and Cool. FileStorage + account can choose Premium. Possible values include: + 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + :type access_tier: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.ShareAccessTier + :ivar access_tier_change_time: Indicates the last modification time for + share access tier. + :vartype access_tier_change_time: datetime + :ivar access_tier_status: Indicates if there is a pending transition for + access tier. + :vartype access_tier_status: str + :ivar share_usage_bytes: The approximate size of the data stored on the + share. Note that this value may not include all recently created or + recently resized files. + :vartype share_usage_bytes: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'access_tier_change_time': {'readonly': True}, + 'access_tier_status': {'readonly': True}, + 'share_usage_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + 'enabled_protocols': {'key': 'properties.enabledProtocols', 'type': 'str'}, + 'root_squash': {'key': 'properties.rootSquash', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'access_tier_change_time': {'key': 'properties.accessTierChangeTime', 'type': 'iso-8601'}, + 'access_tier_status': {'key': 'properties.accessTierStatus', 'type': 'str'}, + 'share_usage_bytes': {'key': 'properties.shareUsageBytes', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(FileShareItem, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = kwargs.get('metadata', None) + self.share_quota = kwargs.get('share_quota', None) + self.enabled_protocols = kwargs.get('enabled_protocols', None) + self.root_squash = kwargs.get('root_squash', None) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.access_tier = kwargs.get('access_tier', None) + self.access_tier_change_time = None + self.access_tier_status = None + self.share_usage_bytes = None + + +class GeoReplicationStats(Model): + """Statistics related to replication for storage account's Blob, Table, Queue + and File services. It is only available when geo-redundant replication is + enabled for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of the secondary location. Possible values are: - + Live: Indicates that the secondary location is active and operational. - + Bootstrap: Indicates initial synchronization from the primary location to + the secondary location is in progress.This typically occurs when + replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: 'Live', + 'Bootstrap', 'Unavailable' + :vartype status: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time + value are guaranteed to be available for read operations. Primary writes + following this point in time may or may not be available for reads. + Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: datetime + :ivar can_failover: A boolean flag which indicates whether or not account + failover is supported for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +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 + + +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. + + :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: 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.v2020_08_01_preview.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed + for unlocked time-based retention policies. When enabled, new blocks can + be written to an append blob while maintaining immutability protection and + compliance. Only new blocks can be added and any existing blocks cannot be + modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': 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'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + } + + 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 + self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None) + + +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. + + :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 + :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.v2020_08_01_preview.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed + for unlocked time-based retention policies. When enabled, new blocks can + be written to an append blob while maintaining immutability protection and + compliance. Only new blocks can be added and any existing blocks cannot be + modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool + :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.v2020_08_01_preview.models.UpdateHistoryProperty] + """ + + _validation = { + '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'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + '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.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None) + self.etag = None + self.update_history = None + + +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.v2020_08_01_preview.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") + + +class KeyVaultProperties(Model): + """Properties of key vault. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + :ivar current_versioned_key_identifier: The object identifier of the + current versioned Key Vault Key in use. + :vartype current_versioned_key_identifier: str + :ivar last_key_rotation_timestamp: Timestamp of last rotation of the Key + Vault Key. + :vartype last_key_rotation_timestamp: datetime + """ + + _validation = { + 'current_versioned_key_identifier': {'readonly': True}, + 'last_key_rotation_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + 'current_versioned_key_identifier': {'key': 'currentVersionedKeyIdentifier', 'type': 'str'}, + 'last_key_rotation_timestamp': {'key': 'lastKeyRotationTimestamp', 'type': 'iso-8601'}, + } + + 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) + self.current_versioned_key_identifier = None + self.last_key_rotation_timestamp = None + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2020_08_01_preview.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = kwargs.get('action', None) + self.lease_id = kwargs.get('lease_id', None) + self.break_period = kwargs.get('break_period', None) + self.lease_duration = kwargs.get('lease_duration', None) + self.proposed_lease_id = kwargs.get('proposed_lease_id', None) + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = kwargs.get('lease_id', None) + self.lease_time_seconds = kwargs.get('lease_time_seconds', None) + + +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) + + +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.v2020_08_01_preview.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) + + +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 + + +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 + :ivar version: The version of the deleted blob container. + :vartype version: str + :ivar deleted: Indicates whether the blob container was deleted. + :vartype deleted: bool + :ivar deleted_time: Blob container deletion time. + :vartype deleted_time: datetime + :ivar remaining_retention_days: Remaining retention days for soft deleted + blob container. + :vartype remaining_retention_days: int + :param default_encryption_scope: Default the container to use specified + encryption scope for all writes. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Block override of encryption scope + from the container default. + :type deny_encryption_scope_override: bool + :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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2020_08_01_preview.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}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'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'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'default_encryption_scope': {'key': 'properties.defaultEncryptionScope', 'type': 'str'}, + 'deny_encryption_scope_override': {'key': 'properties.denyEncryptionScopeOverride', 'type': 'bool'}, + '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.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.default_encryption_scope = kwargs.get('default_encryption_scope', None) + self.deny_encryption_scope_override = kwargs.get('deny_encryption_scope_override', None) + 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 + + +class ListQueue(Resource): + """ListQueue. + + 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 metadata: A name-value pair that represents queue metadata. + :type metadata: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ListQueue, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) + + +class ListQueueServices(Model): + """ListQueueServices. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of queue services returned. + :vartype value: + list[~azure.mgmt.storage.v2020_08_01_preview.models.QueueServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QueueServiceProperties]'}, + } + + def __init__(self, **kwargs): + super(ListQueueServices, self).__init__(**kwargs) + self.value = None + + +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 specific + 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 + + +class ListTableServices(Model): + """ListTableServices. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of table services returned. + :vartype value: + list[~azure.mgmt.storage.v2020_08_01_preview.models.TableServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TableServiceProperties]'}, + } + + def __init__(self, **kwargs): + super(ListTableServices, self).__init__(**kwargs) + self.value = None + + +class ManagementPolicy(Resource): + """The Get Storage Account ManagementPolicies operation response. + + 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 last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + :param policy: Required. The Storage Account ManagementPolicy, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'policy': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicy, self).__init__(**kwargs) + self.last_modified_time = None + self.policy = kwargs.get('policy', None) + + +class ManagementPolicyAction(Model): + """Actions are applied to the filtered blobs when the execution condition is + met. + + :param base_blob: The management policy action for base blob + :type base_blob: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyBaseBlob + :param snapshot: The management policy action for snapshot + :type snapshot: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicySnapShot + """ + + _attribute_map = { + 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, + 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyAction, self).__init__(**kwargs) + self.base_blob = kwargs.get('base_blob', None) + self.snapshot = kwargs.get('snapshot', None) + + +class ManagementPolicyBaseBlob(Model): + """Management policy action for base blob. + + :param tier_to_cool: The function to tier blobs to cool storage. Support + blobs currently at Hot tier + :type tier_to_cool: + ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterModification + :param tier_to_archive: The function to tier blobs to archive storage. + Support blobs currently at Hot or Cool tier + :type tier_to_archive: + ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterModification + :param delete: The function to delete the blob + :type delete: + ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterModification + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, + 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyBaseBlob, self).__init__(**kwargs) + self.tier_to_cool = kwargs.get('tier_to_cool', None) + self.tier_to_archive = kwargs.get('tier_to_archive', None) + self.delete = kwargs.get('delete', None) + + +class ManagementPolicyDefinition(Model): + """An object that defines the Lifecycle rule. Each definition is made up with + a filters set and an actions set. + + All required parameters must be populated in order to send to Azure. + + :param actions: Required. An object that defines the action set. + :type actions: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyAction + :param filters: An object that defines the filter set. + :type filters: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyFilter + """ + + _validation = { + 'actions': {'required': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, + 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyDefinition, self).__init__(**kwargs) + self.actions = kwargs.get('actions', None) + self.filters = kwargs.get('filters', None) + + +class ManagementPolicyFilter(Model): + """Filters limit rule actions to a subset of blobs within the storage account. + If multiple filters are defined, a logical AND is performed on all filters. + . + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for prefixes to be match. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Only + blockBlob is supported. + :type blob_types: list[str] + :param blob_index_match: An array of blob index tag based filters, there + can be at most 10 tag filters + :type blob_index_match: + list[~azure.mgmt.storage.v2020_08_01_preview.models.TagFilter] + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + 'blob_index_match': {'key': 'blobIndexMatch', 'type': '[TagFilter]'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyFilter, self).__init__(**kwargs) + self.prefix_match = kwargs.get('prefix_match', None) + self.blob_types = kwargs.get('blob_types', None) + self.blob_index_match = kwargs.get('blob_index_match', None) + + +class ManagementPolicyRule(Model): + """An object that wraps the Lifecycle rule. Each rule is uniquely defined by + 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 enabled: Rule is enabled if set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha + numeric characters. Rule name is case-sensitive. It must be unique within + a policy. + :type name: str + :ivar type: Required. The valid value is Lifecycle. Default value: + "Lifecycle" . + :vartype type: str + :param definition: Required. An object that defines the Lifecycle rule. + :type definition: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyDefinition + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, + } + + type = "Lifecycle" + + def __init__(self, **kwargs): + super(ManagementPolicyRule, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.name = kwargs.get('name', None) + self.definition = kwargs.get('definition', None) + + +class ManagementPolicySchema(Model): + """The Storage Account ManagementPolicies Rules. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + All required parameters must be populated in order to send to Azure. + + :param rules: Required. The Storage Account ManagementPolicies Rules. See + more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicySchema, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + + +class ManagementPolicySnapShot(Model): + """Management policy action for snapshot. + + :param delete: The function to delete the blob snapshot + :type delete: + ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterCreation + """ + + _attribute_map = { + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicySnapShot, self).__init__(**kwargs) + self.delete = kwargs.get('delete', None) + + +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.v2020_08_01_preview.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) + + +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.v2020_08_01_preview.models.Bypass + :param resource_access_rules: + :type resource_access_rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.ResourceAccessRule] + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: + list[~azure.mgmt.storage.v2020_08_01_preview.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.v2020_08_01_preview.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'resource_access_rules': {'key': 'resourceAccessRules', 'type': '[ResourceAccessRule]'}, + '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.resource_access_rules = kwargs.get('resource_access_rules', None) + 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") + + +class ObjectReplicationPolicy(Resource): + """The replication policy between two storage accounts. Multiple rules can be + defined in one policy. + + 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 policy_id: A unique id for object replication policy. + :vartype policy_id: str + :ivar enabled_time: Indicates when the policy is enabled on the source + account. + :vartype enabled_time: datetime + :param source_account: Required. Required. Source account name. + :type source_account: str + :param destination_account: Required. Required. Destination account name. + :type destination_account: str + :param rules: The storage account object replication rules. + :type rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicyRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_id': {'readonly': True}, + 'enabled_time': {'readonly': True}, + 'source_account': {'required': True}, + 'destination_account': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy_id': {'key': 'properties.policyId', 'type': 'str'}, + 'enabled_time': {'key': 'properties.enabledTime', 'type': 'iso-8601'}, + 'source_account': {'key': 'properties.sourceAccount', 'type': 'str'}, + 'destination_account': {'key': 'properties.destinationAccount', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[ObjectReplicationPolicyRule]'}, + } + + def __init__(self, **kwargs): + super(ObjectReplicationPolicy, self).__init__(**kwargs) + self.policy_id = None + self.enabled_time = None + self.source_account = kwargs.get('source_account', None) + self.destination_account = kwargs.get('destination_account', None) + self.rules = kwargs.get('rules', None) + + +class ObjectReplicationPolicyFilter(Model): + """Filters limit replication to a subset of blobs within the storage account. + A logical OR is performed on values in the filter. If multiple filters are + defined, a logical AND is performed on all filters. + + :param prefix_match: Optional. Filters the results to replicate only blobs + whose names begin with the specified prefix. + :type prefix_match: list[str] + :param min_creation_time: Blobs created after the time will be replicated + to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. + Example: 2020-02-19T16:05:00Z + :type min_creation_time: str + """ + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'min_creation_time': {'key': 'minCreationTime', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ObjectReplicationPolicyFilter, self).__init__(**kwargs) + self.prefix_match = kwargs.get('prefix_match', None) + self.min_creation_time = kwargs.get('min_creation_time', None) + + +class ObjectReplicationPolicyRule(Model): + """The replication policy rule between two containers. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Rule Id is auto-generated for each new rule on destination + account. It is required for put policy on source account. + :type rule_id: str + :param source_container: Required. Required. Source container name. + :type source_container: str + :param destination_container: Required. Required. Destination container + name. + :type destination_container: str + :param filters: Optional. An object that defines the filter set. + :type filters: + ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicyFilter + """ + + _validation = { + 'source_container': {'required': True}, + 'destination_container': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'source_container': {'key': 'sourceContainer', 'type': 'str'}, + 'destination_container': {'key': 'destinationContainer', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': 'ObjectReplicationPolicyFilter'}, + } + + def __init__(self, **kwargs): + super(ObjectReplicationPolicyRule, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.source_container = kwargs.get('source_container', None) + self.destination_container = kwargs.get('destination_container', None) + self.filters = kwargs.get('filters', None) + + +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.v2020_08_01_preview.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.v2020_08_01_preview.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) + + +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) + + +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection 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 private_endpoint: The resource of private end point. + :type private_endpoint: + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class PrivateLinkResource(Resource): + """A private link 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 + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS + zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkResourceListResult(Model): + """A list of private link resources. + + :param value: Array of private link resources + :type value: + list[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param action_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type action_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.action_required = kwargs.get('action_required', None) + + +class QueueServiceProperties(Resource): + """The properties of a storage account’s Queue service. + + 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 cors: Specifies CORS rules for the Queue service. You can include + up to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Queue service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + """ + + _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'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + } + + def __init__(self, **kwargs): + super(QueueServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + + +class ResourceAccessRule(Model): + """Resource Access Rule. + + :param tenant_id: Tenant Id + :type tenant_id: str + :param resource_id: Resource Id + :type resource_id: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceAccessRule, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.resource_id = kwargs.get('resource_id', None) + + +class RestorePolicyProperties(Model): + """The blob service properties for blob restore policy. + + 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 enabled: Required. Blob restore is enabled if set to true. + :type enabled: bool + :param days: how long this blob can be restored. It should be great than + zero and less than DeleteRetentionPolicy.days. + :type days: int + :ivar last_enabled_time: Deprecated in favor of minRestoreTime property. + :vartype last_enabled_time: datetime + :ivar min_restore_time: Returns the minimum date and time that the restore + can be started. + :vartype min_restore_time: datetime + """ + + _validation = { + 'enabled': {'required': True}, + 'days': {'maximum': 365, 'minimum': 1}, + 'last_enabled_time': {'readonly': True}, + 'min_restore_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'min_restore_time': {'key': 'minRestoreTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(RestorePolicyProperties, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.days = kwargs.get('days', None) + self.last_enabled_time = None + self.min_restore_time = None + + +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.v2020_08_01_preview.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) + + +class RoutingPreference(Model): + """Routing preference defines the type of network, either microsoft or + internet routing to be used to deliver the user data, the default option is + microsoft routing. + + :param routing_choice: Routing Choice defines the kind of network routing + opted by the user. Possible values include: 'MicrosoftRouting', + 'InternetRouting' + :type routing_choice: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingChoice + :param publish_microsoft_endpoints: A boolean flag which indicates whether + microsoft routing storage endpoints are to be published + :type publish_microsoft_endpoints: bool + :param publish_internet_endpoints: A boolean flag which indicates whether + internet routing storage endpoints are to be published + :type publish_internet_endpoints: bool + """ + + _attribute_map = { + 'routing_choice': {'key': 'routingChoice', 'type': 'str'}, + 'publish_microsoft_endpoints': {'key': 'publishMicrosoftEndpoints', 'type': 'bool'}, + 'publish_internet_endpoints': {'key': 'publishInternetEndpoints', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(RoutingPreference, self).__init__(**kwargs) + self.routing_choice = kwargs.get('routing_choice', None) + self.publish_microsoft_endpoints = kwargs.get('publish_microsoft_endpoints', None) + self.publish_internet_endpoints = kwargs.get('publish_internet_endpoints', None) + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific 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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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) + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2020_08_01_preview.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) + + +class Sku(Model): + """The SKU of the storage account. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' + :type name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuName + :param tier: Possible values include: 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +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 + + +class SkuInformation(Model): + """Storage SKU and its properties. + + 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. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' + :type name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuName + :param tier: Possible values include: 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.storage.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, **kwargs): + super(SkuInformation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +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) + + +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.v2020_08_01_preview.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: + ~azure.mgmt.storage.v2020_08_01_preview.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.v2020_08_01_preview.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2020_08_01_preview.models.AzureFilesIdentityBasedAuthentication + :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.v2020_08_01_preview.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats + :vartype geo_replication_stats: + ~azure.mgmt.storage.v2020_08_01_preview.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will + be true, otherwise, it will be null. + :vartype failover_in_progress: bool + :param large_file_shares_state: Allow large file shares if sets to + Enabled. It cannot be disabled once it is enabled. Possible values + include: 'Disabled', 'Enabled' + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.LargeFileSharesState + :ivar private_endpoint_connections: List of private endpoint connection + associated with the specified storage account + :vartype private_endpoint_connections: + list[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection] + :param routing_preference: Maintains information about the network routing + choice opted by the user for data transfer + :type routing_preference: + ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingPreference + :ivar blob_restore_status: Blob restore status + :vartype blob_restore_status: + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreStatus + :param allow_blob_public_access: Allow or disallow public access to all + blobs or containers in the storage account. The default interpretation is + true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on + requests to storage. The default interpretation is TLS 1.0 for this + property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2' + :type minimum_tls_version: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.MinimumTlsVersion + """ + + _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}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'blob_restore_status': {'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': 'str'}, + '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'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + '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'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'blob_restore_status': {'key': 'properties.blobRestoreStatus', 'type': 'BlobRestoreStatus'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + } + + 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.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', 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) + self.geo_replication_stats = None + self.failover_in_progress = None + self.large_file_shares_state = kwargs.get('large_file_shares_state', None) + self.private_endpoint_connections = None + self.routing_preference = kwargs.get('routing_preference', None) + self.blob_restore_status = None + self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability 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) + + +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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.CustomDomain + :param encryption: Not applicable. Azure Storage encryption is enabled for + all storage accounts and cannot be disabled. + :type encryption: + ~azure.mgmt.storage.v2020_08_01_preview.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2020_08_01_preview.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.v2020_08_01_preview.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2020_08_01_preview.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. The default value is true since API version + 2019-04-01. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :param large_file_shares_state: Allow large file shares if sets to + Enabled. It cannot be disabled once it is enabled. Possible values + include: 'Disabled', 'Enabled' + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing + choice opted by the user for data transfer + :type routing_preference: + ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingPreference + :param allow_blob_public_access: Allow or disallow public access to all + blobs or containers in the storage account. The default interpretation is + true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on + requests to storage. The default interpretation is TLS 1.0 for this + property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2' + :type minimum_tls_version: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.MinimumTlsVersion + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + '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'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + } + + 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.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + self.large_file_shares_state = kwargs.get('large_file_shares_state', None) + self.routing_preference = kwargs.get('routing_preference', None) + self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + + +class StorageAccountInternetEndpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, file, web + or dfs object via a internet routing endpoint. + + 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 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}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountInternetEndpoints, self).__init__(**kwargs) + self.blob = None + self.file = None + self.web = None + self.dfs = None + + +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.v2020_08_01_preview.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 + + +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.v2020_08_01_preview.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 + + +class StorageAccountMicrosoftEndpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object via a microsoft routing endpoint. + + 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(StorageAccountMicrosoftEndpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +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 values are key1, key2, kerb1, kerb2. + :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) + + +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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: + ~azure.mgmt.storage.v2020_08_01_preview.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.v2020_08_01_preview.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2020_08_01_preview.models.AzureFilesIdentityBasedAuthentication + :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.v2020_08_01_preview.models.NetworkRuleSet + :param large_file_shares_state: Allow large file shares if sets to + Enabled. It cannot be disabled once it is enabled. Possible values + include: 'Disabled', 'Enabled' + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing + choice opted by the user for data transfer + :type routing_preference: + ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingPreference + :param allow_blob_public_access: Allow or disallow public access to all + blobs or containers in the storage account. The default interpretation is + true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on + requests to storage. The default interpretation is TLS 1.0 for this + property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2' + :type minimum_tls_version: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.MinimumTlsVersion + :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.v2020_08_01_preview.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'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + 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.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.large_file_shares_state = kwargs.get('large_file_shares_state', None) + self.routing_preference = kwargs.get('routing_preference', None) + self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + self.kind = kwargs.get('kind', None) + + +class StorageQueue(Resource): + """StorageQueue. + + 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 metadata: A name-value pair that represents queue metadata. + :type metadata: dict[str, str] + :ivar approximate_message_count: Integer indicating an approximate number + of messages in the queue. This number is not lower than the actual number + of messages in the queue, but could be higher. + :vartype approximate_message_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'approximate_message_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'approximate_message_count': {'key': 'properties.approximateMessageCount', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(StorageQueue, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) + self.approximate_message_count = None + + +class Table(Resource): + """Properties of the table, including Id, resource name, resource type. + + 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 table_name: Table name under the specified account + :vartype table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'table_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Table, self).__init__(**kwargs) + self.table_name = None + + +class TableServiceProperties(Resource): + """The properties of a storage account’s Table service. + + 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 cors: Specifies CORS rules for the Table service. You can include + up to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Table service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + """ + + _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'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + } + + def __init__(self, **kwargs): + super(TableServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + + +class TagFilter(Model): + """Blob index tag based filtering for blob objects. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. This is the filter tag name, it can have 1 - 128 + characters + :type name: str + :param op: Required. This is the comparison operator which is used for + object comparison and filtering. Only == (equality operator) is currently + supported + :type op: str + :param value: Required. This is the filter tag value field used for tag + based filtering, it can have 0 - 256 characters + :type value: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 128, 'min_length': 1}, + 'op': {'required': True}, + 'value': {'required': True, 'max_length': 256, 'min_length': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'op': {'key': 'op', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagFilter, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.op = kwargs.get('op', None) + self.value = kwargs.get('value', None) + + +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 + + +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.v2020_08_01_preview.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 + + +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.v2020_08_01_preview.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.v2020_08_01_preview.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 + + +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 + + +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.v2020_08_01_preview.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.v2020_08_01_preview.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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..c996621e6e49 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models_py3.py @@ -0,0 +1,4437 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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 + + +class ActiveDirectoryProperties(Model): + """Settings properties for Active Directory (AD). + + All required parameters must be populated in order to send to Azure. + + :param domain_name: Required. Specifies the primary domain that the AD DNS + server is authoritative for. + :type domain_name: str + :param net_bios_domain_name: Required. Specifies the NetBIOS domain name. + :type net_bios_domain_name: str + :param forest_name: Required. Specifies the Active Directory forest to + get. + :type forest_name: str + :param domain_guid: Required. Specifies the domain GUID. + :type domain_guid: str + :param domain_sid: Required. Specifies the security identifier (SID). + :type domain_sid: str + :param azure_storage_sid: Required. Specifies the security identifier + (SID) for Azure Storage. + :type azure_storage_sid: str + """ + + _validation = { + 'domain_name': {'required': True}, + 'net_bios_domain_name': {'required': True}, + 'forest_name': {'required': True}, + 'domain_guid': {'required': True}, + 'domain_sid': {'required': True}, + 'azure_storage_sid': {'required': True}, + } + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'net_bios_domain_name': {'key': 'netBiosDomainName', 'type': 'str'}, + 'forest_name': {'key': 'forestName', 'type': 'str'}, + 'domain_guid': {'key': 'domainGuid', 'type': 'str'}, + 'domain_sid': {'key': 'domainSid', 'type': 'str'}, + 'azure_storage_sid': {'key': 'azureStorageSid', 'type': 'str'}, + } + + def __init__(self, *, domain_name: str, net_bios_domain_name: str, forest_name: str, domain_guid: str, domain_sid: str, azure_storage_sid: str, **kwargs) -> None: + super(ActiveDirectoryProperties, self).__init__(**kwargs) + self.domain_name = domain_name + self.net_bios_domain_name = net_bios_domain_name + self.forest_name = forest_name + self.domain_guid = domain_guid + self.domain_sid = domain_sid + self.azure_storage_sid = azure_storage_sid + + +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 + + +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 + + +class AzureFilesIdentityBasedAuthentication(Model): + """Settings for Azure Files identity based authentication. + + All required parameters must be populated in order to send to Azure. + + :param directory_service_options: Required. Indicates the directory + service used. Possible values include: 'None', 'AADDS', 'AD' + :type directory_service_options: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.DirectoryServiceOptions + :param active_directory_properties: Required if choose AD. + :type active_directory_properties: + ~azure.mgmt.storage.v2020_08_01_preview.models.ActiveDirectoryProperties + """ + + _validation = { + 'directory_service_options': {'required': True}, + } + + _attribute_map = { + 'directory_service_options': {'key': 'directoryServiceOptions', 'type': 'str'}, + 'active_directory_properties': {'key': 'activeDirectoryProperties', 'type': 'ActiveDirectoryProperties'}, + } + + def __init__(self, *, directory_service_options, active_directory_properties=None, **kwargs) -> None: + super(AzureFilesIdentityBasedAuthentication, self).__init__(**kwargs) + self.directory_service_options = directory_service_options + self.active_directory_properties = active_directory_properties + + +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 + :ivar version: The version of the deleted blob container. + :vartype version: str + :ivar deleted: Indicates whether the blob container was deleted. + :vartype deleted: bool + :ivar deleted_time: Blob container deletion time. + :vartype deleted_time: datetime + :ivar remaining_retention_days: Remaining retention days for soft deleted + blob container. + :vartype remaining_retention_days: int + :param default_encryption_scope: Default the container to use specified + encryption scope for all writes. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Block override of encryption scope + from the container default. + :type deny_encryption_scope_override: bool + :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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2020_08_01_preview.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}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'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'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'default_encryption_scope': {'key': 'properties.defaultEncryptionScope', 'type': 'str'}, + 'deny_encryption_scope_override': {'key': 'properties.denyEncryptionScopeOverride', 'type': 'bool'}, + '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, *, default_encryption_scope: str=None, deny_encryption_scope_override: bool=None, public_access=None, metadata=None, **kwargs) -> None: + super(BlobContainer, self).__init__(**kwargs) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.default_encryption_scope = default_encryption_scope + self.deny_encryption_scope_override = deny_encryption_scope_override + 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 + + +class BlobRestoreParameters(Model): + """Blob restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param time_to_restore: Required. Restore blob to the specified time. + :type time_to_restore: datetime + :param blob_ranges: Required. Blob ranges to restore. + :type blob_ranges: + list[~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreRange] + """ + + _validation = { + 'time_to_restore': {'required': True}, + 'blob_ranges': {'required': True}, + } + + _attribute_map = { + 'time_to_restore': {'key': 'timeToRestore', 'type': 'iso-8601'}, + 'blob_ranges': {'key': 'blobRanges', 'type': '[BlobRestoreRange]'}, + } + + def __init__(self, *, time_to_restore, blob_ranges, **kwargs) -> None: + super(BlobRestoreParameters, self).__init__(**kwargs) + self.time_to_restore = time_to_restore + self.blob_ranges = blob_ranges + + +class BlobRestoreRange(Model): + """Blob range. + + All required parameters must be populated in order to send to Azure. + + :param start_range: Required. Blob start range. This is inclusive. Empty + means account start. + :type start_range: str + :param end_range: Required. Blob end range. This is exclusive. Empty means + account end. + :type end_range: str + """ + + _validation = { + 'start_range': {'required': True}, + 'end_range': {'required': True}, + } + + _attribute_map = { + 'start_range': {'key': 'startRange', 'type': 'str'}, + 'end_range': {'key': 'endRange', 'type': 'str'}, + } + + def __init__(self, *, start_range: str, end_range: str, **kwargs) -> None: + super(BlobRestoreRange, self).__init__(**kwargs) + self.start_range = start_range + self.end_range = end_range + + +class BlobRestoreStatus(Model): + """Blob restore status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of blob restore progress. Possible values are: - + InProgress: Indicates that blob restore is ongoing. - Complete: Indicates + that blob restore has been completed successfully. - Failed: Indicates + that blob restore is failed. Possible values include: 'InProgress', + 'Complete', 'Failed' + :vartype status: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreProgressStatus + :ivar failure_reason: Failure reason when blob restore is failed. + :vartype failure_reason: str + :ivar restore_id: Id for tracking blob restore request. + :vartype restore_id: str + :ivar parameters: Blob restore request parameters. + :vartype parameters: + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreParameters + """ + + _validation = { + 'status': {'readonly': True}, + 'failure_reason': {'readonly': True}, + 'restore_id': {'readonly': True}, + 'parameters': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + 'restore_id': {'key': 'restoreId', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'BlobRestoreParameters'}, + } + + def __init__(self, **kwargs) -> None: + super(BlobRestoreStatus, self).__init__(**kwargs) + self.status = None + self.failure_reason = None + self.restore_id = None + self.parameters = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + 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 cors: Specifies CORS rules for the Blob service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the + default version to use for requests to the Blob service if an incoming + request’s version is not specified. Possible values include version + 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for blob soft + delete. + :type delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :param is_versioning_enabled: Versioning is enabled if set to true. + :type is_versioning_enabled: bool + :param automatic_snapshot_policy_enabled: Deprecated in favor of + isVersioningEnabled property. + :type automatic_snapshot_policy_enabled: bool + :param change_feed: The blob service properties for change feed events. + :type change_feed: + ~azure.mgmt.storage.v2020_08_01_preview.models.ChangeFeed + :param restore_policy: The blob service properties for blob restore + policy. + :type restore_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.RestorePolicyProperties + :param container_delete_retention_policy: The blob service properties for + container soft delete. + :type container_delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'is_versioning_enabled': {'key': 'properties.isVersioningEnabled', 'type': 'bool'}, + 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, + 'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'}, + 'restore_policy': {'key': 'properties.restorePolicy', 'type': 'RestorePolicyProperties'}, + 'container_delete_retention_policy': {'key': 'properties.containerDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, is_versioning_enabled: bool=None, automatic_snapshot_policy_enabled: bool=None, change_feed=None, restore_policy=None, container_delete_retention_policy=None, **kwargs) -> None: + super(BlobServiceProperties, self).__init__(**kwargs) + self.cors = cors + self.default_service_version = default_service_version + self.delete_retention_policy = delete_retention_policy + self.is_versioning_enabled = is_versioning_enabled + self.automatic_snapshot_policy_enabled = automatic_snapshot_policy_enabled + self.change_feed = change_feed + self.restore_policy = restore_policy + self.container_delete_retention_policy = container_delete_retention_policy + self.sku = None + + +class ChangeFeed(Model): + """The blob service properties for change feed events. + + :param enabled: Indicates whether change feed event logging is enabled for + the Blob service. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(ChangeFeed, self).__init__(**kwargs) + self.enabled = enabled + + +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.v2020_08_01_preview.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 + + +class CloudError(Model): + """An error response from the Storage service. + + :param error: + :type error: ~azure.mgmt.storage.v2020_08_01_preview.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the Storage service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.storage.v2020_08_01_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class CorsRule(Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. + A list of origin domains that will be allowed via CORS, or "*" to allow + all domains + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. + A list of HTTP methods that are allowed to be executed by the origin. + :type allowed_methods: list[str] + :param max_age_in_seconds: Required. Required if CorsRule element is + present. The number of seconds that the client/browser should cache a + preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. + A list of response headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. + A list of headers allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__(self, *, allowed_origins, allowed_methods, max_age_in_seconds: int, exposed_headers, allowed_headers, **kwargs) -> None: + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = allowed_origins + self.allowed_methods = allowed_methods + self.max_age_in_seconds = max_age_in_seconds + self.exposed_headers = exposed_headers + self.allowed_headers = allowed_headers + + +class CorsRules(Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the + request. . + + :param cors_rules: The List of CORS rules. You can include up to five + CorsRule elements in the request. + :type cors_rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__(self, *, cors_rules=None, **kwargs) -> None: + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = cors_rules + + +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_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class DateAfterCreation(Model): + """Object to define the number of days after creation. + + All required parameters must be populated in order to send to Azure. + + :param days_after_creation_greater_than: Required. Value indicating the + age in days after creation + :type days_after_creation_greater_than: float + """ + + _validation = { + 'days_after_creation_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'float'}, + } + + def __init__(self, *, days_after_creation_greater_than: float, **kwargs) -> None: + super(DateAfterCreation, self).__init__(**kwargs) + self.days_after_creation_greater_than = days_after_creation_greater_than + + +class DateAfterModification(Model): + """Object to define the number of days after last modification. + + All required parameters must be populated in order to send to Azure. + + :param days_after_modification_greater_than: Required. Value indicating + the age in days after last modification + :type days_after_modification_greater_than: float + """ + + _validation = { + 'days_after_modification_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'float'}, + } + + def __init__(self, *, days_after_modification_greater_than: float, **kwargs) -> None: + super(DateAfterModification, self).__init__(**kwargs) + self.days_after_modification_greater_than = days_after_modification_greater_than + + +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) + + +class DeletedAccount(ProxyResource): + """Deleted storage account. + + 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 storage_account_resource_id: Full resource id of the original + storage account. + :vartype storage_account_resource_id: str + :ivar location: Location of the deleted account. + :vartype location: str + :ivar restore_reference: Can be used to attempt recovering this deleted + account via PutStorageAccount API. + :vartype restore_reference: str + :ivar creation_time: Creation time of the deleted account. + :vartype creation_time: str + :ivar deletion_time: Deletion time of the deleted account. + :vartype deletion_time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'storage_account_resource_id': {'readonly': True}, + 'location': {'readonly': True}, + 'restore_reference': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'deletion_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'restore_reference': {'key': 'properties.restoreReference', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'deletion_time': {'key': 'properties.deletionTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DeletedAccount, self).__init__(**kwargs) + self.storage_account_resource_id = None + self.location = None + self.restore_reference = None + self.creation_time = None + self.deletion_time = None + + +class DeletedShare(Model): + """The deleted share to be restored. + + All required parameters must be populated in order to send to Azure. + + :param deleted_share_name: Required. Required. Identify the name of the + deleted share that will be restored. + :type deleted_share_name: str + :param deleted_share_version: Required. Required. Identify the version of + the deleted share that will be restored. + :type deleted_share_version: str + """ + + _validation = { + 'deleted_share_name': {'required': True}, + 'deleted_share_version': {'required': True}, + } + + _attribute_map = { + 'deleted_share_name': {'key': 'deletedShareName', 'type': 'str'}, + 'deleted_share_version': {'key': 'deletedShareVersion', 'type': 'str'}, + } + + def __init__(self, *, deleted_share_name: str, deleted_share_version: str, **kwargs) -> None: + super(DeletedShare, self).__init__(**kwargs) + self.deleted_share_name = deleted_share_name + self.deleted_share_version = deleted_share_version + + +class DeleteRetentionPolicy(Model): + """The service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled. + :type enabled: bool + :param days: Indicates the number of days that the deleted item should be + retained. The minimum specified value can be 1 and the maximum value can + be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool=None, days: int=None, **kwargs) -> None: + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = enabled + self.days = days + + +class Dimension(Model): + """Dimension of blobs, possibly 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 + + +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.v2020_08_01_preview.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.v2020_08_01_preview.models.KeySource + :param require_infrastructure_encryption: A boolean indicating whether or + not the service applies a secondary layer of encryption with platform + managed keys for data at rest. + :type require_infrastructure_encryption: bool + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2020_08_01_preview.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'require_infrastructure_encryption': {'key': 'requireInfrastructureEncryption', 'type': 'bool'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", require_infrastructure_encryption: bool=None, key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.require_infrastructure_encryption = require_infrastructure_encryption + self.key_vault_properties = key_vault_properties + + +class EncryptionScope(Resource): + """The Encryption Scope 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 + :param source: The provider for the encryption scope. Possible values + (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible + values include: 'Microsoft.Storage', 'Microsoft.KeyVault' + :type source: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeSource + :param state: The state of the encryption scope. Possible values + (case-insensitive): Enabled, Disabled. Possible values include: + 'Enabled', 'Disabled' + :type state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeState + :ivar creation_time: Gets the creation date and time of the encryption + scope in UTC. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modification date and time of the + encryption scope in UTC. + :vartype last_modified_time: datetime + :param key_vault_properties: The key vault properties for the encryption + scope. This is a required field if encryption scope 'source' attribute is + set to 'Microsoft.KeyVault'. + :type key_vault_properties: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopeKeyVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'EncryptionScopeKeyVaultProperties'}, + } + + def __init__(self, *, source=None, state=None, key_vault_properties=None, **kwargs) -> None: + super(EncryptionScope, self).__init__(**kwargs) + self.source = source + self.state = state + self.creation_time = None + self.last_modified_time = None + self.key_vault_properties = key_vault_properties + + +class EncryptionScopeKeyVaultProperties(Model): + """The key vault properties for the encryption scope. This is a required field + if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + + :param key_uri: The object identifier for a key vault key object. When + applied, the encryption scope will use the key referenced by the + identifier to enable customer-managed key support on this encryption + scope. + :type key_uri: str + """ + + _attribute_map = { + 'key_uri': {'key': 'keyUri', 'type': 'str'}, + } + + def __init__(self, *, key_uri: str=None, **kwargs) -> None: + super(EncryptionScopeKeyVaultProperties, self).__init__(**kwargs) + self.key_uri = key_uri + + +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 + :param key_type: Encryption key type to be used for the encryption + service. 'Account' key type implies that an account-scoped encryption key + will be used. 'Service' key type implies that a default service key is + used. Possible values include: 'Service', 'Account' + :type key_type: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.KeyType + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, key_type=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + self.key_type = key_type + + +class EncryptionServices(Model): + """A list of services that support encryption. + + :param blob: The encryption function of the blob storage service. + :type blob: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + :param table: The encryption function of the table storage service. + :type table: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + :param queue: The encryption function of the queue storage service. + :type queue: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionService + """ + + _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, table=None, queue=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = table + self.queue = queue + + +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 + :param microsoft_endpoints: Gets the microsoft routing storage endpoints. + :type microsoft_endpoints: + ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountMicrosoftEndpoints + :param internet_endpoints: Gets the internet routing storage endpoints + :type internet_endpoints: + ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountInternetEndpoints + """ + + _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'}, + 'microsoft_endpoints': {'key': 'microsoftEndpoints', 'type': 'StorageAccountMicrosoftEndpoints'}, + 'internet_endpoints': {'key': 'internetEndpoints', 'type': 'StorageAccountInternetEndpoints'}, + } + + def __init__(self, *, microsoft_endpoints=None, internet_endpoints=None, **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 + self.microsoft_endpoints = microsoft_endpoints + self.internet_endpoints = internet_endpoints + + +class ErrorResponse(Model): + """An error response from the storage resource provider. + + :param error: Azure Storage Resource Provider error response body. + :type error: + ~azure.mgmt.storage.v2020_08_01_preview.models.ErrorResponseBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ErrorResponseBody(Model): + """Error response body contract. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = code + self.message = message + + +class FileServiceItems(Model): + """FileServiceItems. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of file services returned. + :vartype value: + list[~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileServiceProperties]'}, + } + + def __init__(self, **kwargs) -> None: + super(FileServiceItems, self).__init__(**kwargs) + self.value = None + + +class FileServiceProperties(Resource): + """The properties of File services in storage account. + + 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 cors: Specifies CORS rules for the File service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the File service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + :param share_delete_retention_policy: The file service properties for + share soft delete. + :type share_delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2020_08_01_preview.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'share_delete_retention_policy': {'key': 'properties.shareDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, cors=None, share_delete_retention_policy=None, **kwargs) -> None: + super(FileServiceProperties, self).__init__(**kwargs) + self.cors = cors + self.share_delete_retention_policy = share_delete_retention_policy + self.sku = None + + +class FileShare(AzureEntityResource): + """Properties of the file share, 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 + :ivar last_modified_time: Returns the date and time the share was last + modified. + :vartype last_modified_time: datetime + :param metadata: A name-value pair to associate with the share as + metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be + greater than 0, and less than or equal to 5TB (5120). For Large File + Shares, the maximum size is 102400. + :type share_quota: int + :param enabled_protocols: The authentication protocol that is used for the + file share. Can only be specified when creating a share. Possible values + include: 'SMB', 'NFS' + :type enabled_protocols: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.EnabledProtocols + :param root_squash: The property is for NFS share only. The default is + NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', + 'AllSquash' + :type root_squash: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.RootSquashType + :ivar version: The version of the share. + :vartype version: str + :ivar deleted: Indicates whether the share was deleted. + :vartype deleted: bool + :ivar deleted_time: The deleted time if the share was deleted. + :vartype deleted_time: datetime + :ivar remaining_retention_days: Remaining retention days for share that + was soft deleted. + :vartype remaining_retention_days: int + :param access_tier: Access tier for specific share. GpV2 account can + choose between TransactionOptimized (default), Hot, and Cool. FileStorage + account can choose Premium. Possible values include: + 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + :type access_tier: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.ShareAccessTier + :ivar access_tier_change_time: Indicates the last modification time for + share access tier. + :vartype access_tier_change_time: datetime + :ivar access_tier_status: Indicates if there is a pending transition for + access tier. + :vartype access_tier_status: str + :ivar share_usage_bytes: The approximate size of the data stored on the + share. Note that this value may not include all recently created or + recently resized files. + :vartype share_usage_bytes: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'access_tier_change_time': {'readonly': True}, + 'access_tier_status': {'readonly': True}, + 'share_usage_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + 'enabled_protocols': {'key': 'properties.enabledProtocols', 'type': 'str'}, + 'root_squash': {'key': 'properties.rootSquash', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'access_tier_change_time': {'key': 'properties.accessTierChangeTime', 'type': 'iso-8601'}, + 'access_tier_status': {'key': 'properties.accessTierStatus', 'type': 'str'}, + 'share_usage_bytes': {'key': 'properties.shareUsageBytes', 'type': 'long'}, + } + + def __init__(self, *, metadata=None, share_quota: int=None, enabled_protocols=None, root_squash=None, access_tier=None, **kwargs) -> None: + super(FileShare, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = metadata + self.share_quota = share_quota + self.enabled_protocols = enabled_protocols + self.root_squash = root_squash + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.access_tier = access_tier + self.access_tier_change_time = None + self.access_tier_status = None + self.share_usage_bytes = None + + +class FileShareItem(AzureEntityResource): + """The file share 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 + :ivar last_modified_time: Returns the date and time the share was last + modified. + :vartype last_modified_time: datetime + :param metadata: A name-value pair to associate with the share as + metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be + greater than 0, and less than or equal to 5TB (5120). For Large File + Shares, the maximum size is 102400. + :type share_quota: int + :param enabled_protocols: The authentication protocol that is used for the + file share. Can only be specified when creating a share. Possible values + include: 'SMB', 'NFS' + :type enabled_protocols: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.EnabledProtocols + :param root_squash: The property is for NFS share only. The default is + NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', + 'AllSquash' + :type root_squash: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.RootSquashType + :ivar version: The version of the share. + :vartype version: str + :ivar deleted: Indicates whether the share was deleted. + :vartype deleted: bool + :ivar deleted_time: The deleted time if the share was deleted. + :vartype deleted_time: datetime + :ivar remaining_retention_days: Remaining retention days for share that + was soft deleted. + :vartype remaining_retention_days: int + :param access_tier: Access tier for specific share. GpV2 account can + choose between TransactionOptimized (default), Hot, and Cool. FileStorage + account can choose Premium. Possible values include: + 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + :type access_tier: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.ShareAccessTier + :ivar access_tier_change_time: Indicates the last modification time for + share access tier. + :vartype access_tier_change_time: datetime + :ivar access_tier_status: Indicates if there is a pending transition for + access tier. + :vartype access_tier_status: str + :ivar share_usage_bytes: The approximate size of the data stored on the + share. Note that this value may not include all recently created or + recently resized files. + :vartype share_usage_bytes: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'access_tier_change_time': {'readonly': True}, + 'access_tier_status': {'readonly': True}, + 'share_usage_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + 'enabled_protocols': {'key': 'properties.enabledProtocols', 'type': 'str'}, + 'root_squash': {'key': 'properties.rootSquash', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'access_tier_change_time': {'key': 'properties.accessTierChangeTime', 'type': 'iso-8601'}, + 'access_tier_status': {'key': 'properties.accessTierStatus', 'type': 'str'}, + 'share_usage_bytes': {'key': 'properties.shareUsageBytes', 'type': 'long'}, + } + + def __init__(self, *, metadata=None, share_quota: int=None, enabled_protocols=None, root_squash=None, access_tier=None, **kwargs) -> None: + super(FileShareItem, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = metadata + self.share_quota = share_quota + self.enabled_protocols = enabled_protocols + self.root_squash = root_squash + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.access_tier = access_tier + self.access_tier_change_time = None + self.access_tier_status = None + self.share_usage_bytes = None + + +class GeoReplicationStats(Model): + """Statistics related to replication for storage account's Blob, Table, Queue + and File services. It is only available when geo-redundant replication is + enabled for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of the secondary location. Possible values are: - + Live: Indicates that the secondary location is active and operational. - + Bootstrap: Indicates initial synchronization from the primary location to + the secondary location is in progress.This typically occurs when + replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: 'Live', + 'Bootstrap', 'Unavailable' + :vartype status: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time + value are guaranteed to be available for read operations. Primary writes + following this point in time may or may not be available for reads. + Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: datetime + :ivar can_failover: A boolean flag which indicates whether or not account + failover is supported for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +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 + + +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. + + :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: 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.v2020_08_01_preview.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed + for unlocked time-based retention policies. When enabled, new blocks can + be written to an append blob while maintaining immutability protection and + compliance. Only new blocks can be added and any existing blocks cannot be + modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': 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'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int=None, allow_protected_append_writes: bool=None, **kwargs) -> None: + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.allow_protected_append_writes = allow_protected_append_writes + + +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. + + :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 + :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.v2020_08_01_preview.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed + for unlocked time-based retention policies. When enabled, new blocks can + be written to an append blob while maintaining immutability protection and + compliance. Only new blocks can be added and any existing blocks cannot be + modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool + :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.v2020_08_01_preview.models.UpdateHistoryProperty] + """ + + _validation = { + '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'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int=None, allow_protected_append_writes: bool=None, **kwargs) -> None: + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.allow_protected_append_writes = allow_protected_append_writes + self.etag = None + self.update_history = None + + +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.v2020_08_01_preview.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 + + +class KeyVaultProperties(Model): + """Properties of key vault. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + :ivar current_versioned_key_identifier: The object identifier of the + current versioned Key Vault Key in use. + :vartype current_versioned_key_identifier: str + :ivar last_key_rotation_timestamp: Timestamp of last rotation of the Key + Vault Key. + :vartype last_key_rotation_timestamp: datetime + """ + + _validation = { + 'current_versioned_key_identifier': {'readonly': True}, + 'last_key_rotation_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + 'current_versioned_key_identifier': {'key': 'currentVersionedKeyIdentifier', 'type': 'str'}, + 'last_key_rotation_timestamp': {'key': 'lastKeyRotationTimestamp', 'type': 'iso-8601'}, + } + + 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 + self.current_versioned_key_identifier = None + self.last_key_rotation_timestamp = None + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2020_08_01_preview.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, *, action, lease_id: str=None, break_period: int=None, lease_duration: int=None, proposed_lease_id: str=None, **kwargs) -> None: + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = action + self.lease_id = lease_id + self.break_period = break_period + self.lease_duration = lease_duration + self.proposed_lease_id = proposed_lease_id + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, *, lease_id: str=None, lease_time_seconds: str=None, **kwargs) -> None: + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = lease_id + self.lease_time_seconds = lease_time_seconds + + +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 + + +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.v2020_08_01_preview.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 + + +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 + + +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 + :ivar version: The version of the deleted blob container. + :vartype version: str + :ivar deleted: Indicates whether the blob container was deleted. + :vartype deleted: bool + :ivar deleted_time: Blob container deletion time. + :vartype deleted_time: datetime + :ivar remaining_retention_days: Remaining retention days for soft deleted + blob container. + :vartype remaining_retention_days: int + :param default_encryption_scope: Default the container to use specified + encryption scope for all writes. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Block override of encryption scope + from the container default. + :type deny_encryption_scope_override: bool + :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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2020_08_01_preview.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}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'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'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'default_encryption_scope': {'key': 'properties.defaultEncryptionScope', 'type': 'str'}, + 'deny_encryption_scope_override': {'key': 'properties.denyEncryptionScopeOverride', 'type': 'bool'}, + '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, *, default_encryption_scope: str=None, deny_encryption_scope_override: bool=None, public_access=None, metadata=None, **kwargs) -> None: + super(ListContainerItem, self).__init__(**kwargs) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.default_encryption_scope = default_encryption_scope + self.deny_encryption_scope_override = deny_encryption_scope_override + 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 + + +class ListQueue(Resource): + """ListQueue. + + 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 metadata: A name-value pair that represents queue metadata. + :type metadata: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + } + + def __init__(self, *, metadata=None, **kwargs) -> None: + super(ListQueue, self).__init__(**kwargs) + self.metadata = metadata + + +class ListQueueServices(Model): + """ListQueueServices. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of queue services returned. + :vartype value: + list[~azure.mgmt.storage.v2020_08_01_preview.models.QueueServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QueueServiceProperties]'}, + } + + def __init__(self, **kwargs) -> None: + super(ListQueueServices, self).__init__(**kwargs) + self.value = None + + +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 specific + 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 + + +class ListTableServices(Model): + """ListTableServices. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of table services returned. + :vartype value: + list[~azure.mgmt.storage.v2020_08_01_preview.models.TableServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TableServiceProperties]'}, + } + + def __init__(self, **kwargs) -> None: + super(ListTableServices, self).__init__(**kwargs) + self.value = None + + +class ManagementPolicy(Resource): + """The Get Storage Account ManagementPolicies operation response. + + 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 last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + :param policy: Required. The Storage Account ManagementPolicy, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'policy': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, + } + + def __init__(self, *, policy, **kwargs) -> None: + super(ManagementPolicy, self).__init__(**kwargs) + self.last_modified_time = None + self.policy = policy + + +class ManagementPolicyAction(Model): + """Actions are applied to the filtered blobs when the execution condition is + met. + + :param base_blob: The management policy action for base blob + :type base_blob: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyBaseBlob + :param snapshot: The management policy action for snapshot + :type snapshot: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicySnapShot + """ + + _attribute_map = { + 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, + 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, + } + + def __init__(self, *, base_blob=None, snapshot=None, **kwargs) -> None: + super(ManagementPolicyAction, self).__init__(**kwargs) + self.base_blob = base_blob + self.snapshot = snapshot + + +class ManagementPolicyBaseBlob(Model): + """Management policy action for base blob. + + :param tier_to_cool: The function to tier blobs to cool storage. Support + blobs currently at Hot tier + :type tier_to_cool: + ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterModification + :param tier_to_archive: The function to tier blobs to archive storage. + Support blobs currently at Hot or Cool tier + :type tier_to_archive: + ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterModification + :param delete: The function to delete the blob + :type delete: + ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterModification + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, + 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, + } + + def __init__(self, *, tier_to_cool=None, tier_to_archive=None, delete=None, **kwargs) -> None: + super(ManagementPolicyBaseBlob, self).__init__(**kwargs) + self.tier_to_cool = tier_to_cool + self.tier_to_archive = tier_to_archive + self.delete = delete + + +class ManagementPolicyDefinition(Model): + """An object that defines the Lifecycle rule. Each definition is made up with + a filters set and an actions set. + + All required parameters must be populated in order to send to Azure. + + :param actions: Required. An object that defines the action set. + :type actions: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyAction + :param filters: An object that defines the filter set. + :type filters: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyFilter + """ + + _validation = { + 'actions': {'required': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, + 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, + } + + def __init__(self, *, actions, filters=None, **kwargs) -> None: + super(ManagementPolicyDefinition, self).__init__(**kwargs) + self.actions = actions + self.filters = filters + + +class ManagementPolicyFilter(Model): + """Filters limit rule actions to a subset of blobs within the storage account. + If multiple filters are defined, a logical AND is performed on all filters. + . + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for prefixes to be match. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Only + blockBlob is supported. + :type blob_types: list[str] + :param blob_index_match: An array of blob index tag based filters, there + can be at most 10 tag filters + :type blob_index_match: + list[~azure.mgmt.storage.v2020_08_01_preview.models.TagFilter] + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + 'blob_index_match': {'key': 'blobIndexMatch', 'type': '[TagFilter]'}, + } + + def __init__(self, *, blob_types, prefix_match=None, blob_index_match=None, **kwargs) -> None: + super(ManagementPolicyFilter, self).__init__(**kwargs) + self.prefix_match = prefix_match + self.blob_types = blob_types + self.blob_index_match = blob_index_match + + +class ManagementPolicyRule(Model): + """An object that wraps the Lifecycle rule. Each rule is uniquely defined by + 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 enabled: Rule is enabled if set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha + numeric characters. Rule name is case-sensitive. It must be unique within + a policy. + :type name: str + :ivar type: Required. The valid value is Lifecycle. Default value: + "Lifecycle" . + :vartype type: str + :param definition: Required. An object that defines the Lifecycle rule. + :type definition: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyDefinition + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, + } + + type = "Lifecycle" + + def __init__(self, *, name: str, definition, enabled: bool=None, **kwargs) -> None: + super(ManagementPolicyRule, self).__init__(**kwargs) + self.enabled = enabled + self.name = name + self.definition = definition + + +class ManagementPolicySchema(Model): + """The Storage Account ManagementPolicies Rules. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + All required parameters must be populated in order to send to Azure. + + :param rules: Required. The Storage Account ManagementPolicies Rules. See + more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicyRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, + } + + def __init__(self, *, rules, **kwargs) -> None: + super(ManagementPolicySchema, self).__init__(**kwargs) + self.rules = rules + + +class ManagementPolicySnapShot(Model): + """Management policy action for snapshot. + + :param delete: The function to delete the blob snapshot + :type delete: + ~azure.mgmt.storage.v2020_08_01_preview.models.DateAfterCreation + """ + + _attribute_map = { + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__(self, *, delete=None, **kwargs) -> None: + super(ManagementPolicySnapShot, self).__init__(**kwargs) + self.delete = delete + + +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.v2020_08_01_preview.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 + + +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.v2020_08_01_preview.models.Bypass + :param resource_access_rules: + :type resource_access_rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.ResourceAccessRule] + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: + list[~azure.mgmt.storage.v2020_08_01_preview.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.v2020_08_01_preview.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'resource_access_rules': {'key': 'resourceAccessRules', 'type': '[ResourceAccessRule]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", resource_access_rules=None, virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.resource_access_rules = resource_access_rules + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action + + +class ObjectReplicationPolicy(Resource): + """The replication policy between two storage accounts. Multiple rules can be + defined in one policy. + + 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 policy_id: A unique id for object replication policy. + :vartype policy_id: str + :ivar enabled_time: Indicates when the policy is enabled on the source + account. + :vartype enabled_time: datetime + :param source_account: Required. Required. Source account name. + :type source_account: str + :param destination_account: Required. Required. Destination account name. + :type destination_account: str + :param rules: The storage account object replication rules. + :type rules: + list[~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicyRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_id': {'readonly': True}, + 'enabled_time': {'readonly': True}, + 'source_account': {'required': True}, + 'destination_account': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy_id': {'key': 'properties.policyId', 'type': 'str'}, + 'enabled_time': {'key': 'properties.enabledTime', 'type': 'iso-8601'}, + 'source_account': {'key': 'properties.sourceAccount', 'type': 'str'}, + 'destination_account': {'key': 'properties.destinationAccount', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[ObjectReplicationPolicyRule]'}, + } + + def __init__(self, *, source_account: str, destination_account: str, rules=None, **kwargs) -> None: + super(ObjectReplicationPolicy, self).__init__(**kwargs) + self.policy_id = None + self.enabled_time = None + self.source_account = source_account + self.destination_account = destination_account + self.rules = rules + + +class ObjectReplicationPolicyFilter(Model): + """Filters limit replication to a subset of blobs within the storage account. + A logical OR is performed on values in the filter. If multiple filters are + defined, a logical AND is performed on all filters. + + :param prefix_match: Optional. Filters the results to replicate only blobs + whose names begin with the specified prefix. + :type prefix_match: list[str] + :param min_creation_time: Blobs created after the time will be replicated + to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. + Example: 2020-02-19T16:05:00Z + :type min_creation_time: str + """ + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'min_creation_time': {'key': 'minCreationTime', 'type': 'str'}, + } + + def __init__(self, *, prefix_match=None, min_creation_time: str=None, **kwargs) -> None: + super(ObjectReplicationPolicyFilter, self).__init__(**kwargs) + self.prefix_match = prefix_match + self.min_creation_time = min_creation_time + + +class ObjectReplicationPolicyRule(Model): + """The replication policy rule between two containers. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Rule Id is auto-generated for each new rule on destination + account. It is required for put policy on source account. + :type rule_id: str + :param source_container: Required. Required. Source container name. + :type source_container: str + :param destination_container: Required. Required. Destination container + name. + :type destination_container: str + :param filters: Optional. An object that defines the filter set. + :type filters: + ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicyFilter + """ + + _validation = { + 'source_container': {'required': True}, + 'destination_container': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'source_container': {'key': 'sourceContainer', 'type': 'str'}, + 'destination_container': {'key': 'destinationContainer', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': 'ObjectReplicationPolicyFilter'}, + } + + def __init__(self, *, source_container: str, destination_container: str, rule_id: str=None, filters=None, **kwargs) -> None: + super(ObjectReplicationPolicyRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.source_container = source_container + self.destination_container = destination_container + self.filters = filters + + +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.v2020_08_01_preview.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.v2020_08_01_preview.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 + + +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 + + +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection 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 private_endpoint: The resource of private end point. + :type private_endpoint: + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, private_link_service_connection_state, private_endpoint=None, provisioning_state=None, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = provisioning_state + + +class PrivateLinkResource(Resource): + """A private link 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 + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS + zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, *, required_zone_names=None, **kwargs) -> None: + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkResourceListResult(Model): + """A list of private link resources. + + :param value: Array of private link resources + :type value: + list[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param action_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type action_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__(self, *, status=None, description: str=None, action_required: str=None, **kwargs) -> None: + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.action_required = action_required + + +class QueueServiceProperties(Resource): + """The properties of a storage account’s Queue service. + + 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 cors: Specifies CORS rules for the Queue service. You can include + up to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Queue service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + """ + + _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'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + } + + def __init__(self, *, cors=None, **kwargs) -> None: + super(QueueServiceProperties, self).__init__(**kwargs) + self.cors = cors + + +class ResourceAccessRule(Model): + """Resource Access Rule. + + :param tenant_id: Tenant Id + :type tenant_id: str + :param resource_id: Resource Id + :type resource_id: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, resource_id: str=None, **kwargs) -> None: + super(ResourceAccessRule, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.resource_id = resource_id + + +class RestorePolicyProperties(Model): + """The blob service properties for blob restore policy. + + 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 enabled: Required. Blob restore is enabled if set to true. + :type enabled: bool + :param days: how long this blob can be restored. It should be great than + zero and less than DeleteRetentionPolicy.days. + :type days: int + :ivar last_enabled_time: Deprecated in favor of minRestoreTime property. + :vartype last_enabled_time: datetime + :ivar min_restore_time: Returns the minimum date and time that the restore + can be started. + :vartype min_restore_time: datetime + """ + + _validation = { + 'enabled': {'required': True}, + 'days': {'maximum': 365, 'minimum': 1}, + 'last_enabled_time': {'readonly': True}, + 'min_restore_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'min_restore_time': {'key': 'minRestoreTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool, days: int=None, **kwargs) -> None: + super(RestorePolicyProperties, self).__init__(**kwargs) + self.enabled = enabled + self.days = days + self.last_enabled_time = None + self.min_restore_time = None + + +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.v2020_08_01_preview.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 + + +class RoutingPreference(Model): + """Routing preference defines the type of network, either microsoft or + internet routing to be used to deliver the user data, the default option is + microsoft routing. + + :param routing_choice: Routing Choice defines the kind of network routing + opted by the user. Possible values include: 'MicrosoftRouting', + 'InternetRouting' + :type routing_choice: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingChoice + :param publish_microsoft_endpoints: A boolean flag which indicates whether + microsoft routing storage endpoints are to be published + :type publish_microsoft_endpoints: bool + :param publish_internet_endpoints: A boolean flag which indicates whether + internet routing storage endpoints are to be published + :type publish_internet_endpoints: bool + """ + + _attribute_map = { + 'routing_choice': {'key': 'routingChoice', 'type': 'str'}, + 'publish_microsoft_endpoints': {'key': 'publishMicrosoftEndpoints', 'type': 'bool'}, + 'publish_internet_endpoints': {'key': 'publishInternetEndpoints', 'type': 'bool'}, + } + + def __init__(self, *, routing_choice=None, publish_microsoft_endpoints: bool=None, publish_internet_endpoints: bool=None, **kwargs) -> None: + super(RoutingPreference, self).__init__(**kwargs) + self.routing_choice = routing_choice + self.publish_microsoft_endpoints = publish_microsoft_endpoints + self.publish_internet_endpoints = publish_internet_endpoints + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific 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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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 + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2020_08_01_preview.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 + + +class Sku(Model): + """The SKU of the storage account. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' + :type name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuName + :param tier: Possible values include: 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, *, name, tier=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +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 + + +class SkuInformation(Model): + """Storage SKU and its properties. + + 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. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' + :type name: str or ~azure.mgmt.storage.v2020_08_01_preview.models.SkuName + :param tier: Possible values include: 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.storage.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, tier=None, restrictions=None, **kwargs) -> None: + super(SkuInformation, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions + + +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 + + +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.v2020_08_01_preview.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2020_08_01_preview.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: + ~azure.mgmt.storage.v2020_08_01_preview.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.v2020_08_01_preview.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2020_08_01_preview.models.AzureFilesIdentityBasedAuthentication + :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.v2020_08_01_preview.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats + :vartype geo_replication_stats: + ~azure.mgmt.storage.v2020_08_01_preview.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will + be true, otherwise, it will be null. + :vartype failover_in_progress: bool + :param large_file_shares_state: Allow large file shares if sets to + Enabled. It cannot be disabled once it is enabled. Possible values + include: 'Disabled', 'Enabled' + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.LargeFileSharesState + :ivar private_endpoint_connections: List of private endpoint connection + associated with the specified storage account + :vartype private_endpoint_connections: + list[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection] + :param routing_preference: Maintains information about the network routing + choice opted by the user for data transfer + :type routing_preference: + ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingPreference + :ivar blob_restore_status: Blob restore status + :vartype blob_restore_status: + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreStatus + :param allow_blob_public_access: Allow or disallow public access to all + blobs or containers in the storage account. The default interpretation is + true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on + requests to storage. The default interpretation is TLS 1.0 for this + property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2' + :type minimum_tls_version: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.MinimumTlsVersion + """ + + _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}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'blob_restore_status': {'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': 'str'}, + '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'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + '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'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'blob_restore_status': {'key': 'properties.blobRestoreStatus', 'type': 'BlobRestoreStatus'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, azure_files_identity_based_authentication=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, large_file_shares_state=None, routing_preference=None, allow_blob_public_access: bool=None, minimum_tls_version=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.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None + self.is_hns_enabled = is_hns_enabled + self.geo_replication_stats = None + self.failover_in_progress = None + self.large_file_shares_state = large_file_shares_state + self.private_endpoint_connections = None + self.routing_preference = routing_preference + self.blob_restore_status = None + self.allow_blob_public_access = allow_blob_public_access + self.minimum_tls_version = minimum_tls_version + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability 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 + + +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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.CustomDomain + :param encryption: Not applicable. Azure Storage encryption is enabled for + all storage accounts and cannot be disabled. + :type encryption: + ~azure.mgmt.storage.v2020_08_01_preview.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2020_08_01_preview.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.v2020_08_01_preview.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2020_08_01_preview.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. The default value is true since API version + 2019-04-01. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :param large_file_shares_state: Allow large file shares if sets to + Enabled. It cannot be disabled once it is enabled. Possible values + include: 'Disabled', 'Enabled' + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing + choice opted by the user for data transfer + :type routing_preference: + ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingPreference + :param allow_blob_public_access: Allow or disallow public access to all + blobs or containers in the storage account. The default interpretation is + true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on + requests to storage. The default interpretation is TLS 1.0 for this + property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2' + :type minimum_tls_version: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.MinimumTlsVersion + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + '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'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, azure_files_identity_based_authentication=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, large_file_shares_state=None, routing_preference=None, allow_blob_public_access: bool=None, minimum_tls_version=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.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.is_hns_enabled = is_hns_enabled + self.large_file_shares_state = large_file_shares_state + self.routing_preference = routing_preference + self.allow_blob_public_access = allow_blob_public_access + self.minimum_tls_version = minimum_tls_version + + +class StorageAccountInternetEndpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, file, web + or dfs object via a internet routing endpoint. + + 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 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}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountInternetEndpoints, self).__init__(**kwargs) + self.blob = None + self.file = None + self.web = None + self.dfs = None + + +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.v2020_08_01_preview.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 + + +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.v2020_08_01_preview.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 + + +class StorageAccountMicrosoftEndpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object via a microsoft routing endpoint. + + 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(StorageAccountMicrosoftEndpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +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 values are key1, key2, kerb1, kerb2. + :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 + + +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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: + ~azure.mgmt.storage.v2020_08_01_preview.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.v2020_08_01_preview.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2020_08_01_preview.models.AzureFilesIdentityBasedAuthentication + :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.v2020_08_01_preview.models.NetworkRuleSet + :param large_file_shares_state: Allow large file shares if sets to + Enabled. It cannot be disabled once it is enabled. Possible values + include: 'Disabled', 'Enabled' + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing + choice opted by the user for data transfer + :type routing_preference: + ~azure.mgmt.storage.v2020_08_01_preview.models.RoutingPreference + :param allow_blob_public_access: Allow or disallow public access to all + blobs or containers in the storage account. The default interpretation is + true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on + requests to storage. The default interpretation is TLS 1.0 for this + property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2' + :type minimum_tls_version: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.MinimumTlsVersion + :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.v2020_08_01_preview.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'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, azure_files_identity_based_authentication=None, enable_https_traffic_only: bool=None, network_rule_set=None, large_file_shares_state=None, routing_preference=None, allow_blob_public_access: bool=None, minimum_tls_version=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.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.large_file_shares_state = large_file_shares_state + self.routing_preference = routing_preference + self.allow_blob_public_access = allow_blob_public_access + self.minimum_tls_version = minimum_tls_version + self.kind = kind + + +class StorageQueue(Resource): + """StorageQueue. + + 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 metadata: A name-value pair that represents queue metadata. + :type metadata: dict[str, str] + :ivar approximate_message_count: Integer indicating an approximate number + of messages in the queue. This number is not lower than the actual number + of messages in the queue, but could be higher. + :vartype approximate_message_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'approximate_message_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'approximate_message_count': {'key': 'properties.approximateMessageCount', 'type': 'int'}, + } + + def __init__(self, *, metadata=None, **kwargs) -> None: + super(StorageQueue, self).__init__(**kwargs) + self.metadata = metadata + self.approximate_message_count = None + + +class Table(Resource): + """Properties of the table, including Id, resource name, resource type. + + 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 table_name: Table name under the specified account + :vartype table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'table_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Table, self).__init__(**kwargs) + self.table_name = None + + +class TableServiceProperties(Resource): + """The properties of a storage account’s Table service. + + 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 cors: Specifies CORS rules for the Table service. You can include + up to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Table service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + """ + + _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'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + } + + def __init__(self, *, cors=None, **kwargs) -> None: + super(TableServiceProperties, self).__init__(**kwargs) + self.cors = cors + + +class TagFilter(Model): + """Blob index tag based filtering for blob objects. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. This is the filter tag name, it can have 1 - 128 + characters + :type name: str + :param op: Required. This is the comparison operator which is used for + object comparison and filtering. Only == (equality operator) is currently + supported + :type op: str + :param value: Required. This is the filter tag value field used for tag + based filtering, it can have 0 - 256 characters + :type value: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 128, 'min_length': 1}, + 'op': {'required': True}, + 'value': {'required': True, 'max_length': 256, 'min_length': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'op': {'key': 'op', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str, op: str, value: str, **kwargs) -> None: + super(TagFilter, self).__init__(**kwargs) + self.name = name + self.op = op + self.value = value + + +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 + + +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.v2020_08_01_preview.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 + + +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.v2020_08_01_preview.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.v2020_08_01_preview.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 + + +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 + + +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.v2020_08_01_preview.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.v2020_08_01_preview.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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..ad66246d4b89 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_paged_models.py @@ -0,0 +1,183 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# 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) +class SkuInformationPaged(Paged): + """ + A paging container for iterating over a list of :class:`SkuInformation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SkuInformation]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuInformationPaged, self).__init__(*args, **kwargs) +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) +class DeletedAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeletedAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeletedAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(DeletedAccountPaged, self).__init__(*args, **kwargs) +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) +class PrivateEndpointConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateEndpointConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) +class ObjectReplicationPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`ObjectReplicationPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ObjectReplicationPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(ObjectReplicationPolicyPaged, self).__init__(*args, **kwargs) +class EncryptionScopePaged(Paged): + """ + A paging container for iterating over a list of :class:`EncryptionScope ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EncryptionScope]'} + } + + def __init__(self, *args, **kwargs): + + super(EncryptionScopePaged, self).__init__(*args, **kwargs) +class BlobServicePropertiesPaged(Paged): + """ + A paging container for iterating over a list of :class:`BlobServiceProperties ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BlobServiceProperties]'} + } + + def __init__(self, *args, **kwargs): + + super(BlobServicePropertiesPaged, self).__init__(*args, **kwargs) +class ListContainerItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`ListContainerItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ListContainerItem]'} + } + + def __init__(self, *args, **kwargs): + + super(ListContainerItemPaged, self).__init__(*args, **kwargs) +class FileShareItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`FileShareItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[FileShareItem]'} + } + + def __init__(self, *args, **kwargs): + + super(FileShareItemPaged, self).__init__(*args, **kwargs) +class ListQueuePaged(Paged): + """ + A paging container for iterating over a list of :class:`ListQueue ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ListQueue]'} + } + + def __init__(self, *args, **kwargs): + + super(ListQueuePaged, self).__init__(*args, **kwargs) +class TablePaged(Paged): + """ + A paging container for iterating over a list of :class:`Table ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Table]'} + } + + def __init__(self, *args, **kwargs): + + super(TablePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_storage_management_client_enums.py new file mode 100644 index 000000000000..a3bcdacf7b93 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_storage_management_client_enums.py @@ -0,0 +1,322 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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" + standard_gzrs = "Standard_GZRS" + standard_ragzrs = "Standard_RAGZRS" + + +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 KeyType(str, Enum): + + service = "Service" + account = "Account" + + +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 DirectoryServiceOptions(str, Enum): + + none = "None" + aadds = "AADDS" + ad = "AD" + + +class AccessTier(str, Enum): + + hot = "Hot" + cool = "Cool" + + +class LargeFileSharesState(str, Enum): + + disabled = "Disabled" + enabled = "Enabled" + + +class RoutingChoice(str, Enum): + + microsoft_routing = "MicrosoftRouting" + internet_routing = "InternetRouting" + + +class MinimumTlsVersion(str, Enum): + + tls1_0 = "TLS1_0" + tls1_1 = "TLS1_1" + tls1_2 = "TLS1_2" + + +class GeoReplicationStatus(str, Enum): + + live = "Live" + bootstrap = "Bootstrap" + unavailable = "Unavailable" + + +class BlobRestoreProgressStatus(str, Enum): + + in_progress = "InProgress" + complete = "Complete" + failed = "Failed" + + +class ProvisioningState(str, Enum): + + creating = "Creating" + resolving_dns = "ResolvingDNS" + succeeded = "Succeeded" + + +class AccountStatus(str, Enum): + + available = "available" + unavailable = "unavailable" + + +class PrivateEndpointServiceConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + + +class PrivateEndpointConnectionProvisioningState(str, Enum): + + succeeded = "Succeeded" + creating = "Creating" + deleting = "Deleting" + failed = "Failed" + + +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 EncryptionScopeSource(str, Enum): + + microsoft_storage = "Microsoft.Storage" + microsoft_key_vault = "Microsoft.KeyVault" + + +class EncryptionScopeState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +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" + + +class EnabledProtocols(str, Enum): + + smb = "SMB" + nfs = "NFS" + + +class RootSquashType(str, Enum): + + no_root_squash = "NoRootSquash" + root_squash = "RootSquash" + all_squash = "AllSquash" + + +class ShareAccessTier(str, Enum): + + transaction_optimized = "TransactionOptimized" + hot = "Hot" + cool = "Cool" + premium = "Premium" + + +class StorageAccountExpand(str, Enum): + + geo_replication_stats = "geoReplicationStats" + blob_restore_status = "blobRestoreStatus" + + +class ListKeyExpand(str, Enum): + + kerb = "kerb" + + +class ListContainersInclude(str, Enum): + + deleted = "deleted" + + +class ListSharesExpand(str, Enum): + + deleted = "deleted" + + +class GetShareExpand(str, Enum): + + stats = "stats" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/__init__.py new file mode 100644 index 000000000000..a99b721bf201 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/__init__.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 ._operations import Operations +from ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._deleted_accounts_operations import DeletedAccountsOperations +from ._usages_operations import UsagesOperations +from ._management_policies_operations import ManagementPoliciesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._object_replication_policies_operations import ObjectReplicationPoliciesOperations +from ._encryption_scopes_operations import EncryptionScopesOperations +from ._blob_services_operations import BlobServicesOperations +from ._blob_containers_operations import BlobContainersOperations +from ._file_services_operations import FileServicesOperations +from ._file_shares_operations import FileSharesOperations +from ._queue_services_operations import QueueServicesOperations +from ._queue_operations import QueueOperations +from ._table_services_operations import TableServicesOperations +from ._table_operations import TableOperations + +__all__ = [ + 'Operations', + 'SkusOperations', + 'StorageAccountsOperations', + 'DeletedAccountsOperations', + 'UsagesOperations', + 'ManagementPoliciesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ObjectReplicationPoliciesOperations', + 'EncryptionScopesOperations', + 'BlobServicesOperations', + 'BlobContainersOperations', + 'FileServicesOperations', + 'FileSharesOperations', + 'QueueServicesOperations', + 'QueueOperations', + 'TableServicesOperations', + 'TableOperations', +] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_containers_operations.py new file mode 100644 index 000000000000..157a9a230cd8 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_containers_operations.py @@ -0,0 +1,1153 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + :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 = "2020-08-01-preview" + self.immutability_policy_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, maxpagesize=None, filter=None, include=None, 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 maxpagesize: Optional. Specified maximum number of containers + that can be included in the list. + :type maxpagesize: str + :param filter: Optional. When specified, only container names starting + with the filter will be listed. + :type filter: str + :param include: Optional, used to include the properties for soft + deleted blob containers. Possible values include: 'deleted' + :type include: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.ListContainersInclude + :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 ListContainerItem + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.ListContainerItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.ListContainerItem] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # 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) + if maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if include is not None: + query_parameters['$include'] = self._serialize.query("include", include, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.ListContainerItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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, blob_container, 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 blob_container: Properties of the blob container to create. + :type blob_container: + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobContainer + :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.v2020_08_01_preview.models.BlobContainer + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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 [200, 201]: + 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 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, blob_container, 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 blob_container: Properties to update for the blob container. + :type blob_container: + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobContainer + :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.v2020_08_01_preview.models.BlobContainer + 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), + '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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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, if_match=None, immutability_period_since_creation_in_days=None, allow_protected_append_writes=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 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 allow_protected_append_writes: This property can only be + changed for unlocked time-based retention policies. When enabled, new + blocks can be written to an append blob while maintaining immutability + protection and compliance. Only new blocks can be added and any + existing blocks cannot be modified or deleted. This property cannot be + changed with ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool + :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.v2020_08_01_preview.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None or allow_protected_append_writes is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days, allow_protected_append_writes=allow_protected_append_writes) + + # 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 + + header_dict = {} + deserialized = None + 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.v2020_08_01_preview.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 + + header_dict = {} + deserialized = None + 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, the only way is to delete the container after deleting all + expired blobs inside the policy locked 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.v2020_08_01_preview.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 + + header_dict = {} + deserialized = None + 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.v2020_08_01_preview.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 + + header_dict = {} + deserialized = None + 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=None, allow_protected_append_writes=None, 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 allow_protected_append_writes: This property can only be + changed for unlocked time-based retention policies. When enabled, new + blocks can be written to an append blob while maintaining immutability + protection and compliance. Only new blocks can be added and any + existing blocks cannot be modified or deleted. This property cannot be + changed with ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool + :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.v2020_08_01_preview.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None or allow_protected_append_writes is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days, allow_protected_append_writes=allow_protected_append_writes) + + # 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 + + header_dict = {} + deserialized = None + 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'} + + def lease( + self, resource_group_name, account_name, container_name, parameters=None, custom_headers=None, raw=False, **operation_config): + """The Lease Container operation establishes and manages a lock on a + container for delete operations. The lock duration can be 15 to 60 + seconds, or can be infinite. + + :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 parameters: Lease Container request body. + :type parameters: + ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseContainerRequest + :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: LeaseContainerResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.LeaseContainerResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lease.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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseContainerRequest') + 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 + if response.status_code == 200: + deserialized = self._deserialize('LeaseContainerResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_services_operations.py new file mode 100644 index 000000000000..d2d03a28508d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_blob_services_operations.py @@ -0,0 +1,263 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 BlobServicesOperations(object): + """BlobServicesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + :ivar blob_services_name: The name of the blob Service within the specified storage account. Blob Service 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 = "2020-08-01-preview" + self.blob_services_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """List blob services of storage account. It returns a collection of one + object named default. + + :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: An iterator like instance of BlobServiceProperties + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobServicePropertiesPaged[~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceProperties] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # 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) + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.BlobServicePropertiesPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices'} + + def set_service_properties( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """Sets the properties of a storage account’s Blob service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. . + + :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 properties of a storage account’s Blob service, + including properties for Storage Analytics and CORS (Cross-Origin + Resource Sharing) rules. + :type parameters: + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceProperties + :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: BlobServiceProperties or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.set_service_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), + 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_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(parameters, 'BlobServiceProperties') + + # 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('BlobServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} + + def get_service_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of a storage account’s Blob service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. + + :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: BlobServiceProperties or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.BlobServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_service_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), + 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_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('BlobServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_deleted_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_deleted_accounts_operations.py new file mode 100644 index 000000000000..301eb3c1fe4d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_deleted_accounts_operations.py @@ -0,0 +1,164 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 .. import models + + +class DeletedAccountsOperations(object): + """DeletedAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists deleted accounts under the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeletedAccount + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeletedAccountPaged[~azure.mgmt.storage.v2020_08_01_preview.models.DeletedAccount] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeletedAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts'} + + def get( + self, deleted_account_name, location, custom_headers=None, raw=False, **operation_config): + """Get properties of specified deleted account resource. + + :param deleted_account_name: Name of the deleted storage account. + :type deleted_account_name: str + :param location: The location of the deleted storage account. + :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: DeletedAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.DeletedAccount + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'deletedAccountName': self._serialize.url("deleted_account_name", deleted_account_name, 'str', max_length=24, min_length=3), + 'location': self._serialize.url("location", location, '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 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeletedAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_encryption_scopes_operations.py new file mode 100644 index 000000000000..dbf9fbb4df97 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_encryption_scopes_operations.py @@ -0,0 +1,348 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 EncryptionScopesOperations(object): + """EncryptionScopesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-01-preview" + + self.config = config + + def put( + self, resource_group_name, account_name, encryption_scope_name, encryption_scope, custom_headers=None, raw=False, **operation_config): + """Synchronously creates or updates an encryption scope under the + specified storage account. If an encryption scope is already created + and a subsequent request is issued with different properties, the + encryption scope properties will be updated per the specified 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 encryption_scope_name: The name of the encryption scope within + the specified storage account. Encryption scope 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 encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for + the create or update. + :type encryption_scope: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + :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: EncryptionScope or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.put.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), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3) + } + 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(encryption_scope, 'EncryptionScope') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', response) + if response.status_code == 201: + deserialized = self._deserialize('EncryptionScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} + + def patch( + self, resource_group_name, account_name, encryption_scope_name, encryption_scope, custom_headers=None, raw=False, **operation_config): + """Update encryption scope properties as specified in the request body. + Update fails if the specified encryption scope does not 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 encryption_scope_name: The name of the encryption scope within + the specified storage account. Encryption scope 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 encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for + the update. + :type encryption_scope: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + :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: EncryptionScope or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.patch.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), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3) + } + 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(encryption_scope, 'EncryptionScope') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} + + def get( + self, resource_group_name, account_name, encryption_scope_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified encryption scope. + + :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 encryption_scope_name: The name of the encryption scope within + the specified storage account. Encryption scope 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 encryption_scope_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: EncryptionScope or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3) + } + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', 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}/encryptionScopes/{encryptionScopeName}'} + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists all the encryption scopes available under 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: An iterator like instance of EncryptionScope + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScopePaged[~azure.mgmt.storage.v2020_08_01_preview.models.EncryptionScope] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # 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) + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.EncryptionScopePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_services_operations.py new file mode 100644 index 000000000000..4ffdf17f732a --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_services_operations.py @@ -0,0 +1,256 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 FileServicesOperations(object): + """FileServicesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + :ivar file_services_name: The name of the file Service within the specified storage account. File Service 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 = "2020-08-01-preview" + self.file_services_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """List all file services in storage accounts. + + :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: FileServiceItems or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceItems 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('FileServiceItems', 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}/fileServices'} + + def set_service_properties( + self, resource_group_name, account_name, cors=None, share_delete_retention_policy=None, custom_headers=None, raw=False, **operation_config): + """Sets the properties of file services in storage accounts, including + CORS (Cross-Origin Resource Sharing) rules. . + + :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 cors: Specifies CORS rules for the File service. You can + include up to five CorsRule elements in the request. If no CorsRule + elements are included in the request body, all CORS rules will be + deleted, and CORS will be disabled for the File service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + :param share_delete_retention_policy: The file service properties for + share soft delete. + :type share_delete_retention_policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.DeleteRetentionPolicy + :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: FileServiceProperties or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.FileServiceProperties(cors=cors, share_delete_retention_policy=share_delete_retention_policy) + + # Construct URL + url = self.set_service_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), + 'FileServicesName': self._serialize.url("self.file_services_name", self.file_services_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(parameters, 'FileServiceProperties') + + # 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('FileServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} + + def get_service_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of file services in storage accounts, including + CORS (Cross-Origin Resource Sharing) rules. + + :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: FileServiceProperties or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.FileServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_service_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), + 'FileServicesName': self._serialize.url("self.file_services_name", self.file_services_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('FileServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_shares_operations.py new file mode 100644 index 000000000000..ac975f31d69d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_file_shares_operations.py @@ -0,0 +1,510 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 FileSharesOperations(object): + """FileSharesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-01-preview" + + self.config = config + + def list( + self, resource_group_name, account_name, maxpagesize=None, filter=None, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all shares. + + :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 maxpagesize: Optional. Specified maximum number of shares that + can be included in the list. + :type maxpagesize: str + :param filter: Optional. When specified, only share names starting + with the filter will be listed. + :type filter: str + :param expand: Optional, used to expand the properties within share's + properties. Possible values include: 'deleted' + :type expand: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.ListSharesExpand + :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 FileShareItem + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.FileShareItemPaged[~azure.mgmt.storage.v2020_08_01_preview.models.FileShareItem] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # 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) + if maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'ListSharesExpand') + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.FileShareItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares'} + + def create( + self, resource_group_name, account_name, share_name, file_share, custom_headers=None, raw=False, **operation_config): + """Creates a new share under the specified account as described by request + body. The share resource includes metadata and properties for that + share. It does not include a list of the files contained by the share. + . + + :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 share_name: The name of the file share within the specified + storage account. File share 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 share_name: str + :param file_share: Properties of the file share to create. + :type file_share: + ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare + :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: FileShare or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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), + 'shareName': self._serialize.url("share_name", share_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(file_share, 'FileShare') + + # 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, 201]: + 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('FileShare', response) + if response.status_code == 201: + deserialized = self._deserialize('FileShare', 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}/fileServices/default/shares/{shareName}'} + + def update( + self, resource_group_name, account_name, share_name, file_share, custom_headers=None, raw=False, **operation_config): + """Updates share properties as specified in request body. Properties not + mentioned in the request will not be changed. Update fails if the + specified share does not 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 share_name: The name of the file share within the specified + storage account. File share 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 share_name: str + :param file_share: Properties to update for the file share. + :type file_share: + ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare + :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: FileShare or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare 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), + 'shareName': self._serialize.url("share_name", share_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(file_share, 'FileShare') + + # 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('FileShare', 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}/fileServices/default/shares/{shareName}'} + + def get( + self, resource_group_name, account_name, share_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets properties of a specified share. + + :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 share_name: The name of the file share within the specified + storage account. File share 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 share_name: str + :param expand: Optional, used to expand the properties within share's + properties. Possible values include: 'stats' + :type expand: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.GetShareExpand + :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: FileShare or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.FileShare 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), + 'shareName': self._serialize.url("share_name", share_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) + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'GetShareExpand') + + # 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('FileShare', 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}/fileServices/default/shares/{shareName}'} + + def delete( + self, resource_group_name, account_name, share_name, custom_headers=None, raw=False, **operation_config): + """Deletes specified share 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 share_name: The name of the file share within the specified + storage account. File share 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 share_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), + 'shareName': self._serialize.url("share_name", share_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}/fileServices/default/shares/{shareName}'} + + def restore( + self, resource_group_name, account_name, share_name, deleted_share_name, deleted_share_version, custom_headers=None, raw=False, **operation_config): + """Restore a file share within a valid retention days if share soft delete + is enabled. + + :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 share_name: The name of the file share within the specified + storage account. File share 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 share_name: str + :param deleted_share_name: Required. Identify the name of the deleted + share that will be restored. + :type deleted_share_name: str + :param deleted_share_version: Required. Identify the version of the + deleted share that will be restored. + :type deleted_share_version: 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` + """ + deleted_share = models.DeletedShare(deleted_share_name=deleted_share_name, deleted_share_version=deleted_share_version) + + # Construct URL + url = self.restore.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), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(deleted_share, 'DeletedShare') + + # 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_management_policies_operations.py new file mode 100644 index 000000000000..d7ba3f58612e --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_management_policies_operations.py @@ -0,0 +1,244 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-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 = "2020-08-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 managementpolicy 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: ManagementPolicy or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicy 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('ManagementPolicy', 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, custom_headers=None, raw=False, **operation_config): + """Sets the managementpolicy to 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 ManagementPolicy, in JSON format. + See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicySchema + :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: ManagementPolicy or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.ManagementPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + properties = models.ManagementPolicy(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, 'ManagementPolicy') + + # 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('ManagementPolicy', 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 managementpolicy 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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_object_replication_policies_operations.py new file mode 100644 index 000000000000..6ad99ae790fe --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_object_replication_policies_operations.py @@ -0,0 +1,318 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 .. import models + + +class ObjectReplicationPoliciesOperations(object): + """ObjectReplicationPoliciesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-01-preview" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """List the object replication policies associated with the 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: An iterator like instance of ObjectReplicationPolicy + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicyPaged[~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicy] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # 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) + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ObjectReplicationPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies'} + + def get( + self, resource_group_name, account_name, object_replication_policy_id, custom_headers=None, raw=False, **operation_config): + """Get the object replication policy of the storage account by policy ID. + + :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 object_replication_policy_id: The ID of object replication + policy or 'default' if the policy ID is unknown. + :type object_replication_policy_id: 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: ObjectReplicationPolicy or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicy + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ObjectReplicationPolicy', 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}/objectReplicationPolicies/{objectReplicationPolicyId}'} + + def create_or_update( + self, resource_group_name, account_name, object_replication_policy_id, properties, custom_headers=None, raw=False, **operation_config): + """Create or update the object replication policy of the 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 object_replication_policy_id: The ID of object replication + policy or 'default' if the policy ID is unknown. + :type object_replication_policy_id: str + :param properties: The object replication policy set to a storage + account. A unique policy ID will be created if absent. + :type properties: + ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicy + :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: ObjectReplicationPolicy or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.ObjectReplicationPolicy + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_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(properties, 'ObjectReplicationPolicy') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ObjectReplicationPolicy', 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}/objectReplicationPolicies/{objectReplicationPolicyId}'} + + def delete( + self, resource_group_name, account_name, object_replication_policy_id, custom_headers=None, raw=False, **operation_config): + """Deletes the object replication policy 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 object_replication_policy_id: The ID of object replication + policy or 'default' if the policy ID is unknown. + :type object_replication_policy_id: 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:`ErrorResponseException` + """ + # 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), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_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]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_operations.py new file mode 100644 index 000000000000..7695d8fffa81 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-01-preview" + + 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.v2020_08_01_preview.models.OperationPaged[~azure.mgmt.storage.v2020_08_01_preview.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..53edb7918f1e --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,321 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-01-preview" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """List all the private endpoint connections associated with the 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: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnectionPaged[~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # 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) + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections'} + + def get( + self, resource_group_name, account_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified private endpoint connection associated with the + 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 private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', 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}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def put( + self, resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, **operation_config): + """Update the state of specified private endpoint connection associated + with the 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 private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection + :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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateEndpointConnection + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.put.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), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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, 'PrivateEndpointConnection') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def delete( + self, resource_group_name, account_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Deletes the specified private endpoint connection associated with the + 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 private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_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:`ErrorResponseException` + """ + # 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), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..5b02fefb4cbf --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_private_link_resources_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-01-preview" + + self.config = config + + def list_by_storage_account( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for 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 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: PrivateLinkResourceListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.PrivateLinkResourceListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_storage_account.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('PrivateLinkResourceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_storage_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_operations.py new file mode 100644 index 000000000000..b14c5fcb4b78 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_operations.py @@ -0,0 +1,421 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 QueueOperations(object): + """QueueOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-01-preview" + + self.config = config + + def create( + self, resource_group_name, account_name, queue_name, metadata=None, custom_headers=None, raw=False, **operation_config): + """Creates a new queue with the specified queue name, under the specified + 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 queue_name: A queue name must be unique within a storage + account and must be between 3 and 63 characters.The name must comprise + of lowercase alphanumeric and dash(-) characters only, it should begin + and end with an alphanumeric character and it cannot have two + consecutive dash(-) characters. + :type queue_name: str + :param metadata: A name-value pair that represents queue 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: StorageQueue or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + queue = models.StorageQueue(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), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$') + } + 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(queue, 'StorageQueue') + + # 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('StorageQueue', 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}/queueServices/default/queues/{queueName}'} + + def update( + self, resource_group_name, account_name, queue_name, metadata=None, custom_headers=None, raw=False, **operation_config): + """Creates a new queue with the specified queue name, under the specified + 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 queue_name: A queue name must be unique within a storage + account and must be between 3 and 63 characters.The name must comprise + of lowercase alphanumeric and dash(-) characters only, it should begin + and end with an alphanumeric character and it cannot have two + consecutive dash(-) characters. + :type queue_name: str + :param metadata: A name-value pair that represents queue 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: StorageQueue or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + queue = models.StorageQueue(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), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$') + } + 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(queue, 'StorageQueue') + + # 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('StorageQueue', 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}/queueServices/default/queues/{queueName}'} + + def get( + self, resource_group_name, account_name, queue_name, custom_headers=None, raw=False, **operation_config): + """Gets the queue with the specified queue name, under the specified + account if it exists. + + :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 queue_name: A queue name must be unique within a storage + account and must be between 3 and 63 characters.The name must comprise + of lowercase alphanumeric and dash(-) characters only, it should begin + and end with an alphanumeric character and it cannot have two + consecutive dash(-) characters. + :type queue_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: StorageQueue or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageQueue 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), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$') + } + 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('StorageQueue', 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}/queueServices/default/queues/{queueName}'} + + def delete( + self, resource_group_name, account_name, queue_name, custom_headers=None, raw=False, **operation_config): + """Deletes the queue with the specified queue name, under the specified + account if it exists. + + :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 queue_name: A queue name must be unique within a storage + account and must be between 3 and 63 characters.The name must comprise + of lowercase alphanumeric and dash(-) characters only, it should begin + and end with an alphanumeric character and it cannot have two + consecutive dash(-) characters. + :type queue_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), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$') + } + 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 [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}/queueServices/default/queues/{queueName}'} + + def list( + self, resource_group_name, account_name, maxpagesize=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of all the queues under 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 maxpagesize: Optional, a maximum number of queues that should + be included in a list queue response + :type maxpagesize: str + :param filter: Optional, When specified, only the queues with a name + starting with the given filter will be listed. + :type filter: 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 ListQueue + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.ListQueuePaged[~azure.mgmt.storage.v2020_08_01_preview.models.ListQueue] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # 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) + if maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.ListQueuePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_services_operations.py new file mode 100644 index 000000000000..fbda6995ab29 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_queue_services_operations.py @@ -0,0 +1,254 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 QueueServicesOperations(object): + """QueueServicesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + :ivar queue_service_name: The name of the Queue Service within the specified storage account. Queue Service 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 = "2020-08-01-preview" + self.queue_service_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """List all queue services for the 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: ListQueueServices or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.ListQueueServices 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('ListQueueServices', 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}/queueServices'} + + def set_service_properties( + self, resource_group_name, account_name, cors=None, custom_headers=None, raw=False, **operation_config): + """Sets the properties of a storage account’s Queue service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. . + + :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 cors: Specifies CORS rules for the Queue service. You can + include up to five CorsRule elements in the request. If no CorsRule + elements are included in the request body, all CORS rules will be + deleted, and CORS will be disabled for the Queue service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + :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: QueueServiceProperties or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.QueueServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.QueueServiceProperties(cors=cors) + + # Construct URL + url = self.set_service_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), + 'queueServiceName': self._serialize.url("self.queue_service_name", self.queue_service_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(parameters, 'QueueServiceProperties') + + # 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('QueueServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'} + + def get_service_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of a storage account’s Queue service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. + + :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: QueueServiceProperties or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.QueueServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_service_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), + 'queueServiceName': self._serialize.url("self.queue_service_name", self.queue_service_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('QueueServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_skus_operations.py new file mode 100644 index 000000000000..03f48e3354c1 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_skus_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-01-preview" + + 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 SkuInformation + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.SkuInformationPaged[~azure.mgmt.storage.v2020_08_01_preview.models.SkuInformation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.SkuInformationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..70563129dd7a --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_storage_accounts_operations.py @@ -0,0 +1,1111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-01-preview" + + 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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2020_08_01_preview.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, expand=None, 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 expand: May be used to expand the properties within account's + properties. By default, data is not included when fetching properties. + Currently we only support geoReplicationStats and blobRestoreStatus. + Possible values include: 'geoReplicationStats', 'blobRestoreStatus' + :type expand: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountExpand + :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.v2020_08_01_preview.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) + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'StorageAccountExpand') + + # 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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.models.StorageAccountPaged[~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2020_08_01_preview.models.StorageAccountPaged[~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists the access keys or Kerberos keys (if active directory enabled) + 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 expand: Specifies type of the key to be listed. Possible value + is kerb. Possible values include: 'kerb' + :type expand: str or + ~azure.mgmt.storage.v2020_08_01_preview.models.ListKeyExpand + :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.v2020_08_01_preview.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) + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'ListKeyExpand') + + # 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 or Kerberos 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 values are key1, key2, kerb1, kerb2. + :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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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.v2020_08_01_preview.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'} + + + def _failover_initial( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.failover.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.post(url, query_parameters, header_parameters) + 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def failover( + self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Failover request can be triggered for a storage account in case of + availability issues. The failover occurs from the storage account's + primary cluster to secondary cluster for RA-GRS accounts. The secondary + cluster will become primary after failover. + + :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: 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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._failover_initial( + resource_group_name=resource_group_name, + account_name=account_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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) + failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} + + + def _restore_blob_ranges_initial( + self, resource_group_name, account_name, time_to_restore, blob_ranges, custom_headers=None, raw=False, **operation_config): + parameters = models.BlobRestoreParameters(time_to_restore=time_to_restore, blob_ranges=blob_ranges) + + # Construct URL + url = self.restore_blob_ranges.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, 'BlobRestoreParameters') + + # 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, 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('BlobRestoreStatus', response) + if response.status_code == 202: + deserialized = self._deserialize('BlobRestoreStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def restore_blob_ranges( + self, resource_group_name, account_name, time_to_restore, blob_ranges, custom_headers=None, raw=False, polling=True, **operation_config): + """Restore blobs in the specified blob ranges. + + :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 time_to_restore: Restore blob to the specified time. + :type time_to_restore: datetime + :param blob_ranges: Blob ranges to restore. + :type blob_ranges: + list[~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreRange] + :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 BlobRestoreStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._restore_blob_ranges_initial( + resource_group_name=resource_group_name, + account_name=account_name, + time_to_restore=time_to_restore, + blob_ranges=blob_ranges, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BlobRestoreStatus', 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, lro_options={'final-state-via': 'location'}, **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) + restore_blob_ranges.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges'} + + def revoke_user_delegation_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Revoke user delegation 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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.revoke_user_delegation_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 = {} + 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + revoke_user_delegation_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_operations.py new file mode 100644 index 000000000000..c0c196eef5a9 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_operations.py @@ -0,0 +1,391 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 TableOperations(object): + """TableOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-01-preview" + + self.config = config + + def create( + self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, **operation_config): + """Creates a new table with the specified table name, under the specified + 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 table_name: A table name must be unique within a storage + account and must be between 3 and 63 characters.The name must comprise + of only alphanumeric characters and it cannot begin with a numeric + character. + :type table_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: Table or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.Table or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$') + } + 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.put(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('Table', 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}/tableServices/default/tables/{tableName}'} + + def update( + self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, **operation_config): + """Creates a new table with the specified table name, under the specified + 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 table_name: A table name must be unique within a storage + account and must be between 3 and 63 characters.The name must comprise + of only alphanumeric characters and it cannot begin with a numeric + character. + :type table_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: Table or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.Table 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), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$') + } + 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.patch(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('Table', 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}/tableServices/default/tables/{tableName}'} + + def get( + self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, **operation_config): + """Gets the table with the specified table name, under the specified + account if it exists. + + :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 table_name: A table name must be unique within a storage + account and must be between 3 and 63 characters.The name must comprise + of only alphanumeric characters and it cannot begin with a numeric + character. + :type table_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: Table or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2020_08_01_preview.models.Table 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), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$') + } + 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('Table', 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}/tableServices/default/tables/{tableName}'} + + def delete( + self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, **operation_config): + """Deletes the table with the specified table name, under the specified + account if it exists. + + :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 table_name: A table name must be unique within a storage + account and must be between 3 and 63 characters.The name must comprise + of only alphanumeric characters and it cannot begin with a numeric + character. + :type table_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), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$') + } + 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 [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}/tableServices/default/tables/{tableName}'} + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of all the tables under 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: An iterator like instance of Table + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.TablePaged[~azure.mgmt.storage.v2020_08_01_preview.models.Table] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # 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) + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.TablePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_services_operations.py new file mode 100644 index 000000000000..3459de68ed0a --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_table_services_operations.py @@ -0,0 +1,254 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 TableServicesOperations(object): + """TableServicesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + :ivar table_service_name: The name of the Table Service within the specified storage account. Table Service 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 = "2020-08-01-preview" + self.table_service_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """List all table services for the 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: ListTableServices or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.ListTableServices 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('ListTableServices', 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}/tableServices'} + + def set_service_properties( + self, resource_group_name, account_name, cors=None, custom_headers=None, raw=False, **operation_config): + """Sets the properties of a storage account’s Table service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. . + + :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 cors: Specifies CORS rules for the Table service. You can + include up to five CorsRule elements in the request. If no CorsRule + elements are included in the request body, all CORS rules will be + deleted, and CORS will be disabled for the Table service. + :type cors: ~azure.mgmt.storage.v2020_08_01_preview.models.CorsRules + :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: TableServiceProperties or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.TableServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.TableServiceProperties(cors=cors) + + # Construct URL + url = self.set_service_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), + 'tableServiceName': self._serialize.url("self.table_service_name", self.table_service_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(parameters, 'TableServiceProperties') + + # 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('TableServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}'} + + def get_service_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of a storage account’s Table service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. + + :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: TableServiceProperties or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2020_08_01_preview.models.TableServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_service_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), + 'tableServiceName': self._serialize.url("self.table_service_name", self.table_service_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('TableServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_usages_operations.py new file mode 100644 index 000000000000..6c3d6d874be2 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_usages_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-01-preview" + + 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.v2020_08_01_preview.models.UsagePaged[~azure.mgmt.storage.v2020_08_01_preview.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/version.py new file mode 100644 index 000000000000..9bad416cbbe0 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/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 = "2020-08-01-preview" +