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/__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/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py index 8861ef04f4fe..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 @@ -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): @@ -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 42f4cb5b84f5..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 @@ -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 @@ -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/_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