diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/build.json b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/build.json index be4f50ad27c1..012fb639bb0a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/build.json +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/build.json @@ -1 +1 @@ -{"autorest": "1.2.2", "date": "2017-07-19T21:54:46Z", "version": ""} \ No newline at end of file +{"autorest": "1.2.2", "date": "2017-09-11T05:17:50Z", "version": ""} \ No newline at end of file diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py index 0f24b32bc973..8e493a3a2641 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py @@ -15,8 +15,10 @@ from .service_specification import ServiceSpecification from .operation import Operation from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters -from .check_name_availability_result import CheckNameAvailabilityResult +from .sku_capability import SKUCapability +from .restriction import Restriction from .sku import Sku +from .check_name_availability_result import CheckNameAvailabilityResult from .custom_domain import CustomDomain from .encryption_service import EncryptionService from .encryption_services import EncryptionServices @@ -24,7 +26,7 @@ from .encryption import Encryption from .virtual_network_rule import VirtualNetworkRule from .ip_rule import IPRule -from .storage_network_acls import StorageNetworkAcls +from .network_rule_set import NetworkRuleSet from .identity import Identity from .storage_account_create_parameters import StorageAccountCreateParameters from .endpoints import Endpoints @@ -41,19 +43,21 @@ from .service_sas_parameters import ServiceSasParameters from .list_service_sas_response import ListServiceSasResponse from .operation_paged import OperationPaged +from .sku_paged import SkuPaged from .storage_account_paged import StorageAccountPaged from .usage_paged import UsagePaged from .storage_management_client_enums import ( - Reason, + ReasonCode, SkuName, SkuTier, + Kind, + Reason, KeySource, Action, State, Bypass, DefaultAction, AccessTier, - Kind, ProvisioningState, AccountStatus, KeyPermission, @@ -72,8 +76,10 @@ 'ServiceSpecification', 'Operation', 'StorageAccountCheckNameAvailabilityParameters', - 'CheckNameAvailabilityResult', + 'SKUCapability', + 'Restriction', 'Sku', + 'CheckNameAvailabilityResult', 'CustomDomain', 'EncryptionService', 'EncryptionServices', @@ -81,7 +87,7 @@ 'Encryption', 'VirtualNetworkRule', 'IPRule', - 'StorageNetworkAcls', + 'NetworkRuleSet', 'Identity', 'StorageAccountCreateParameters', 'Endpoints', @@ -98,18 +104,20 @@ 'ServiceSasParameters', 'ListServiceSasResponse', 'OperationPaged', + 'SkuPaged', 'StorageAccountPaged', 'UsagePaged', - 'Reason', + 'ReasonCode', 'SkuName', 'SkuTier', + 'Kind', + 'Reason', 'KeySource', 'Action', 'State', 'Bypass', 'DefaultAction', 'AccessTier', - 'Kind', 'ProvisioningState', 'AccountStatus', 'KeyPermission', diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py index 36b815533a7e..d10ecf9e7010 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py @@ -13,7 +13,7 @@ class Dimension(Model): - """Dimensions. + """Dimension of blobs, possiblly be blob type or access tier. :param name: Display name of dimension. :type name: str diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py index 73247cb017a3..f04cd56b1cfb 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py @@ -23,7 +23,8 @@ class MetricSpecification(Model): :type display_description: str :param unit: Unit could be Bytes or Count. :type unit: str - :param dimensions: Dimensions. + :param dimensions: Dimensions of blobs, including blob type and access + tier. :type dimensions: list of :class:`Dimension ` :param aggregation_type: Aggregation type could be Average. diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_network_acls.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py similarity index 94% rename from azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_network_acls.py rename to azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py index c4b617e86007..22f312fcbfa4 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_network_acls.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class StorageNetworkAcls(Model): - """Network ACL. +class NetworkRuleSet(Model): + """Network rule set. :param bypass: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of @@ -22,7 +22,7 @@ class StorageNetworkAcls(Model): 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . :type bypass: str or :class:`Bypass ` - :param virtual_network_rules: Sets the virtual network ACL rules + :param virtual_network_rules: Sets the virtual network rules :type virtual_network_rules: list of :class:`VirtualNetworkRule ` :param ip_rules: Sets the IP ACL rules diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py new file mode 100644 index 000000000000..9d6f0f88408d --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list of str + :param reason_code: The reason for the restriction. As of now this can be + “QuotaId” or “NotAvailableForSubscription”. Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The “NotAvailableForSubscription” is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or :class:`ReasonCode + ` + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, reason_code=None): + self.type = None + self.values = None + self.reason_code = reason_code diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py index 34f5192a7a8e..802ccef43375 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py @@ -28,18 +28,51 @@ class Sku(Model): values include: 'Standard', 'Premium' :vartype tier: str or :class:`SkuTier ` + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'BlobStorage' + :vartype kind: str or :class:`Kind + ` + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list of str + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: list of :class:`SKUCapability + ` + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: list of :class:`Restriction + ` """ _validation = { 'name': {'required': True}, 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'SkuName'}, 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, } - def __init__(self, name): + def __init__(self, name, restrictions=None): self.name = name self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py new file mode 100644 index 000000000000..fe9208b1b7c2 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self): + self.name = None + self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_paged.py new file mode 100644 index 000000000000..31c13d35c415 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`Sku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Sku]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py index 9251d0aba4b6..5115e30c3b81 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py @@ -96,9 +96,9 @@ class StorageAccount(Resource): :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. Default value: False . :type enable_https_traffic_only: bool - :ivar network_acls: Network ACL - :vartype network_acls: :class:`StorageNetworkAcls - ` + :ivar network_rule_set: Network rule set + :vartype network_rule_set: :class:`NetworkRuleSet + ` """ _validation = { @@ -119,7 +119,7 @@ class StorageAccount(Resource): 'secondary_endpoints': {'readonly': True}, 'encryption': {'readonly': True}, 'access_tier': {'readonly': True}, - 'network_acls': {'readonly': True}, + 'network_rule_set': {'readonly': True}, } _attribute_map = { @@ -144,7 +144,7 @@ class StorageAccount(Resource): 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_acls': {'key': 'properties.networkAcls', 'type': 'StorageNetworkAcls'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, } def __init__(self, location=None, tags=None, identity=None, enable_https_traffic_only=False): @@ -165,4 +165,4 @@ def __init__(self, location=None, tags=None, identity=None, enable_https_traffic self.encryption = None self.access_tier = None self.enable_https_traffic_only = enable_https_traffic_only - self.network_acls = None + self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py index e6760d9583b6..c5a78a882a41 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py @@ -47,9 +47,9 @@ class StorageAccountCreateParameters(Model): default setting is unencrypted. :type encryption: :class:`Encryption ` - :param network_acls: Network ACL - :type network_acls: :class:`StorageNetworkAcls - ` + :param network_rule_set: Network rule set + :type network_rule_set: :class:`NetworkRuleSet + ` :param access_tier: Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' @@ -74,12 +74,12 @@ class StorageAccountCreateParameters(Model): 'identity': {'key': 'identity', 'type': 'Identity'}, 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_acls': {'key': 'properties.networkAcls', 'type': 'StorageNetworkAcls'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, } - def __init__(self, sku, kind, location, tags=None, identity=None, custom_domain=None, encryption=None, network_acls=None, access_tier=None, enable_https_traffic_only=False): + def __init__(self, sku, kind, location, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only=False): self.sku = sku self.kind = kind self.location = location @@ -87,6 +87,6 @@ def __init__(self, sku, kind, location, tags=None, identity=None, custom_domain= self.identity = identity self.custom_domain = custom_domain self.encryption = encryption - self.network_acls = network_acls + self.network_rule_set = network_rule_set self.access_tier = access_tier self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py index e6e82415f663..c737b5e12f27 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py @@ -47,9 +47,9 @@ class StorageAccountUpdateParameters(Model): :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. Default value: False . :type enable_https_traffic_only: bool - :param network_acls: Network ACL - :type network_acls: :class:`StorageNetworkAcls - ` + :param network_rule_set: Network rule set + :type network_rule_set: :class:`NetworkRuleSet + ` """ _attribute_map = { @@ -60,10 +60,10 @@ class StorageAccountUpdateParameters(Model): 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_acls': {'key': 'properties.networkAcls', 'type': 'StorageNetworkAcls'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, } - def __init__(self, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only=False, network_acls=None): + def __init__(self, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only=False, network_rule_set=None): self.sku = sku self.tags = tags self.identity = identity @@ -71,4 +71,4 @@ def __init__(self, sku=None, tags=None, identity=None, custom_domain=None, encry self.encryption = encryption self.access_tier = access_tier self.enable_https_traffic_only = enable_https_traffic_only - self.network_acls = network_acls + self.network_rule_set = network_rule_set diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py index 161fb5ca2e48..b0070a6dd4e3 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py @@ -12,10 +12,10 @@ from enum import Enum -class Reason(Enum): +class ReasonCode(Enum): - account_name_invalid = "AccountNameInvalid" - already_exists = "AlreadyExists" + quota_id = "QuotaId" + not_available_for_subscription = "NotAvailableForSubscription" class SkuName(Enum): @@ -33,6 +33,18 @@ class SkuTier(Enum): premium = "Premium" +class Kind(Enum): + + storage = "Storage" + blob_storage = "BlobStorage" + + +class Reason(Enum): + + account_name_invalid = "AccountNameInvalid" + already_exists = "AlreadyExists" + + class KeySource(Enum): microsoft_storage = "Microsoft.Storage" @@ -73,12 +85,6 @@ class AccessTier(Enum): cool = "Cool" -class Kind(Enum): - - storage = "Storage" - blob_storage = "BlobStorage" - - class ProvisioningState(Enum): creating = "Creating" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py index 61afa1dc20f5..b43e81f4f59a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py @@ -15,14 +15,14 @@ class VirtualNetworkRule(Model): """Virtual Network rule. - :param virtual_network_resource_id: A URL of vnet, subnet, classicVnet or - classicSubnet. + :param virtual_network_resource_id: Resource ID of a subnet, for example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :param action: The action of virtual network ACL rule. Possible values + :param action: The action of virtual network rule. Possible values include: 'Allow'. Default value: "Allow" . :type action: str or :class:`Action ` - :param state: Gets the state of virtual network ACL rule. Possible values + :param state: Gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted' :type state: str or :class:`State diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/__init__.py index 62e72337dcd7..3334aa2f42e5 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/__init__.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/__init__.py @@ -10,11 +10,13 @@ # -------------------------------------------------------------------------- from .operations import Operations +from .skus_operations import SkusOperations from .storage_accounts_operations import StorageAccountsOperations from .usage_operations import UsageOperations __all__ = [ 'Operations', + 'SkusOperations', 'StorageAccountsOperations', 'UsageOperations', ] diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py new file mode 100644 index 000000000000..4d041daae0f7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SkusOperations(object): + """SkusOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-06-01". + """ + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-06-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the available SKUs supported by Microsoft.Storage for given + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of :class:`Sku + ` + :rtype: :class:`SkuPaged + ` + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SkuPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py index 9c0330e5a443..9177903f4518 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py @@ -14,6 +14,7 @@ from msrestazure import AzureConfiguration from .version import VERSION from .operations.operations import Operations +from .operations.skus_operations import SkusOperations from .operations.storage_accounts_operations import StorageAccountsOperations from .operations.usage_operations import UsageOperations from . import models @@ -63,6 +64,8 @@ class StorageManagementClient(object): :ivar operations: Operations operations :vartype operations: azure.mgmt.storage.v2017_06_01.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2017_06_01.operations.SkusOperations :ivar storage_accounts: StorageAccounts operations :vartype storage_accounts: azure.mgmt.storage.v2017_06_01.operations.StorageAccountsOperations :ivar usage: Usage operations @@ -91,6 +94,8 @@ def __init__( self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) self.storage_accounts = StorageAccountsOperations( self._client, self.config, self._serialize, self._deserialize) self.usage = UsageOperations(