diff --git a/sdk/storage/azure-mgmt-storagecache/README.md b/sdk/storage/azure-mgmt-storagecache/README.md index b38276295694..bac224225474 100644 --- a/sdk/storage/azure-mgmt-storagecache/README.md +++ b/sdk/storage/azure-mgmt-storagecache/README.md @@ -1,29 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -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.5, 3.6 and 3.7. +# Usage -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. +For code examples, see [MyService Management](https://docs.microsoft.com/python/api/overview/azure/) +on docs.microsoft.com. -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. -## Usage +# Provide Feedback -For code examples, see [MyService -Management](https://docs.microsoft.com/python/api/overview/azure/) on -docs.microsoft.com. - -## Provide Feedback - -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-storagecache%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-storagecache%2FREADME.png) diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_storage_cache_management_client.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_storage_cache_management_client.py index 484aac2ab33b..558d892a8211 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_storage_cache_management_client.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/_storage_cache_management_client.py @@ -55,7 +55,7 @@ def __init__( super(StorageCacheManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-11-01' + self.api_version = '2020-03-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/__init__.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/__init__.py index 7a17d7f6a8d7..6c3ac0b04921 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/__init__.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/__init__.py @@ -13,38 +13,60 @@ from ._models_py3 import ApiOperation from ._models_py3 import ApiOperationDisplay from ._models_py3 import Cache + from ._models_py3 import CacheEncryptionSettings from ._models_py3 import CacheHealth + from ._models_py3 import CacheIdentity + from ._models_py3 import CacheNetworkSettings + from ._models_py3 import CacheSecuritySettings from ._models_py3 import CacheSku from ._models_py3 import CacheUpgradeStatus from ._models_py3 import ClfsTarget + from ._models_py3 import ClfsTargetProperties from ._models_py3 import CloudErrorBody + from ._models_py3 import KeyVaultKeyReference + from ._models_py3 import KeyVaultKeyReferenceSourceVault from ._models_py3 import NamespaceJunction from ._models_py3 import Nfs3Target + from ._models_py3 import Nfs3TargetProperties from ._models_py3 import ResourceSku from ._models_py3 import ResourceSkuCapabilities from ._models_py3 import ResourceSkuLocationInfo from ._models_py3 import Restriction from ._models_py3 import StorageTarget + from ._models_py3 import StorageTargetProperties + from ._models_py3 import StorageTargetResource from ._models_py3 import UnknownTarget + from ._models_py3 import UnknownTargetProperties from ._models_py3 import UsageModel from ._models_py3 import UsageModelDisplay except (SyntaxError, ImportError): from ._models import ApiOperation from ._models import ApiOperationDisplay from ._models import Cache + from ._models import CacheEncryptionSettings from ._models import CacheHealth + from ._models import CacheIdentity + from ._models import CacheNetworkSettings + from ._models import CacheSecuritySettings from ._models import CacheSku from ._models import CacheUpgradeStatus from ._models import ClfsTarget + from ._models import ClfsTargetProperties from ._models import CloudErrorBody + from ._models import KeyVaultKeyReference + from ._models import KeyVaultKeyReferenceSourceVault from ._models import NamespaceJunction from ._models import Nfs3Target + from ._models import Nfs3TargetProperties from ._models import ResourceSku from ._models import ResourceSkuCapabilities from ._models import ResourceSkuLocationInfo from ._models import Restriction from ._models import StorageTarget + from ._models import StorageTargetProperties + from ._models import StorageTargetResource from ._models import UnknownTarget + from ._models import UnknownTargetProperties from ._models import UsageModel from ._models import UsageModelDisplay from ._paged_models import ApiOperationPaged @@ -53,30 +75,42 @@ from ._paged_models import StorageTargetPaged from ._paged_models import UsageModelPaged from ._storage_cache_management_client_enums import ( + CacheIdentityType, HealthStateType, ProvisioningStateType, FirmwareStatusType, - ReasonCode, StorageTargetType, + ReasonCode, ) __all__ = [ 'ApiOperation', 'ApiOperationDisplay', 'Cache', + 'CacheEncryptionSettings', 'CacheHealth', + 'CacheIdentity', + 'CacheNetworkSettings', + 'CacheSecuritySettings', 'CacheSku', 'CacheUpgradeStatus', 'ClfsTarget', + 'ClfsTargetProperties', 'CloudErrorBody', + 'KeyVaultKeyReference', + 'KeyVaultKeyReferenceSourceVault', 'NamespaceJunction', 'Nfs3Target', + 'Nfs3TargetProperties', 'ResourceSku', 'ResourceSkuCapabilities', 'ResourceSkuLocationInfo', 'Restriction', 'StorageTarget', + 'StorageTargetProperties', + 'StorageTargetResource', 'UnknownTarget', + 'UnknownTargetProperties', 'UsageModel', 'UsageModelDisplay', 'ApiOperationPaged', @@ -84,9 +118,10 @@ 'UsageModelPaged', 'CachePaged', 'StorageTargetPaged', + 'CacheIdentityType', 'HealthStateType', 'ProvisioningStateType', 'FirmwareStatusType', - 'ReasonCode', 'StorageTargetType', + 'ReasonCode', ] diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models.py index ff6a1ce2f01e..bad52904c4f0 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models.py @@ -75,6 +75,8 @@ class Cache(Model): :vartype name: str :ivar type: Type of the Cache; Microsoft.StorageCache/Cache :vartype type: str + :param identity: The identity of the cache, if configured. + :type identity: ~azure.mgmt.storagecache.models.CacheIdentity :param cache_size_gb: The size of this Cache, in GB. :type cache_size_gb: int :ivar health: Health of the Cache. @@ -92,6 +94,15 @@ class Cache(Model): :type subnet: str :param upgrade_status: Upgrade status of the Cache. :type upgrade_status: ~azure.mgmt.storagecache.models.CacheUpgradeStatus + :param network_settings: Specifies network settings of the cache. + :type network_settings: + ~azure.mgmt.storagecache.models.CacheNetworkSettings + :param encryption_settings: Specifies encryption settings of the cache. + :type encryption_settings: + ~azure.mgmt.storagecache.models.CacheEncryptionSettings + :param security_settings: Specifies security settings of the cache. + :type security_settings: + ~azure.mgmt.storagecache.models.CacheSecuritySettings :param sku: SKU for the Cache. :type sku: ~azure.mgmt.storagecache.models.CacheSku """ @@ -110,12 +121,16 @@ class Cache(Model): 'location': {'key': 'location', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'CacheIdentity'}, 'cache_size_gb': {'key': 'properties.cacheSizeGB', 'type': 'int'}, 'health': {'key': 'properties.health', 'type': 'CacheHealth'}, 'mount_addresses': {'key': 'properties.mountAddresses', 'type': '[str]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'subnet': {'key': 'properties.subnet', 'type': 'str'}, 'upgrade_status': {'key': 'properties.upgradeStatus', 'type': 'CacheUpgradeStatus'}, + 'network_settings': {'key': 'properties.networkSettings', 'type': 'CacheNetworkSettings'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'CacheEncryptionSettings'}, + 'security_settings': {'key': 'properties.securitySettings', 'type': 'CacheSecuritySettings'}, 'sku': {'key': 'sku', 'type': 'CacheSku'}, } @@ -126,15 +141,37 @@ def __init__(self, **kwargs): self.location = kwargs.get('location', None) self.name = None self.type = None + self.identity = kwargs.get('identity', None) self.cache_size_gb = kwargs.get('cache_size_gb', None) self.health = None self.mount_addresses = None self.provisioning_state = kwargs.get('provisioning_state', None) self.subnet = kwargs.get('subnet', None) self.upgrade_status = kwargs.get('upgrade_status', None) + self.network_settings = kwargs.get('network_settings', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.security_settings = kwargs.get('security_settings', None) self.sku = kwargs.get('sku', None) +class CacheEncryptionSettings(Model): + """Cache encryption settings. + + :param key_encryption_key: Specifies the location of the key encryption + key in Key Vault. + :type key_encryption_key: + ~azure.mgmt.storagecache.models.KeyVaultKeyReference + """ + + _attribute_map = { + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultKeyReference'}, + } + + def __init__(self, **kwargs): + super(CacheEncryptionSettings, self).__init__(**kwargs) + self.key_encryption_key = kwargs.get('key_encryption_key', None) + + class CacheHealth(Model): """An indication of Cache health. Gives more information about health than just that related to provisioning. @@ -158,6 +195,85 @@ def __init__(self, **kwargs): self.status_description = kwargs.get('status_description', None) +class CacheIdentity(Model): + """Cache identity properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of the cache. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the cache. + :vartype tenant_id: str + :param type: The type of identity used for the cache. Possible values + include: 'SystemAssigned', 'None' + :type type: str or ~azure.mgmt.storagecache.models.CacheIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'CacheIdentityType'}, + } + + def __init__(self, **kwargs): + super(CacheIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class CacheNetworkSettings(Model): + """Cache network settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param mtu: The IPv4 maximum transmission unit configured for the subnet. + Default value: 1500 . + :type mtu: int + :ivar utility_addresses: Array of additional IP addresses used by this + Cache. + :vartype utility_addresses: list[str] + """ + + _validation = { + 'mtu': {'maximum': 1500, 'minimum': 576}, + 'utility_addresses': {'readonly': True}, + } + + _attribute_map = { + 'mtu': {'key': 'mtu', 'type': 'int'}, + 'utility_addresses': {'key': 'utilityAddresses', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(CacheNetworkSettings, self).__init__(**kwargs) + self.mtu = kwargs.get('mtu', 1500) + self.utility_addresses = None + + +class CacheSecuritySettings(Model): + """Cache security settings. + + :param root_squash: root squash of cache property. + :type root_squash: bool + """ + + _attribute_map = { + 'root_squash': {'key': 'rootSquash', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CacheSecuritySettings, self).__init__(**kwargs) + self.root_squash = kwargs.get('root_squash', None) + + class CacheSku(Model): """SKU for the Cache. @@ -225,7 +341,7 @@ def __init__(self, **kwargs): class ClfsTarget(Model): - """Storage container for use as a CLFS Storage Target. + """Properties pertained to ClfsTarget. :param target: Resource ID of storage container. :type target: str @@ -240,6 +356,110 @@ def __init__(self, **kwargs): self.target = kwargs.get('target', None) +class StorageTargetProperties(Model): + """Properties of the Storage Target. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Nfs3TargetProperties, ClfsTargetProperties, + UnknownTargetProperties + + All required parameters must be populated in order to send to Azure. + + :param junctions: List of Cache namespace junctions to target for + namespace associations. + :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] + :param target_type: Type of the Storage Target. + :type target_type: str + :param provisioning_state: ARM provisioning state, see + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. + Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', + 'Deleting', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.storagecache.models.ProvisioningStateType + :param nfs3: Properties when targetType is nfs3. + :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target + :param clfs: Properties when targetType is clfs. + :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget + :param unknown: Properties when targetType is unknown. + :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget + :param target_base_type: Required. Constant filled by server. + :type target_base_type: str + """ + + _validation = { + 'target_base_type': {'required': True}, + } + + _attribute_map = { + 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, + 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, + 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, + 'target_base_type': {'key': 'targetBaseType', 'type': 'str'}, + } + + _subtype_map = { + 'target_base_type': {'nfs3': 'Nfs3TargetProperties', 'clfs': 'ClfsTargetProperties', 'unknown': 'UnknownTargetProperties'} + } + + def __init__(self, **kwargs): + super(StorageTargetProperties, self).__init__(**kwargs) + self.junctions = kwargs.get('junctions', None) + self.target_type = kwargs.get('target_type', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.nfs3 = kwargs.get('nfs3', None) + self.clfs = kwargs.get('clfs', None) + self.unknown = kwargs.get('unknown', None) + self.target_base_type = None + + +class ClfsTargetProperties(StorageTargetProperties): + """Storage container for use as a CLFS Storage Target. + + All required parameters must be populated in order to send to Azure. + + :param junctions: List of Cache namespace junctions to target for + namespace associations. + :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] + :param target_type: Type of the Storage Target. + :type target_type: str + :param provisioning_state: ARM provisioning state, see + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. + Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', + 'Deleting', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.storagecache.models.ProvisioningStateType + :param nfs3: Properties when targetType is nfs3. + :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target + :param clfs: Properties when targetType is clfs. + :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget + :param unknown: Properties when targetType is unknown. + :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget + :param target_base_type: Required. Constant filled by server. + :type target_base_type: str + """ + + _validation = { + 'target_base_type': {'required': True}, + } + + _attribute_map = { + 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, + 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, + 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, + 'target_base_type': {'key': 'targetBaseType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ClfsTargetProperties, self).__init__(**kwargs) + self.target_base_type = 'clfs' + + class CloudError(Model): """An error response. @@ -299,6 +519,52 @@ def __init__(self, **kwargs): self.target = kwargs.get('target', None) +class KeyVaultKeyReference(Model): + """Describes a reference to Key Vault Key. + + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key + Vault. + :type key_url: str + :param source_vault: Required. Describes a resource Id to source Key + Vault. + :type source_vault: + ~azure.mgmt.storagecache.models.KeyVaultKeyReferenceSourceVault + """ + + _validation = { + 'key_url': {'required': True}, + 'source_vault': {'required': True}, + } + + _attribute_map = { + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'KeyVaultKeyReferenceSourceVault'}, + } + + def __init__(self, **kwargs): + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = kwargs.get('key_url', None) + self.source_vault = kwargs.get('source_vault', None) + + +class KeyVaultKeyReferenceSourceVault(Model): + """Describes a resource Id to source Key Vault. + + :param id: Resource Id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultKeyReferenceSourceVault, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + class NamespaceJunction(Model): """A namespace junction. @@ -324,7 +590,7 @@ def __init__(self, **kwargs): class Nfs3Target(Model): - """An NFSv3 mount point for use as a Storage Target. + """Properties pertained to Nfs3Target. :param target: IP address or host name of an NFSv3 host (e.g., 10.0.44.44). @@ -349,6 +615,51 @@ def __init__(self, **kwargs): self.usage_model = kwargs.get('usage_model', None) +class Nfs3TargetProperties(StorageTargetProperties): + """An NFSv3 mount point for use as a Storage Target. + + All required parameters must be populated in order to send to Azure. + + :param junctions: List of Cache namespace junctions to target for + namespace associations. + :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] + :param target_type: Type of the Storage Target. + :type target_type: str + :param provisioning_state: ARM provisioning state, see + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. + Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', + 'Deleting', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.storagecache.models.ProvisioningStateType + :param nfs3: Properties when targetType is nfs3. + :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target + :param clfs: Properties when targetType is clfs. + :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget + :param unknown: Properties when targetType is unknown. + :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget + :param target_base_type: Required. Constant filled by server. + :type target_base_type: str + """ + + _validation = { + 'target_base_type': {'required': True}, + } + + _attribute_map = { + 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, + 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, + 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, + 'target_base_type': {'key': 'targetBaseType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Nfs3TargetProperties, self).__init__(**kwargs) + self.target_base_type = 'nfs3' + + class ResourceSku(Model): """A resource SKU. @@ -479,8 +790,42 @@ def __init__(self, **kwargs): self.reason_code = kwargs.get('reason_code', None) -class StorageTarget(Model): - """A storage system being cached by a Cache. +class StorageTargetResource(Model): + """Resource used by a Cache. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the Storage Target. + :vartype name: str + :ivar id: Resource ID of the Storage Target. + :vartype id: str + :ivar type: Type of the Storage Target; + Microsoft.StorageCache/Cache/StorageTarget + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageTargetResource, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + + +class StorageTarget(StorageTargetResource): + """Type of the Storage Target. Variables are only populated by the server, and will be ignored when sending a request. @@ -495,10 +840,8 @@ class StorageTarget(Model): :param junctions: List of Cache namespace junctions to target for namespace associations. :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] - :param target_type: Type of the Storage Target. Possible values include: - 'nfs3', 'clfs', 'unknown' - :type target_type: str or - ~azure.mgmt.storagecache.models.StorageTargetType + :param target_type: Type of the Storage Target. + :type target_type: str :param provisioning_state: ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', @@ -533,9 +876,6 @@ class StorageTarget(Model): def __init__(self, **kwargs): super(StorageTarget, self).__init__(**kwargs) - self.name = None - self.id = None - self.type = None self.junctions = kwargs.get('junctions', None) self.target_type = kwargs.get('target_type', None) self.provisioning_state = kwargs.get('provisioning_state', None) @@ -545,7 +885,7 @@ def __init__(self, **kwargs): class UnknownTarget(Model): - """Storage container for use as an Unknown Storage Target. + """Properties pertained to UnknownTarget. :param unknown_map: Dictionary of string->string pairs containing information about the Storage Target. @@ -561,6 +901,51 @@ def __init__(self, **kwargs): self.unknown_map = kwargs.get('unknown_map', None) +class UnknownTargetProperties(StorageTargetProperties): + """Storage container for use as an Unknown Storage Target. + + All required parameters must be populated in order to send to Azure. + + :param junctions: List of Cache namespace junctions to target for + namespace associations. + :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] + :param target_type: Type of the Storage Target. + :type target_type: str + :param provisioning_state: ARM provisioning state, see + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. + Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', + 'Deleting', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.storagecache.models.ProvisioningStateType + :param nfs3: Properties when targetType is nfs3. + :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target + :param clfs: Properties when targetType is clfs. + :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget + :param unknown: Properties when targetType is unknown. + :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget + :param target_base_type: Required. Constant filled by server. + :type target_base_type: str + """ + + _validation = { + 'target_base_type': {'required': True}, + } + + _attribute_map = { + 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, + 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, + 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, + 'target_base_type': {'key': 'targetBaseType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UnknownTargetProperties, self).__init__(**kwargs) + self.target_base_type = 'unknown' + + class UsageModel(Model): """A usage model. diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models_py3.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models_py3.py index ea71abebfc88..9ee016d95557 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models_py3.py @@ -75,6 +75,8 @@ class Cache(Model): :vartype name: str :ivar type: Type of the Cache; Microsoft.StorageCache/Cache :vartype type: str + :param identity: The identity of the cache, if configured. + :type identity: ~azure.mgmt.storagecache.models.CacheIdentity :param cache_size_gb: The size of this Cache, in GB. :type cache_size_gb: int :ivar health: Health of the Cache. @@ -92,6 +94,15 @@ class Cache(Model): :type subnet: str :param upgrade_status: Upgrade status of the Cache. :type upgrade_status: ~azure.mgmt.storagecache.models.CacheUpgradeStatus + :param network_settings: Specifies network settings of the cache. + :type network_settings: + ~azure.mgmt.storagecache.models.CacheNetworkSettings + :param encryption_settings: Specifies encryption settings of the cache. + :type encryption_settings: + ~azure.mgmt.storagecache.models.CacheEncryptionSettings + :param security_settings: Specifies security settings of the cache. + :type security_settings: + ~azure.mgmt.storagecache.models.CacheSecuritySettings :param sku: SKU for the Cache. :type sku: ~azure.mgmt.storagecache.models.CacheSku """ @@ -110,31 +121,57 @@ class Cache(Model): 'location': {'key': 'location', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'CacheIdentity'}, 'cache_size_gb': {'key': 'properties.cacheSizeGB', 'type': 'int'}, 'health': {'key': 'properties.health', 'type': 'CacheHealth'}, 'mount_addresses': {'key': 'properties.mountAddresses', 'type': '[str]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'subnet': {'key': 'properties.subnet', 'type': 'str'}, 'upgrade_status': {'key': 'properties.upgradeStatus', 'type': 'CacheUpgradeStatus'}, + 'network_settings': {'key': 'properties.networkSettings', 'type': 'CacheNetworkSettings'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'CacheEncryptionSettings'}, + 'security_settings': {'key': 'properties.securitySettings', 'type': 'CacheSecuritySettings'}, 'sku': {'key': 'sku', 'type': 'CacheSku'}, } - def __init__(self, *, tags=None, location: str=None, cache_size_gb: int=None, provisioning_state=None, subnet: str=None, upgrade_status=None, sku=None, **kwargs) -> None: + def __init__(self, *, tags=None, location: str=None, identity=None, cache_size_gb: int=None, provisioning_state=None, subnet: str=None, upgrade_status=None, network_settings=None, encryption_settings=None, security_settings=None, sku=None, **kwargs) -> None: super(Cache, self).__init__(**kwargs) self.tags = tags self.id = None self.location = location self.name = None self.type = None + self.identity = identity self.cache_size_gb = cache_size_gb self.health = None self.mount_addresses = None self.provisioning_state = provisioning_state self.subnet = subnet self.upgrade_status = upgrade_status + self.network_settings = network_settings + self.encryption_settings = encryption_settings + self.security_settings = security_settings self.sku = sku +class CacheEncryptionSettings(Model): + """Cache encryption settings. + + :param key_encryption_key: Specifies the location of the key encryption + key in Key Vault. + :type key_encryption_key: + ~azure.mgmt.storagecache.models.KeyVaultKeyReference + """ + + _attribute_map = { + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultKeyReference'}, + } + + def __init__(self, *, key_encryption_key=None, **kwargs) -> None: + super(CacheEncryptionSettings, self).__init__(**kwargs) + self.key_encryption_key = key_encryption_key + + class CacheHealth(Model): """An indication of Cache health. Gives more information about health than just that related to provisioning. @@ -158,6 +195,85 @@ def __init__(self, *, state=None, status_description: str=None, **kwargs) -> Non self.status_description = status_description +class CacheIdentity(Model): + """Cache identity properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of the cache. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the cache. + :vartype tenant_id: str + :param type: The type of identity used for the cache. Possible values + include: 'SystemAssigned', 'None' + :type type: str or ~azure.mgmt.storagecache.models.CacheIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'CacheIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(CacheIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class CacheNetworkSettings(Model): + """Cache network settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param mtu: The IPv4 maximum transmission unit configured for the subnet. + Default value: 1500 . + :type mtu: int + :ivar utility_addresses: Array of additional IP addresses used by this + Cache. + :vartype utility_addresses: list[str] + """ + + _validation = { + 'mtu': {'maximum': 1500, 'minimum': 576}, + 'utility_addresses': {'readonly': True}, + } + + _attribute_map = { + 'mtu': {'key': 'mtu', 'type': 'int'}, + 'utility_addresses': {'key': 'utilityAddresses', 'type': '[str]'}, + } + + def __init__(self, *, mtu: int=1500, **kwargs) -> None: + super(CacheNetworkSettings, self).__init__(**kwargs) + self.mtu = mtu + self.utility_addresses = None + + +class CacheSecuritySettings(Model): + """Cache security settings. + + :param root_squash: root squash of cache property. + :type root_squash: bool + """ + + _attribute_map = { + 'root_squash': {'key': 'rootSquash', 'type': 'bool'}, + } + + def __init__(self, *, root_squash: bool=None, **kwargs) -> None: + super(CacheSecuritySettings, self).__init__(**kwargs) + self.root_squash = root_squash + + class CacheSku(Model): """SKU for the Cache. @@ -225,7 +341,7 @@ def __init__(self, **kwargs) -> None: class ClfsTarget(Model): - """Storage container for use as a CLFS Storage Target. + """Properties pertained to ClfsTarget. :param target: Resource ID of storage container. :type target: str @@ -240,6 +356,110 @@ def __init__(self, *, target: str=None, **kwargs) -> None: self.target = target +class StorageTargetProperties(Model): + """Properties of the Storage Target. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Nfs3TargetProperties, ClfsTargetProperties, + UnknownTargetProperties + + All required parameters must be populated in order to send to Azure. + + :param junctions: List of Cache namespace junctions to target for + namespace associations. + :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] + :param target_type: Type of the Storage Target. + :type target_type: str + :param provisioning_state: ARM provisioning state, see + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. + Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', + 'Deleting', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.storagecache.models.ProvisioningStateType + :param nfs3: Properties when targetType is nfs3. + :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target + :param clfs: Properties when targetType is clfs. + :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget + :param unknown: Properties when targetType is unknown. + :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget + :param target_base_type: Required. Constant filled by server. + :type target_base_type: str + """ + + _validation = { + 'target_base_type': {'required': True}, + } + + _attribute_map = { + 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, + 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, + 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, + 'target_base_type': {'key': 'targetBaseType', 'type': 'str'}, + } + + _subtype_map = { + 'target_base_type': {'nfs3': 'Nfs3TargetProperties', 'clfs': 'ClfsTargetProperties', 'unknown': 'UnknownTargetProperties'} + } + + def __init__(self, *, junctions=None, target_type: str=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, **kwargs) -> None: + super(StorageTargetProperties, self).__init__(**kwargs) + self.junctions = junctions + self.target_type = target_type + self.provisioning_state = provisioning_state + self.nfs3 = nfs3 + self.clfs = clfs + self.unknown = unknown + self.target_base_type = None + + +class ClfsTargetProperties(StorageTargetProperties): + """Storage container for use as a CLFS Storage Target. + + All required parameters must be populated in order to send to Azure. + + :param junctions: List of Cache namespace junctions to target for + namespace associations. + :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] + :param target_type: Type of the Storage Target. + :type target_type: str + :param provisioning_state: ARM provisioning state, see + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. + Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', + 'Deleting', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.storagecache.models.ProvisioningStateType + :param nfs3: Properties when targetType is nfs3. + :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target + :param clfs: Properties when targetType is clfs. + :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget + :param unknown: Properties when targetType is unknown. + :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget + :param target_base_type: Required. Constant filled by server. + :type target_base_type: str + """ + + _validation = { + 'target_base_type': {'required': True}, + } + + _attribute_map = { + 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, + 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, + 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, + 'target_base_type': {'key': 'targetBaseType', 'type': 'str'}, + } + + def __init__(self, *, junctions=None, target_type: str=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, **kwargs) -> None: + super(ClfsTargetProperties, self).__init__(junctions=junctions, target_type=target_type, provisioning_state=provisioning_state, nfs3=nfs3, clfs=clfs, unknown=unknown, **kwargs) + self.target_base_type = 'clfs' + + class CloudError(Model): """An error response. @@ -299,6 +519,52 @@ def __init__(self, *, code: str=None, details=None, message: str=None, target: s self.target = target +class KeyVaultKeyReference(Model): + """Describes a reference to Key Vault Key. + + All required parameters must be populated in order to send to Azure. + + :param key_url: Required. The URL referencing a key encryption key in Key + Vault. + :type key_url: str + :param source_vault: Required. Describes a resource Id to source Key + Vault. + :type source_vault: + ~azure.mgmt.storagecache.models.KeyVaultKeyReferenceSourceVault + """ + + _validation = { + 'key_url': {'required': True}, + 'source_vault': {'required': True}, + } + + _attribute_map = { + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'KeyVaultKeyReferenceSourceVault'}, + } + + def __init__(self, *, key_url: str, source_vault, **kwargs) -> None: + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_url = key_url + self.source_vault = source_vault + + +class KeyVaultKeyReferenceSourceVault(Model): + """Describes a resource Id to source Key Vault. + + :param id: Resource Id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(KeyVaultKeyReferenceSourceVault, self).__init__(**kwargs) + self.id = id + + class NamespaceJunction(Model): """A namespace junction. @@ -324,7 +590,7 @@ def __init__(self, *, namespace_path: str=None, target_path: str=None, nfs_expor class Nfs3Target(Model): - """An NFSv3 mount point for use as a Storage Target. + """Properties pertained to Nfs3Target. :param target: IP address or host name of an NFSv3 host (e.g., 10.0.44.44). @@ -349,6 +615,51 @@ def __init__(self, *, target: str=None, usage_model: str=None, **kwargs) -> None self.usage_model = usage_model +class Nfs3TargetProperties(StorageTargetProperties): + """An NFSv3 mount point for use as a Storage Target. + + All required parameters must be populated in order to send to Azure. + + :param junctions: List of Cache namespace junctions to target for + namespace associations. + :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] + :param target_type: Type of the Storage Target. + :type target_type: str + :param provisioning_state: ARM provisioning state, see + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. + Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', + 'Deleting', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.storagecache.models.ProvisioningStateType + :param nfs3: Properties when targetType is nfs3. + :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target + :param clfs: Properties when targetType is clfs. + :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget + :param unknown: Properties when targetType is unknown. + :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget + :param target_base_type: Required. Constant filled by server. + :type target_base_type: str + """ + + _validation = { + 'target_base_type': {'required': True}, + } + + _attribute_map = { + 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, + 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, + 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, + 'target_base_type': {'key': 'targetBaseType', 'type': 'str'}, + } + + def __init__(self, *, junctions=None, target_type: str=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, **kwargs) -> None: + super(Nfs3TargetProperties, self).__init__(junctions=junctions, target_type=target_type, provisioning_state=provisioning_state, nfs3=nfs3, clfs=clfs, unknown=unknown, **kwargs) + self.target_base_type = 'nfs3' + + class ResourceSku(Model): """A resource SKU. @@ -479,8 +790,42 @@ def __init__(self, *, reason_code=None, **kwargs) -> None: self.reason_code = reason_code -class StorageTarget(Model): - """A storage system being cached by a Cache. +class StorageTargetResource(Model): + """Resource used by a Cache. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the Storage Target. + :vartype name: str + :ivar id: Resource ID of the Storage Target. + :vartype id: str + :ivar type: Type of the Storage Target; + Microsoft.StorageCache/Cache/StorageTarget + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageTargetResource, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + + +class StorageTarget(StorageTargetResource): + """Type of the Storage Target. Variables are only populated by the server, and will be ignored when sending a request. @@ -495,10 +840,8 @@ class StorageTarget(Model): :param junctions: List of Cache namespace junctions to target for namespace associations. :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] - :param target_type: Type of the Storage Target. Possible values include: - 'nfs3', 'clfs', 'unknown' - :type target_type: str or - ~azure.mgmt.storagecache.models.StorageTargetType + :param target_type: Type of the Storage Target. + :type target_type: str :param provisioning_state: ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', @@ -531,11 +874,8 @@ class StorageTarget(Model): 'unknown': {'key': 'properties.unknown', 'type': 'UnknownTarget'}, } - def __init__(self, *, junctions=None, target_type=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, **kwargs) -> None: + def __init__(self, *, junctions=None, target_type: str=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, **kwargs) -> None: super(StorageTarget, self).__init__(**kwargs) - self.name = None - self.id = None - self.type = None self.junctions = junctions self.target_type = target_type self.provisioning_state = provisioning_state @@ -545,7 +885,7 @@ def __init__(self, *, junctions=None, target_type=None, provisioning_state=None, class UnknownTarget(Model): - """Storage container for use as an Unknown Storage Target. + """Properties pertained to UnknownTarget. :param unknown_map: Dictionary of string->string pairs containing information about the Storage Target. @@ -561,6 +901,51 @@ def __init__(self, *, unknown_map=None, **kwargs) -> None: self.unknown_map = unknown_map +class UnknownTargetProperties(StorageTargetProperties): + """Storage container for use as an Unknown Storage Target. + + All required parameters must be populated in order to send to Azure. + + :param junctions: List of Cache namespace junctions to target for + namespace associations. + :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] + :param target_type: Type of the Storage Target. + :type target_type: str + :param provisioning_state: ARM provisioning state, see + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. + Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', + 'Deleting', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.storagecache.models.ProvisioningStateType + :param nfs3: Properties when targetType is nfs3. + :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target + :param clfs: Properties when targetType is clfs. + :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget + :param unknown: Properties when targetType is unknown. + :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget + :param target_base_type: Required. Constant filled by server. + :type target_base_type: str + """ + + _validation = { + 'target_base_type': {'required': True}, + } + + _attribute_map = { + 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, + 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, + 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, + 'target_base_type': {'key': 'targetBaseType', 'type': 'str'}, + } + + def __init__(self, *, junctions=None, target_type: str=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, **kwargs) -> None: + super(UnknownTargetProperties, self).__init__(junctions=junctions, target_type=target_type, provisioning_state=provisioning_state, nfs3=nfs3, clfs=clfs, unknown=unknown, **kwargs) + self.target_base_type = 'unknown' + + class UsageModel(Model): """A usage model. diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_storage_cache_management_client_enums.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_storage_cache_management_client_enums.py index 48d0d7af9996..77791c659078 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_storage_cache_management_client_enums.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_storage_cache_management_client_enums.py @@ -12,6 +12,12 @@ from enum import Enum +class CacheIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + none = "None" + + class HealthStateType(str, Enum): unknown = "Unknown" @@ -41,14 +47,14 @@ class FirmwareStatusType(str, Enum): unavailable = "unavailable" -class ReasonCode(str, Enum): - - quota_id = "QuotaId" - not_available_for_subscription = "NotAvailableForSubscription" - - class StorageTargetType(str, Enum): nfs3 = "nfs3" clfs = "clfs" unknown = "unknown" + + +class ReasonCode(str, Enum): + + quota_id = "QuotaId" + not_available_for_subscription = "NotAvailableForSubscription" diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_caches_operations.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_caches_operations.py index 007c1d108a86..c64d09bd3dcb 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_caches_operations.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_caches_operations.py @@ -27,7 +27,7 @@ class CachesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2019-11-01". + :ivar api_version: Client API version. Constant value: "2020-03-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-11-01" + self.api_version = "2020-03-01" self.config = config @@ -183,7 +183,7 @@ def _delete_initial( url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$'), + 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -232,7 +232,8 @@ def delete( :param resource_group_name: Target resource group. :type resource_group_name: str - :param cache_name: Name of Cache. + :param cache_name: Name of Cache. Length of name must be not greater + than 80 and chars must be in list of [-0-9a-zA-Z_] char class. :type cache_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the @@ -277,7 +278,8 @@ def get( :param resource_group_name: Target resource group. :type resource_group_name: str - :param cache_name: Name of Cache. + :param cache_name: Name of Cache. Length of name must be not greater + than 80 and chars must be in list of [-0-9a-zA-Z_] char class. :type cache_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -293,7 +295,7 @@ def get( url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$'), + 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -340,7 +342,7 @@ def _create_or_update_initial( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$') + 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$') } url = self._client.format_url(url, **path_format_arguments) @@ -393,7 +395,8 @@ def create_or_update( :param resource_group_name: Target resource group. :type resource_group_name: str - :param cache_name: Name of Cache. + :param cache_name: Name of Cache. Length of name must be not greater + than 80 and chars must be in list of [-0-9a-zA-Z_] char class. :type cache_name: str :param cache: Object containing the user-selectable properties of the new Cache. If read-only properties are included, they must match the @@ -445,7 +448,8 @@ def update( :param resource_group_name: Target resource group. :type resource_group_name: str - :param cache_name: Name of Cache. + :param cache_name: Name of Cache. Length of name must be not greater + than 80 and chars must be in list of [-0-9a-zA-Z_] char class. :type cache_name: str :param cache: Object containing the user-selectable properties of the Cache. If read-only properties are included, they must match the @@ -466,7 +470,7 @@ def update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$') + 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$') } url = self._client.format_url(url, **path_format_arguments) @@ -519,7 +523,7 @@ def _flush_initial( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$') + 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$') } url = self._client.format_url(url, **path_format_arguments) @@ -569,7 +573,8 @@ def flush( :param resource_group_name: Target resource group. :type resource_group_name: str - :param cache_name: Name of Cache. + :param cache_name: Name of Cache. Length of name must be not greater + than 80 and chars must be in list of [-0-9a-zA-Z_] char class. :type cache_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the @@ -602,7 +607,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -616,7 +621,7 @@ def _start_initial( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$') + 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$') } url = self._client.format_url(url, **path_format_arguments) @@ -664,7 +669,8 @@ def start( :param resource_group_name: Target resource group. :type resource_group_name: str - :param cache_name: Name of Cache. + :param cache_name: Name of Cache. Length of name must be not greater + than 80 and chars must be in list of [-0-9a-zA-Z_] char class. :type cache_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the @@ -697,7 +703,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -711,7 +717,7 @@ def _stop_initial( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$') + 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$') } url = self._client.format_url(url, **path_format_arguments) @@ -759,7 +765,8 @@ def stop( :param resource_group_name: Target resource group. :type resource_group_name: str - :param cache_name: Name of Cache. + :param cache_name: Name of Cache. Length of name must be not greater + than 80 and chars must be in list of [-0-9a-zA-Z_] char class. :type cache_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the @@ -792,7 +799,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -806,7 +813,7 @@ def _upgrade_firmware_initial( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$') + 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$') } url = self._client.format_url(url, **path_format_arguments) @@ -855,7 +862,8 @@ def upgrade_firmware( :param resource_group_name: Target resource group. :type resource_group_name: str - :param cache_name: Name of Cache. + :param cache_name: Name of Cache. Length of name must be not greater + than 80 and chars must be in list of [-0-9a-zA-Z_] char class. :type cache_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the @@ -888,7 +896,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_operations.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_operations.py index 0dd535cde85e..71eef0813ab0 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_operations.py @@ -25,7 +25,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2019-11-01". + :ivar api_version: Client API version. Constant value: "2020-03-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-11-01" + self.api_version = "2020-03-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_skus_operations.py index 1a448146522a..b22020cdfbb3 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_skus_operations.py @@ -25,7 +25,7 @@ class SkusOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2019-11-01". + :ivar api_version: Client API version. Constant value: "2020-03-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-11-01" + self.api_version = "2020-03-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_storage_targets_operations.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_storage_targets_operations.py index ed72a5fabe2c..02250aecc604 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_storage_targets_operations.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_storage_targets_operations.py @@ -27,7 +27,7 @@ class StorageTargetsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2019-11-01". + :ivar api_version: Client API version. Constant value: "2020-03-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-11-01" + self.api_version = "2020-03-01" self.config = config @@ -47,7 +47,8 @@ def list_by_cache( :param resource_group_name: Target resource group. :type resource_group_name: str - :param cache_name: Name of Cache. + :param cache_name: Name of Cache. Length of name must be not greater + than 80 and chars must be in list of [-0-9a-zA-Z_] char class. :type cache_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -66,7 +67,7 @@ def prepare_request(next_link=None): path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$') + 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$') } url = self._client.format_url(url, **path_format_arguments) @@ -121,8 +122,8 @@ def _delete_initial( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$'), - 'storageTargetName': self._serialize.url("storage_target_name", storage_target_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$') + 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$'), + 'storageTargetName': self._serialize.url("storage_target_name", storage_target_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$') } url = self._client.format_url(url, **path_format_arguments) @@ -174,7 +175,8 @@ def delete( :param resource_group_name: Target resource group. :type resource_group_name: str - :param cache_name: Name of Cache. + :param cache_name: Name of Cache. Length of name must be not greater + than 80 and chars must be in list of [-0-9a-zA-Z_] char class. :type cache_name: str :param storage_target_name: Name of Storage Target. :type storage_target_name: str @@ -222,9 +224,12 @@ def get( :param resource_group_name: Target resource group. :type resource_group_name: str - :param cache_name: Name of Cache. + :param cache_name: Name of Cache. Length of name must be not greater + than 80 and chars must be in list of [-0-9a-zA-Z_] char class. :type cache_name: str - :param storage_target_name: Name of the Storage Target. + :param storage_target_name: Name of the Storage Target. Length of name + must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] + char class. :type storage_target_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -241,8 +246,8 @@ def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$'), - 'storageTargetName': self._serialize.url("storage_target_name", storage_target_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$') + 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$'), + 'storageTargetName': self._serialize.url("storage_target_name", storage_target_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$') } url = self._client.format_url(url, **path_format_arguments) @@ -288,8 +293,8 @@ def _create_or_update_initial( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$'), - 'storageTargetName': self._serialize.url("storage_target_name", storage_target_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,31}$') + 'cacheName': self._serialize.url("cache_name", cache_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$'), + 'storageTargetName': self._serialize.url("storage_target_name", storage_target_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$') } url = self._client.format_url(url, **path_format_arguments) @@ -345,9 +350,12 @@ def create_or_update( :param resource_group_name: Target resource group. :type resource_group_name: str - :param cache_name: Name of Cache. + :param cache_name: Name of Cache. Length of name must be not greater + than 80 and chars must be in list of [-0-9a-zA-Z_] char class. :type cache_name: str - :param storage_target_name: Name of the Storage Target. + :param storage_target_name: Name of the Storage Target. Length of name + must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] + char class. :type storage_target_name: str :param storagetarget: Object containing the definition of a Storage Target. diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_usage_models_operations.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_usage_models_operations.py index 3a29bcfff3eb..9053c43233ae 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_usage_models_operations.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_usage_models_operations.py @@ -25,7 +25,7 @@ class UsageModelsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2019-11-01". + :ivar api_version: Client API version. Constant value: "2020-03-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-11-01" + self.api_version = "2020-03-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagecache/setup.py b/sdk/storage/azure-mgmt-storagecache/setup.py index c03f27692bd0..8603a9645105 100644 --- a/sdk/storage/azure-mgmt-storagecache/setup.py +++ b/sdk/storage/azure-mgmt-storagecache/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -67,6 +69,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False,