From ba9f1d90a281bac6c6219949524aa151ada890f3 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 17 Jul 2019 01:14:40 -0700 Subject: [PATCH 01/10] [AutoPR storage/resource-manager] [Bug fix] Remove read-only constraint for management policy (#6233) * Generated from 00d9e1b50ab5daed68696f0b0c612e912acde7db [Bug fix] Remove read-only constraint for management policy * Packaging update of azure-mgmt-storage * Generated from 0e6f149f5338b7fe8256adb51584a22aaecdb407 change type to number * Generated from 870609e2d01b2e64b589a0eb07e938f19282f4f0 Modify description, remove integer --- sdk/storage/azure-mgmt-storage/README.rst | 2 +- .../storage/_storage_management_client.py | 3 +-- .../azure/mgmt/storage/models.py | 8 ------- .../storage/v2019_04_01/models/_models.py | 20 ++++++++-------- .../storage/v2019_04_01/models/_models_py3.py | 24 +++++++++---------- sdk/storage/azure-mgmt-storage/setup.py | 1 - 6 files changed, 24 insertions(+), 34 deletions(-) diff --git a/sdk/storage/azure-mgmt-storage/README.rst b/sdk/storage/azure-mgmt-storage/README.rst index e8a573239aa7..5b9e52dc5b2d 100644 --- a/sdk/storage/azure-mgmt-storage/README.rst +++ b/sdk/storage/azure-mgmt-storage/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Storage Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. +This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. 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 3db1f662464e..6bacfbc7f4d0 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 @@ -14,7 +14,6 @@ from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin -from .version import VERSION from ._configuration import StorageManagementClientConfiguration @@ -51,8 +50,8 @@ class StorageManagementClient(MultiApiClientMixin, SDKClient): _PROFILE_TAG = "azure.mgmt.storage.StorageManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { + None: DEFAULT_API_VERSION, 'usage': '2018-02-01', - None: DEFAULT_API_VERSION }}, _PROFILE_TAG + " latest" ) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/models.py index 7e77a50bfd13..2020d3f71048 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/models.py @@ -4,13 +4,5 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from .v2015_06_15.models import * -from .v2016_01_01.models import * -from .v2016_12_01.models import * -from .v2017_06_01.models import * -from .v2017_10_01.models import * from .v2018_02_01.models import * -from .v2018_03_01_preview.models import * -from .v2018_07_01.models import * -from .v2018_11_01.models import * from .v2019_04_01.models import * diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py index 8861ef04f4fe..1ba485897e42 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py @@ -488,17 +488,17 @@ class DateAfterCreation(Model): All required parameters must be populated in order to send to Azure. - :param days_after_creation_greater_than: Required. Integer value - indicating the age in days after creation - :type days_after_creation_greater_than: int + :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}, + 'days_after_creation_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, } _attribute_map = { - 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'int'}, + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'float'}, } def __init__(self, **kwargs): @@ -511,17 +511,17 @@ class DateAfterModification(Model): All required parameters must be populated in order to send to Azure. - :param days_after_modification_greater_than: Required. Integer value - indicating the age in days after last modification - :type days_after_modification_greater_than: int + :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}, + 'days_after_modification_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, } _attribute_map = { - 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'int'}, + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'float'}, } def __init__(self, **kwargs): diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py index 42f4cb5b84f5..8fa4822992dd 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py @@ -488,20 +488,20 @@ class DateAfterCreation(Model): All required parameters must be populated in order to send to Azure. - :param days_after_creation_greater_than: Required. Integer value - indicating the age in days after creation - :type days_after_creation_greater_than: int + :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}, + 'days_after_creation_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, } _attribute_map = { - 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'int'}, + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'float'}, } - def __init__(self, *, days_after_creation_greater_than: int, **kwargs) -> None: + 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 @@ -511,20 +511,20 @@ class DateAfterModification(Model): All required parameters must be populated in order to send to Azure. - :param days_after_modification_greater_than: Required. Integer value - indicating the age in days after last modification - :type days_after_modification_greater_than: int + :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}, + 'days_after_modification_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, } _attribute_map = { - 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'int'}, + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'float'}, } - def __init__(self, *, days_after_modification_greater_than: int, **kwargs) -> None: + 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 diff --git a/sdk/storage/azure-mgmt-storage/setup.py b/sdk/storage/azure-mgmt-storage/setup.py index 8bef269c261e..8609a1e171a7 100644 --- a/sdk/storage/azure-mgmt-storage/setup.py +++ b/sdk/storage/azure-mgmt-storage/setup.py @@ -64,7 +64,6 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', From 972afa450cf9c06c30af9c2cab3323e078bcc330 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 29 Jul 2019 15:29:25 -0700 Subject: [PATCH 02/10] Generated from 2e78b5cbe1e0ef6676f9d9c3266b48cfe87403fd (#6536) fix typo --- .../storage/v2019_04_01/models/__init__.py | 2 + .../v2019_04_01/models/_paged_models.py | 13 ++++ .../operations/_blob_services_operations.py | 76 +++++++++++++++++++ 3 files changed, 91 insertions(+) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py index 68d5bcd5f9a7..02d358f3412e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py @@ -135,6 +135,7 @@ from ._models import Usage from ._models import UsageName from ._models import VirtualNetworkRule +from ._paged_models import BlobServicePropertiesPaged from ._paged_models import ListContainerItemPaged from ._paged_models import OperationPaged from ._paged_models import SkuPaged @@ -239,6 +240,7 @@ 'SkuPaged', 'StorageAccountPaged', 'UsagePaged', + 'BlobServicePropertiesPaged', 'ListContainerItemPaged', 'ReasonCode', 'SkuName', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_paged_models.py index 753f43a46ea8..9bdfb7303a88 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_paged_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_paged_models.py @@ -64,6 +64,19 @@ class UsagePaged(Paged): def __init__(self, *args, **kwargs): super(UsagePaged, 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 diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_services_operations.py index f4da4bd3f6f8..1e50f320bcfe 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_services_operations.py @@ -41,6 +41,82 @@ def __init__(self, client, config, serializer, deserializer): 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.v2019_04_01.models.BlobServicePropertiesPaged[~azure.mgmt.storage.v2019_04_01.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 From b4d0f236e338c8d9c771f434e338887791d372bd Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 2 Aug 2019 12:59:00 -0700 Subject: [PATCH 03/10] [AutoPR storage/resource-manager] updating description - clarify encryption enabled by default (#5978) * Generated from 1929243cc853b5f21c5e6cef8a2867fb4d26b4dc updating description - clarify encryption enabled by default * Generated from 1929243cc853b5f21c5e6cef8a2867fb4d26b4dc updating description - clarify encryption enabled by default --- .../azure/mgmt/storage/v2019_04_01/models/_models.py | 5 ++--- .../azure/mgmt/storage/v2019_04_01/models/_models_py3.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py index 1ba485897e42..9de28a532866 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py @@ -2226,9 +2226,8 @@ class StorageAccountCreateParameters(Model): 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.v2019_04_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. + :param encryption: Not applicable. Azure Storage encryption is enabled for + all storage accounts and cannot be disabled. :type encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption :param network_rule_set: Network rule set :type network_rule_set: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py index 8fa4822992dd..b9479ad73da1 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py @@ -2226,9 +2226,8 @@ class StorageAccountCreateParameters(Model): 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.v2019_04_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. + :param encryption: Not applicable. Azure Storage encryption is enabled for + all storage accounts and cannot be disabled. :type encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption :param network_rule_set: Network rule set :type network_rule_set: From 8e1f6060e4be004267f33409cafefccdb0ca625e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 9 Aug 2019 08:50:23 -0700 Subject: [PATCH 04/10] Generated from 3acbc3b4106db3097de5be5e4df47afb38d51ec0 (#6735) Use cors definition from blob.json --- .../storage/_storage_management_client.py | 26 ++ .../v2019_04_01/_storage_management_client.py | 10 + .../storage/v2019_04_01/models/__init__.py | 15 + .../storage/v2019_04_01/models/_models.py | 262 +++++++++++ .../storage/v2019_04_01/models/_models_py3.py | 262 +++++++++++ .../v2019_04_01/operations/__init__.py | 4 + .../operations/_file_services_operations.py | 245 ++++++++++ .../operations/_file_shares_operations.py | 420 ++++++++++++++++++ 8 files changed, 1244 insertions(+) create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py 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 6bacfbc7f4d0..55a44cdd62b7 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 @@ -160,6 +160,32 @@ def blob_services(self): 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 file_services(self): + """Instance depends on the API version: + + * 2019-04-01: :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 + 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 file_shares(self): + """Instance depends on the API version: + + * 2019-04-01: :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 + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def management_policies(self): """Instance depends on the API version: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_storage_management_client.py index 94c3a1b0bdea..8e55758b8f70 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_storage_management_client.py @@ -20,6 +20,8 @@ from .operations import ManagementPoliciesOperations from .operations import BlobServicesOperations from .operations import BlobContainersOperations +from .operations import FileServicesOperations +from .operations import FileSharesOperations from . import models @@ -43,6 +45,10 @@ class StorageManagementClient(SDKClient): :vartype blob_services: azure.mgmt.storage.v2019_04_01.operations.BlobServicesOperations :ivar blob_containers: BlobContainers operations :vartype blob_containers: azure.mgmt.storage.v2019_04_01.operations.BlobContainersOperations + :ivar file_services: FileServices operations + :vartype file_services: azure.mgmt.storage.v2019_04_01.operations.FileServicesOperations + :ivar file_shares: FileShares operations + :vartype file_shares: azure.mgmt.storage.v2019_04_01.operations.FileSharesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -77,3 +83,7 @@ def __init__( 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) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py index 02d358f3412e..b0ac56864838 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py @@ -27,6 +27,11 @@ from ._models_py3 import EncryptionService from ._models_py3 import EncryptionServices from ._models_py3 import Endpoints + from ._models_py3 import FileServiceItems + from ._models_py3 import FileServiceProperties + from ._models_py3 import FileShare + from ._models_py3 import FileShareItem + from ._models_py3 import FileShareItems from ._models_py3 import GeoReplicationStats from ._models_py3 import Identity from ._models_py3 import ImmutabilityPolicy @@ -90,6 +95,11 @@ from ._models import EncryptionService from ._models import EncryptionServices from ._models import Endpoints + from ._models import FileServiceItems + from ._models import FileServiceProperties + from ._models import FileShare + from ._models import FileShareItem + from ._models import FileShareItems from ._models import GeoReplicationStats from ._models import Identity from ._models import ImmutabilityPolicy @@ -191,6 +201,11 @@ 'EncryptionService', 'EncryptionServices', 'Endpoints', + 'FileServiceItems', + 'FileServiceProperties', + 'FileShare', + 'FileShareItem', + 'FileShareItems', 'GeoReplicationStats', 'Identity', 'ImmutabilityPolicy', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py index 9de28a532866..be20426fbaa4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class AccountSasParameters(Model): @@ -726,6 +727,267 @@ def __init__(self, **kwargs): self.dfs = None +class ErrorResponse(Model): + """An error response from the Storage service. + + :param error: + :type error: ~azure.mgmt.storage.v2019_04_01.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): + """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.v2019_04_01.models.ErrorResponseBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponseBody, 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 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.v2019_04_01.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.v2019_04_01.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(FileServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', 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). + :type share_quota: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 5120, 'minimum': 1}, + } + + _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'}, + } + + 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) + + +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). + :type share_quota: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 5120, 'minimum': 1}, + } + + _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'}, + } + + 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) + + +class FileShareItems(Model): + """Response schema. Contains list of shares returned, and if paging is + requested or required, a URL to next page of shares. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of file shares returned. + :vartype value: list[~azure.mgmt.storage.v2019_04_01.models.FileShareItem] + :ivar next_link: Request URL that can be used to query next page of + shares. Returned when total number of requested shares exceed maximum page + size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileShareItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FileShareItems, self).__init__(**kwargs) + self.value = None + self.next_link = 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 diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py index b9479ad73da1..458b800137f2 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class AccountSasParameters(Model): @@ -726,6 +727,267 @@ def __init__(self, **kwargs) -> None: self.dfs = None +class ErrorResponse(Model): + """An error response from the Storage service. + + :param error: + :type error: ~azure.mgmt.storage.v2019_04_01.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): + """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.v2019_04_01.models.ErrorResponseBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +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.v2019_04_01.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.v2019_04_01.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(FileServiceProperties, self).__init__(**kwargs) + self.cors = cors + + +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). + :type share_quota: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 5120, 'minimum': 1}, + } + + _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'}, + } + + def __init__(self, *, metadata=None, share_quota: int=None, **kwargs) -> None: + super(FileShare, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = metadata + self.share_quota = share_quota + + +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). + :type share_quota: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 5120, 'minimum': 1}, + } + + _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'}, + } + + def __init__(self, *, metadata=None, share_quota: int=None, **kwargs) -> None: + super(FileShareItem, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = metadata + self.share_quota = share_quota + + +class FileShareItems(Model): + """Response schema. Contains list of shares returned, and if paging is + requested or required, a URL to next page of shares. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of file shares returned. + :vartype value: list[~azure.mgmt.storage.v2019_04_01.models.FileShareItem] + :ivar next_link: Request URL that can be used to query next page of + shares. Returned when total number of requested shares exceed maximum page + size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileShareItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(FileShareItems, self).__init__(**kwargs) + self.value = None + self.next_link = 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 diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/__init__.py index 7bb554454062..ca747d46755f 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/__init__.py @@ -16,6 +16,8 @@ from ._management_policies_operations import ManagementPoliciesOperations from ._blob_services_operations import BlobServicesOperations from ._blob_containers_operations import BlobContainersOperations +from ._file_services_operations import FileServicesOperations +from ._file_shares_operations import FileSharesOperations __all__ = [ 'Operations', @@ -25,4 +27,6 @@ 'ManagementPoliciesOperations', 'BlobServicesOperations', 'BlobContainersOperations', + 'FileServicesOperations', + 'FileSharesOperations', ] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py new file mode 100644 index 000000000000..346875c3c6e5 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py @@ -0,0 +1,245 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 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: "2019-04-01". + :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 = "2019-04-01" + 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.v2019_04_01.models.FileServiceItems or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + 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 put_service_properties( + self, resource_group_name, account_name, cors=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.v2019_04_01.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: FileServiceProperties or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.FileServiceProperties(cors=cors) + + # Construct URL + url = self.put_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]: + raise models.ErrorResponseException(self._deserialize, response) + + 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 + put_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.v2019_04_01.models.FileServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + 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/v2019_04_01/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py new file mode 100644 index 000000000000..70035e2f650c --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py @@ -0,0 +1,420 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 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: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, resource_group_name, account_name, skip_token=None, maxpagesize=None, filter=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 skip_token: Optional. Continuation token for the list + operation. + :type skip_token: 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 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: FileShareItems or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShareItems or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + 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') + + # 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('FileShareItems', 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/default/shares'} + + def create( + self, resource_group_name, account_name, share_name, metadata=None, share_quota=None, 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 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). + :type share_quota: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: FileShare or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShare or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + file_share = models.FileShare(metadata=metadata, share_quota=share_quota) + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + 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, metadata=None, share_quota=None, 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 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). + :type share_quota: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: FileShare or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShare or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + file_share = models.FileShare(metadata=metadata, share_quota=share_quota) + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + 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, 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 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.v2019_04_01.models.FileShare 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), + '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' + 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('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:`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), + '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]: + 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}/fileServices/default/shares/{shareName}'} From 57babb6cd6538adadb30bf854e15896987ea4833 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 27 Aug 2019 18:54:53 -0700 Subject: [PATCH 05/10] Generated from 94667089d429b4f1aca38e60f85b13f5c0039219 (#6884) Align File swagger with the Blob swagger --- .../storage/v2019_04_01/models/__init__.py | 5 +- .../storage/v2019_04_01/models/_models.py | 31 ------ .../storage/v2019_04_01/models/_models_py3.py | 31 ------ .../v2019_04_01/models/_paged_models.py | 13 +++ .../operations/_file_services_operations.py | 6 +- .../operations/_file_shares_operations.py | 101 ++++++++++-------- 6 files changed, 74 insertions(+), 113 deletions(-) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py index b0ac56864838..418bd1796145 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py @@ -31,7 +31,6 @@ from ._models_py3 import FileServiceProperties from ._models_py3 import FileShare from ._models_py3 import FileShareItem - from ._models_py3 import FileShareItems from ._models_py3 import GeoReplicationStats from ._models_py3 import Identity from ._models_py3 import ImmutabilityPolicy @@ -99,7 +98,6 @@ from ._models import FileServiceProperties from ._models import FileShare from ._models import FileShareItem - from ._models import FileShareItems from ._models import GeoReplicationStats from ._models import Identity from ._models import ImmutabilityPolicy @@ -146,6 +144,7 @@ from ._models import UsageName from ._models import VirtualNetworkRule from ._paged_models import BlobServicePropertiesPaged +from ._paged_models import FileShareItemPaged from ._paged_models import ListContainerItemPaged from ._paged_models import OperationPaged from ._paged_models import SkuPaged @@ -205,7 +204,6 @@ 'FileServiceProperties', 'FileShare', 'FileShareItem', - 'FileShareItems', 'GeoReplicationStats', 'Identity', 'ImmutabilityPolicy', @@ -257,6 +255,7 @@ 'UsagePaged', 'BlobServicePropertiesPaged', 'ListContainerItemPaged', + 'FileShareItemPaged', 'ReasonCode', 'SkuName', 'SkuTier', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py index be20426fbaa4..76f675a1d708 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py @@ -957,37 +957,6 @@ def __init__(self, **kwargs): self.share_quota = kwargs.get('share_quota', None) -class FileShareItems(Model): - """Response schema. Contains list of shares returned, and if paging is - requested or required, a URL to next page of shares. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: List of file shares returned. - :vartype value: list[~azure.mgmt.storage.v2019_04_01.models.FileShareItem] - :ivar next_link: Request URL that can be used to query next page of - shares. Returned when total number of requested shares exceed maximum page - size. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FileShareItem]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(FileShareItems, self).__init__(**kwargs) - self.value = None - self.next_link = 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 diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py index 458b800137f2..6949750c6955 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py @@ -957,37 +957,6 @@ def __init__(self, *, metadata=None, share_quota: int=None, **kwargs) -> None: self.share_quota = share_quota -class FileShareItems(Model): - """Response schema. Contains list of shares returned, and if paging is - requested or required, a URL to next page of shares. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: List of file shares returned. - :vartype value: list[~azure.mgmt.storage.v2019_04_01.models.FileShareItem] - :ivar next_link: Request URL that can be used to query next page of - shares. Returned when total number of requested shares exceed maximum page - size. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FileShareItem]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(FileShareItems, self).__init__(**kwargs) - self.value = None - self.next_link = 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 diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_paged_models.py index 9bdfb7303a88..b1c9ac4fe23c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_paged_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_paged_models.py @@ -90,3 +90,16 @@ class ListContainerItemPaged(Paged): 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) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py index 346875c3c6e5..2f69fef9ccbf 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py @@ -103,7 +103,7 @@ def list( return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices'} - def put_service_properties( + def set_service_properties( self, resource_group_name, account_name, cors=None, custom_headers=None, raw=False, **operation_config): """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. . @@ -134,7 +134,7 @@ def put_service_properties( parameters = models.FileServiceProperties(cors=cors) # Construct URL - url = self.put_service_properties.metadata['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), @@ -177,7 +177,7 @@ def put_service_properties( return client_raw_response return deserialized - put_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} + 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): diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py index 70035e2f650c..31b970865ea4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py @@ -63,55 +63,66 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: FileShareItems or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShareItems or - ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of FileShareItem + :rtype: + ~azure.mgmt.storage.v2019_04_01.models.FileShareItemPaged[~azure.mgmt.storage.v2019_04_01.models.FileShareItem] :raises: :class:`ErrorResponseException` """ - # 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 skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - 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') - - # 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('FileShareItems', response) - + 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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + 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'} From f4a2cfae9140633a4e70f174b34c3d5da7aef4f8 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 5 Sep 2019 20:15:21 -0700 Subject: [PATCH 06/10] [AutoPR storage/resource-manager] Add change feed properties to 2019-04-01 Storage. (#6956) * Generated from 774367438889ac553def1957b72b8ba63ad877e5 Add change feed properties to 2019-04-01 Storage. Add change feed properties to Storage Blob Services. * Generated from 774367438889ac553def1957b72b8ba63ad877e5 Add change feed properties to 2019-04-01 Storage. Add change feed properties to Storage Blob Services. --- .../storage/v2019_04_01/models/__init__.py | 3 +++ .../storage/v2019_04_01/models/_models.py | 21 +++++++++++++++++ .../storage/v2019_04_01/models/_models_py3.py | 23 ++++++++++++++++++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py index 418bd1796145..3c0de6b2c59e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py @@ -15,6 +15,7 @@ from ._models_py3 import AzureFilesIdentityBasedAuthentication from ._models_py3 import BlobContainer 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 @@ -82,6 +83,7 @@ from ._models import AzureFilesIdentityBasedAuthentication from ._models import BlobContainer from ._models import BlobServiceProperties + from ._models import ChangeFeed from ._models import CheckNameAvailabilityResult from ._models import CorsRule from ._models import CorsRules @@ -188,6 +190,7 @@ 'AzureFilesIdentityBasedAuthentication', 'BlobContainer', 'BlobServiceProperties', + 'ChangeFeed', 'CheckNameAvailabilityResult', 'CorsRule', 'CorsRules', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py index 76f675a1d708..7eab5bc5a910 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py @@ -316,6 +316,8 @@ class BlobServiceProperties(Resource): :param automatic_snapshot_policy_enabled: Automatic Snapshot is enabled if set to true. :type automatic_snapshot_policy_enabled: bool + :param change_feed: The blob service properties for change feed events. + :type change_feed: ~azure.mgmt.storage.v2019_04_01.models.ChangeFeed """ _validation = { @@ -332,6 +334,7 @@ class BlobServiceProperties(Resource): 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, + 'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'}, } def __init__(self, **kwargs): @@ -340,6 +343,24 @@ def __init__(self, **kwargs): self.default_service_version = kwargs.get('default_service_version', None) self.delete_retention_policy = kwargs.get('delete_retention_policy', None) self.automatic_snapshot_policy_enabled = kwargs.get('automatic_snapshot_policy_enabled', None) + self.change_feed = kwargs.get('change_feed', 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): diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py index 6949750c6955..e8d2a1d88e13 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py @@ -316,6 +316,8 @@ class BlobServiceProperties(Resource): :param automatic_snapshot_policy_enabled: Automatic Snapshot is enabled if set to true. :type automatic_snapshot_policy_enabled: bool + :param change_feed: The blob service properties for change feed events. + :type change_feed: ~azure.mgmt.storage.v2019_04_01.models.ChangeFeed """ _validation = { @@ -332,14 +334,33 @@ class BlobServiceProperties(Resource): 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, + 'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'}, } - def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, automatic_snapshot_policy_enabled: bool=None, **kwargs) -> None: + def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, automatic_snapshot_policy_enabled: bool=None, change_feed=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.automatic_snapshot_policy_enabled = automatic_snapshot_policy_enabled + self.change_feed = change_feed + + +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): From 0654217ef9d90123ae38a4ee75316cedaaefa36f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 10 Sep 2019 19:48:09 -0700 Subject: [PATCH 07/10] [AutoPR storage/resource-manager] Rename errorResponse to align with other RPs (#7058) * Generated from 3658b509eba17c55f99d9e22c28e55cb88e33ac0 Rename errorResponse to align with other RPs * Generated from 3658b509eba17c55f99d9e22c28e55cb88e33ac0 Rename errorResponse to align with other RPs --- .../storage/v2019_04_01/models/_models.py | 113 ++++++++---------- .../storage/v2019_04_01/models/_models_py3.py | 113 ++++++++---------- .../operations/_file_services_operations.py | 22 ++-- .../operations/_file_shares_operations.py | 36 +++--- 4 files changed, 138 insertions(+), 146 deletions(-) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py index 7eab5bc5a910..d65b71635257 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py @@ -402,12 +402,63 @@ def __init__(self, **kwargs): class CloudError(Model): - """CloudError. + """An error response from the Storage service. + + :param error: + :type error: ~azure.mgmt.storage.v2019_04_01.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.v2019_04_01.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. @@ -748,66 +799,6 @@ def __init__(self, **kwargs): self.dfs = None -class ErrorResponse(Model): - """An error response from the Storage service. - - :param error: - :type error: ~azure.mgmt.storage.v2019_04_01.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): - """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.v2019_04_01.models.ErrorResponseBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, - } - - def __init__(self, **kwargs): - super(ErrorResponseBody, 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 FileServiceItems(Model): """FileServiceItems. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py index e8d2a1d88e13..4bbb299a95bb 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py @@ -402,12 +402,63 @@ def __init__(self, **kwargs) -> None: class CloudError(Model): - """CloudError. + """An error response from the Storage service. + + :param error: + :type error: ~azure.mgmt.storage.v2019_04_01.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.v2019_04_01.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. @@ -748,66 +799,6 @@ def __init__(self, **kwargs) -> None: self.dfs = None -class ErrorResponse(Model): - """An error response from the Storage service. - - :param error: - :type error: ~azure.mgmt.storage.v2019_04_01.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): - """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.v2019_04_01.models.ErrorResponseBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, - } - - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: - super(ErrorResponseBody, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = details - - class FileServiceItems(Model): """FileServiceItems. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py index 2f69fef9ccbf..f4a2afc781e4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from .. import models @@ -59,8 +60,7 @@ def list( :return: FileServiceItems or ClientRawResponse if raw=true :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileServiceItems or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL url = self.list.metadata['url'] @@ -90,7 +90,9 @@ def list( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: @@ -128,8 +130,7 @@ def set_service_properties( :return: FileServiceProperties or ClientRawResponse if raw=true :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileServiceProperties or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ parameters = models.FileServiceProperties(cors=cors) @@ -166,7 +167,9 @@ def set_service_properties( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: @@ -199,8 +202,7 @@ def get_service_properties( :return: FileServiceProperties or ClientRawResponse if raw=true :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileServiceProperties or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL url = self.get_service_properties.metadata['url'] @@ -231,7 +233,9 @@ def get_service_properties( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py index 31b970865ea4..b874ff7f630d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_shares_operations.py @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from .. import models @@ -66,8 +67,7 @@ def list( :return: An iterator like instance of FileShareItem :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShareItemPaged[~azure.mgmt.storage.v2019_04_01.models.FileShareItem] - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: @@ -114,7 +114,9 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response @@ -161,8 +163,7 @@ def create( :return: FileShare or ClientRawResponse if raw=true :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShare or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ file_share = models.FileShare(metadata=metadata, share_quota=share_quota) @@ -199,7 +200,9 @@ def create( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: @@ -247,8 +250,7 @@ def update( :return: FileShare or ClientRawResponse if raw=true :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShare or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ file_share = models.FileShare(metadata=metadata, share_quota=share_quota) @@ -285,7 +287,9 @@ def update( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: @@ -323,8 +327,7 @@ def get( :return: FileShare or ClientRawResponse if raw=true :rtype: ~azure.mgmt.storage.v2019_04_01.models.FileShare or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL url = self.get.metadata['url'] @@ -355,7 +358,9 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: @@ -392,8 +397,7 @@ def delete( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL url = self.delete.metadata['url'] @@ -423,7 +427,9 @@ def delete( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: client_raw_response = ClientRawResponse(None, response) From 5db4d33ff42b5eb709368d322974bc4bb1dad45d Mon Sep 17 00:00:00 2001 From: Azure SDK Bot Date: Fri, 27 Sep 2019 07:31:46 +0800 Subject: [PATCH 08/10] Generated from ebaee7c36eb7db67a4e648374f69f26a654b444f (#7445) [SRP] Add new storage account property largeFileSharesState --- .../storage/v2019_04_01/models/__init__.py | 2 ++ .../storage/v2019_04_01/models/_models.py | 21 +++++++++++++++ .../storage/v2019_04_01/models/_models_py3.py | 27 ++++++++++++++++--- .../_storage_management_client_enums.py | 6 +++++ 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py index 3c0de6b2c59e..e839d483b34d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py @@ -165,6 +165,7 @@ DefaultAction, DirectoryServiceOptions, AccessTier, + LargeFileSharesState, GeoReplicationStatus, ProvisioningState, AccountStatus, @@ -271,6 +272,7 @@ 'DefaultAction', 'DirectoryServiceOptions', 'AccessTier', + 'LargeFileSharesState', 'GeoReplicationStatus', 'ProvisioningState', 'AccountStatus', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py index d65b71635257..f9426dd019f1 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py @@ -2326,6 +2326,11 @@ class StorageAccount(TrackedResource): :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.v2019_04_01.models.LargeFileSharesState """ _validation = { @@ -2379,6 +2384,7 @@ class StorageAccount(TrackedResource): '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'}, } def __init__(self, **kwargs): @@ -2404,6 +2410,7 @@ def __init__(self, **kwargs): 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) class StorageAccountCheckNameAvailabilityParameters(Model): @@ -2491,6 +2498,11 @@ class StorageAccountCreateParameters(Model): :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.v2019_04_01.models.LargeFileSharesState """ _validation = { @@ -2512,6 +2524,7 @@ class StorageAccountCreateParameters(Model): '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'}, } def __init__(self, **kwargs): @@ -2528,6 +2541,7 @@ def __init__(self, **kwargs): 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) class StorageAccountKey(Model): @@ -2652,6 +2666,11 @@ class StorageAccountUpdateParameters(Model): :param network_rule_set: Network rule set :type network_rule_set: ~azure.mgmt.storage.v2019_04_01.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.v2019_04_01.models.LargeFileSharesState :param kind: Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' @@ -2668,6 +2687,7 @@ class StorageAccountUpdateParameters(Model): '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'}, 'kind': {'key': 'kind', 'type': 'str'}, } @@ -2682,6 +2702,7 @@ def __init__(self, **kwargs): 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.kind = kwargs.get('kind', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py index 4bbb299a95bb..f65672651e2a 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py @@ -2326,6 +2326,11 @@ class StorageAccount(TrackedResource): :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.v2019_04_01.models.LargeFileSharesState """ _validation = { @@ -2379,9 +2384,10 @@ class StorageAccount(TrackedResource): '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'}, } - 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, **kwargs) -> None: + 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, **kwargs) -> None: super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) self.sku = None self.kind = None @@ -2404,6 +2410,7 @@ def __init__(self, *, location: str, tags=None, identity=None, azure_files_ident 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 class StorageAccountCheckNameAvailabilityParameters(Model): @@ -2491,6 +2498,11 @@ class StorageAccountCreateParameters(Model): :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.v2019_04_01.models.LargeFileSharesState """ _validation = { @@ -2512,9 +2524,10 @@ class StorageAccountCreateParameters(Model): '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'}, } - 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, **kwargs) -> None: + 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, **kwargs) -> None: super(StorageAccountCreateParameters, self).__init__(**kwargs) self.sku = sku self.kind = kind @@ -2528,6 +2541,7 @@ def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom 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 class StorageAccountKey(Model): @@ -2652,6 +2666,11 @@ class StorageAccountUpdateParameters(Model): :param network_rule_set: Network rule set :type network_rule_set: ~azure.mgmt.storage.v2019_04_01.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.v2019_04_01.models.LargeFileSharesState :param kind: Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' @@ -2668,10 +2687,11 @@ class StorageAccountUpdateParameters(Model): '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'}, '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, kind=None, **kwargs) -> None: + 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, kind=None, **kwargs) -> None: super(StorageAccountUpdateParameters, self).__init__(**kwargs) self.sku = sku self.tags = tags @@ -2682,6 +2702,7 @@ def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, en 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.kind = kind diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py index 19ee1a4346d4..0ca18f801c42 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py @@ -97,6 +97,12 @@ class AccessTier(str, Enum): cool = "Cool" +class LargeFileSharesState(str, Enum): + + disabled = "Disabled" + enabled = "Enabled" + + class GeoReplicationStatus(str, Enum): live = "Live" From 5097d728fd7dbc8dad84abef3ba25d4c1620fe25 Mon Sep 17 00:00:00 2001 From: Feng Zhou Date: Fri, 27 Sep 2019 09:01:21 +0000 Subject: [PATCH 09/10] model change for storage --- .../storage/v2019_04_01/models/__init__.py | 2 -- .../storage/v2019_04_01/models/_models.py | 21 --------------- .../storage/v2019_04_01/models/_models_py3.py | 27 +++---------------- .../_storage_management_client_enums.py | 6 ----- 4 files changed, 3 insertions(+), 53 deletions(-) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py index e839d483b34d..3c0de6b2c59e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py @@ -165,7 +165,6 @@ DefaultAction, DirectoryServiceOptions, AccessTier, - LargeFileSharesState, GeoReplicationStatus, ProvisioningState, AccountStatus, @@ -272,7 +271,6 @@ 'DefaultAction', 'DirectoryServiceOptions', 'AccessTier', - 'LargeFileSharesState', 'GeoReplicationStatus', 'ProvisioningState', 'AccountStatus', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py index f9426dd019f1..d65b71635257 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py @@ -2326,11 +2326,6 @@ class StorageAccount(TrackedResource): :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.v2019_04_01.models.LargeFileSharesState """ _validation = { @@ -2384,7 +2379,6 @@ class StorageAccount(TrackedResource): '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'}, } def __init__(self, **kwargs): @@ -2410,7 +2404,6 @@ def __init__(self, **kwargs): 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) class StorageAccountCheckNameAvailabilityParameters(Model): @@ -2498,11 +2491,6 @@ class StorageAccountCreateParameters(Model): :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.v2019_04_01.models.LargeFileSharesState """ _validation = { @@ -2524,7 +2512,6 @@ class StorageAccountCreateParameters(Model): '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'}, } def __init__(self, **kwargs): @@ -2541,7 +2528,6 @@ def __init__(self, **kwargs): 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) class StorageAccountKey(Model): @@ -2666,11 +2652,6 @@ class StorageAccountUpdateParameters(Model): :param network_rule_set: Network rule set :type network_rule_set: ~azure.mgmt.storage.v2019_04_01.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.v2019_04_01.models.LargeFileSharesState :param kind: Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' @@ -2687,7 +2668,6 @@ class StorageAccountUpdateParameters(Model): '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'}, 'kind': {'key': 'kind', 'type': 'str'}, } @@ -2702,7 +2682,6 @@ def __init__(self, **kwargs): 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.kind = kwargs.get('kind', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py index f65672651e2a..4bbb299a95bb 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py @@ -2326,11 +2326,6 @@ class StorageAccount(TrackedResource): :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.v2019_04_01.models.LargeFileSharesState """ _validation = { @@ -2384,10 +2379,9 @@ class StorageAccount(TrackedResource): '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'}, } - 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, **kwargs) -> None: + 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, **kwargs) -> None: super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) self.sku = None self.kind = None @@ -2410,7 +2404,6 @@ def __init__(self, *, location: str, tags=None, identity=None, azure_files_ident 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 class StorageAccountCheckNameAvailabilityParameters(Model): @@ -2498,11 +2491,6 @@ class StorageAccountCreateParameters(Model): :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.v2019_04_01.models.LargeFileSharesState """ _validation = { @@ -2524,10 +2512,9 @@ class StorageAccountCreateParameters(Model): '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'}, } - 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, **kwargs) -> None: + 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, **kwargs) -> None: super(StorageAccountCreateParameters, self).__init__(**kwargs) self.sku = sku self.kind = kind @@ -2541,7 +2528,6 @@ def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom 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 class StorageAccountKey(Model): @@ -2666,11 +2652,6 @@ class StorageAccountUpdateParameters(Model): :param network_rule_set: Network rule set :type network_rule_set: ~azure.mgmt.storage.v2019_04_01.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.v2019_04_01.models.LargeFileSharesState :param kind: Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' @@ -2687,11 +2668,10 @@ class StorageAccountUpdateParameters(Model): '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'}, '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, kind=None, **kwargs) -> None: + 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, kind=None, **kwargs) -> None: super(StorageAccountUpdateParameters, self).__init__(**kwargs) self.sku = sku self.tags = tags @@ -2702,7 +2682,6 @@ def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, en 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.kind = kind diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py index 0ca18f801c42..19ee1a4346d4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py @@ -97,12 +97,6 @@ class AccessTier(str, Enum): cool = "Cool" -class LargeFileSharesState(str, Enum): - - disabled = "Disabled" - enabled = "Enabled" - - class GeoReplicationStatus(str, Enum): live = "Live" From 3757e2b339d79983929784b1d9ca7e61fbd382c5 Mon Sep 17 00:00:00 2001 From: Feng Zhou Date: Fri, 27 Sep 2019 09:08:57 +0000 Subject: [PATCH 10/10] changelog for storage --- sdk/storage/azure-mgmt-storage/HISTORY.rst | 10 ++++++++++ .../azure-mgmt-storage/azure/mgmt/storage/version.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/storage/azure-mgmt-storage/HISTORY.rst b/sdk/storage/azure-mgmt-storage/HISTORY.rst index d04b736a7d34..64c30971baa6 100644 --- a/sdk/storage/azure-mgmt-storage/HISTORY.rst +++ b/sdk/storage/azure-mgmt-storage/HISTORY.rst @@ -3,6 +3,16 @@ Release History =============== +4.1.0 (2019-09-27) +++++++++++++++++++ + +**Features** + +- Model BlobServiceProperties has a new parameter change_feed +- Added operation BlobServicesOperations.list +- Added operation group FileServicesOperations +- Added operation group FileSharesOperations + 4.0.0 (2019-06-12) ++++++++++++++++++ diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/version.py index 5a310ec590fb..4701d51e606d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "4.1.0"