diff --git a/sdk/storage/azure-mgmt-storagecache/CHANGELOG.md b/sdk/storage/azure-mgmt-storagecache/CHANGELOG.md index 3878a8b5ee06..fea2c2652689 100644 --- a/sdk/storage/azure-mgmt-storagecache/CHANGELOG.md +++ b/sdk/storage/azure-mgmt-storagecache/CHANGELOG.md @@ -1,5 +1,34 @@ # Release History +## 0.4.0 (2021-02-18) + +**Features** + + - Model StorageTarget has a new parameter system_data + - Model StorageTarget has a new parameter location + - Model ApiOperationDisplay has a new parameter description + - Model NamespaceJunction has a new parameter nfs_access_policy + - Model ApiOperation has a new parameter service_specification + - Model ApiOperation has a new parameter is_data_action + - Model ApiOperation has a new parameter origin + - Model Cache has a new parameter system_data + - Model Cache has a new parameter directory_services_settings + - Model StorageTargetResource has a new parameter system_data + - Model StorageTargetResource has a new parameter location + - Added operation CachesOperations.debug_info + - Added operation group AscOperations +**Breaking changes** + - Parameter target_type of model Nfs3TargetProperties is now required + - Parameter target_type of model UnknownTargetProperties is now required + - Parameter target_type of model StorageTargetProperties is now required + - Parameter target_type of model ClfsTargetProperties is now required + - Model Nfs3TargetProperties no longer has parameter target_base_type + - Model StorageTarget no longer has parameter target_type + - Model UnknownTargetProperties no longer has parameter target_base_type + - Model StorageTargetProperties no longer has parameter target_base_type + - Model ClfsTargetProperties no longer has parameter target_base_type + - Model CacheSecuritySettings has a new signature + ## 0.3.0 (2020-03-01) **Features** diff --git a/sdk/storage/azure-mgmt-storagecache/README.md b/sdk/storage/azure-mgmt-storagecache/README.md index 2d48151bb376..188d932bfbcc 100644 --- a/sdk/storage/azure-mgmt-storagecache/README.md +++ b/sdk/storage/azure-mgmt-storagecache/README.md @@ -1,13 +1,13 @@ # Microsoft Azure SDK for Python -This is the Microsoft Azure MyService Management Client Library. +This is the Microsoft Azure Storagecache 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 [azure sdk python release](https://aka.ms/azsdk/python/all). # Usage -For code examples, see [MyService Management](https://docs.microsoft.com/python/api/overview/azure/) +For code examples, see [Storagecache Management](https://docs.microsoft.com/python/api/overview/azure/) on docs.microsoft.com. 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 558d892a8211..3fd81aab77d4 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 @@ -16,6 +16,7 @@ from .operations import Operations from .operations import SkusOperations from .operations import UsageModelsOperations +from .operations import AscOperations from .operations import CachesOperations from .operations import StorageTargetsOperations from . import models @@ -33,6 +34,8 @@ class StorageCacheManagementClient(SDKClient): :vartype skus: azure.mgmt.storagecache.operations.SkusOperations :ivar usage_models: UsageModels operations :vartype usage_models: azure.mgmt.storagecache.operations.UsageModelsOperations + :ivar asc_operations: AscOperations operations + :vartype asc_operations: azure.mgmt.storagecache.operations.AscOperations :ivar caches: Caches operations :vartype caches: azure.mgmt.storagecache.operations.CachesOperations :ivar storage_targets: StorageTargets operations @@ -55,7 +58,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 = '2020-03-01' + self.api_version = '2020-10-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -65,6 +68,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.usage_models = UsageModelsOperations( self._client, self.config, self._serialize, self._deserialize) + self.asc_operations = AscOperations( + self._client, self.config, self._serialize, self._deserialize) self.caches = CachesOperations( self._client, self.config, self._serialize, self._deserialize) self.storage_targets = StorageTargetsOperations( 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 6c3ac0b04921..3937bd90ba08 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 @@ -12,7 +12,12 @@ try: from ._models_py3 import ApiOperation from ._models_py3 import ApiOperationDisplay + from ._models_py3 import ApiOperationPropertiesServiceSpecification + from ._models_py3 import AscOperation from ._models_py3 import Cache + from ._models_py3 import CacheActiveDirectorySettings + from ._models_py3 import CacheActiveDirectorySettingsCredentials + from ._models_py3 import CacheDirectorySettings from ._models_py3 import CacheEncryptionSettings from ._models_py3 import CacheHealth from ._models_py3 import CacheIdentity @@ -20,14 +25,21 @@ from ._models_py3 import CacheSecuritySettings from ._models_py3 import CacheSku from ._models_py3 import CacheUpgradeStatus + from ._models_py3 import CacheUsernameDownloadSettings + from ._models_py3 import CacheUsernameDownloadSettingsCredentials from ._models_py3 import ClfsTarget from ._models_py3 import ClfsTargetProperties from ._models_py3 import CloudErrorBody + from ._models_py3 import ErrorResponse from ._models_py3 import KeyVaultKeyReference from ._models_py3 import KeyVaultKeyReferenceSourceVault + from ._models_py3 import MetricDimension + from ._models_py3 import MetricSpecification from ._models_py3 import NamespaceJunction from ._models_py3 import Nfs3Target from ._models_py3 import Nfs3TargetProperties + from ._models_py3 import NfsAccessPolicy + from ._models_py3 import NfsAccessRule from ._models_py3 import ResourceSku from ._models_py3 import ResourceSkuCapabilities from ._models_py3 import ResourceSkuLocationInfo @@ -35,6 +47,7 @@ from ._models_py3 import StorageTarget from ._models_py3 import StorageTargetProperties from ._models_py3 import StorageTargetResource + from ._models_py3 import SystemData from ._models_py3 import UnknownTarget from ._models_py3 import UnknownTargetProperties from ._models_py3 import UsageModel @@ -42,7 +55,12 @@ except (SyntaxError, ImportError): from ._models import ApiOperation from ._models import ApiOperationDisplay + from ._models import ApiOperationPropertiesServiceSpecification + from ._models import AscOperation from ._models import Cache + from ._models import CacheActiveDirectorySettings + from ._models import CacheActiveDirectorySettingsCredentials + from ._models import CacheDirectorySettings from ._models import CacheEncryptionSettings from ._models import CacheHealth from ._models import CacheIdentity @@ -50,14 +68,21 @@ from ._models import CacheSecuritySettings from ._models import CacheSku from ._models import CacheUpgradeStatus + from ._models import CacheUsernameDownloadSettings + from ._models import CacheUsernameDownloadSettingsCredentials from ._models import ClfsTarget from ._models import ClfsTargetProperties from ._models import CloudErrorBody + from ._models import ErrorResponse from ._models import KeyVaultKeyReference from ._models import KeyVaultKeyReferenceSourceVault + from ._models import MetricDimension + from ._models import MetricSpecification from ._models import NamespaceJunction from ._models import Nfs3Target from ._models import Nfs3TargetProperties + from ._models import NfsAccessPolicy + from ._models import NfsAccessRule from ._models import ResourceSku from ._models import ResourceSkuCapabilities from ._models import ResourceSkuLocationInfo @@ -65,6 +90,7 @@ from ._models import StorageTarget from ._models import StorageTargetProperties from ._models import StorageTargetResource + from ._models import SystemData from ._models import UnknownTarget from ._models import UnknownTargetProperties from ._models import UsageModel @@ -75,18 +101,29 @@ from ._paged_models import StorageTargetPaged from ._paged_models import UsageModelPaged from ._storage_cache_management_client_enums import ( + MetricAggregationType, CacheIdentityType, + CreatedByType, HealthStateType, ProvisioningStateType, FirmwareStatusType, - StorageTargetType, + NfsAccessRuleScope, + NfsAccessRuleAccess, + DomainJoinedType, + UsernameSource, + UsernameDownloadedType, ReasonCode, ) __all__ = [ 'ApiOperation', 'ApiOperationDisplay', + 'ApiOperationPropertiesServiceSpecification', + 'AscOperation', 'Cache', + 'CacheActiveDirectorySettings', + 'CacheActiveDirectorySettingsCredentials', + 'CacheDirectorySettings', 'CacheEncryptionSettings', 'CacheHealth', 'CacheIdentity', @@ -94,14 +131,21 @@ 'CacheSecuritySettings', 'CacheSku', 'CacheUpgradeStatus', + 'CacheUsernameDownloadSettings', + 'CacheUsernameDownloadSettingsCredentials', 'ClfsTarget', 'ClfsTargetProperties', 'CloudErrorBody', + 'ErrorResponse', 'KeyVaultKeyReference', 'KeyVaultKeyReferenceSourceVault', + 'MetricDimension', + 'MetricSpecification', 'NamespaceJunction', 'Nfs3Target', 'Nfs3TargetProperties', + 'NfsAccessPolicy', + 'NfsAccessRule', 'ResourceSku', 'ResourceSkuCapabilities', 'ResourceSkuLocationInfo', @@ -109,6 +153,7 @@ 'StorageTarget', 'StorageTargetProperties', 'StorageTargetResource', + 'SystemData', 'UnknownTarget', 'UnknownTargetProperties', 'UsageModel', @@ -118,10 +163,16 @@ 'UsageModelPaged', 'CachePaged', 'StorageTargetPaged', + 'MetricAggregationType', 'CacheIdentityType', + 'CreatedByType', 'HealthStateType', 'ProvisioningStateType', 'FirmwareStatusType', - 'StorageTargetType', + 'NfsAccessRuleScope', + 'NfsAccessRuleAccess', + 'DomainJoinedType', + 'UsernameSource', + 'UsernameDownloadedType', '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 bad52904c4f0..1e7c2c449380 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 @@ -19,19 +19,34 @@ class ApiOperation(Model): :param display: The object that represents the operation. :type display: ~azure.mgmt.storagecache.models.ApiOperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param is_data_action: The flag that indicates whether the operation + applies to data plane. + :type is_data_action: bool :param name: Operation name: {provider}/{resource}/{operation} :type name: str + :param service_specification: Specification of the all the metrics + provided for a resource type. + :type service_specification: + ~azure.mgmt.storagecache.models.ApiOperationPropertiesServiceSpecification """ _attribute_map = { 'display': {'key': 'display', 'type': 'ApiOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ApiOperationPropertiesServiceSpecification'}, } def __init__(self, **kwargs): super(ApiOperation, self).__init__(**kwargs) self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.is_data_action = kwargs.get('is_data_action', None) self.name = kwargs.get('name', None) + self.service_specification = kwargs.get('service_specification', None) class ApiOperationDisplay(Model): @@ -43,12 +58,15 @@ class ApiOperationDisplay(Model): :type provider: str :param resource: Resource on which the operation is performed: Cache, etc. :type resource: str + :param description: The description of the operation + :type description: str """ _attribute_map = { 'operation': {'key': 'operation', 'type': 'str'}, 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__(self, **kwargs): @@ -56,6 +74,64 @@ def __init__(self, **kwargs): self.operation = kwargs.get('operation', None) self.provider = kwargs.get('provider', None) self.resource = kwargs.get('resource', None) + self.description = kwargs.get('description', None) + + +class ApiOperationPropertiesServiceSpecification(Model): + """Specification of the all the metrics provided for a resource type. + + :param metric_specifications: Details about operations related to metrics. + :type metric_specifications: + list[~azure.mgmt.storagecache.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ApiOperationPropertiesServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class AscOperation(Model): + """The status of operation. + + :param id: The operation Id. + :type id: str + :param name: The operation name. + :type name: str + :param start_time: The start time of the operation. + :type start_time: str + :param end_time: The end time of the operation. + :type end_time: str + :param status: The status of the operation. + :type status: str + :param error: The error detail of the operation if any. + :type error: ~azure.mgmt.storagecache.models.ErrorResponse + :param output: Additional Operation Specific Properties + :type output: dict[str, object] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + 'output': {'key': 'properties.output', 'type': '{object}'}, + } + + def __init__(self, **kwargs): + super(AscOperation, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + self.output = kwargs.get('output', None) class Cache(Model): @@ -77,6 +153,8 @@ class Cache(Model): :vartype type: str :param identity: The identity of the cache, if configured. :type identity: ~azure.mgmt.storagecache.models.CacheIdentity + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.storagecache.models.SystemData :param cache_size_gb: The size of this Cache, in GB. :type cache_size_gb: int :ivar health: Health of the Cache. @@ -103,6 +181,10 @@ class Cache(Model): :param security_settings: Specifies security settings of the cache. :type security_settings: ~azure.mgmt.storagecache.models.CacheSecuritySettings + :param directory_services_settings: Specifies Directory Services settings + of the cache. + :type directory_services_settings: + ~azure.mgmt.storagecache.models.CacheDirectorySettings :param sku: SKU for the Cache. :type sku: ~azure.mgmt.storagecache.models.CacheSku """ @@ -111,6 +193,7 @@ class Cache(Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'health': {'readonly': True}, 'mount_addresses': {'readonly': True}, } @@ -122,6 +205,7 @@ class Cache(Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'identity': {'key': 'identity', 'type': 'CacheIdentity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'cache_size_gb': {'key': 'properties.cacheSizeGB', 'type': 'int'}, 'health': {'key': 'properties.health', 'type': 'CacheHealth'}, 'mount_addresses': {'key': 'properties.mountAddresses', 'type': '[str]'}, @@ -131,6 +215,7 @@ class Cache(Model): 'network_settings': {'key': 'properties.networkSettings', 'type': 'CacheNetworkSettings'}, 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'CacheEncryptionSettings'}, 'security_settings': {'key': 'properties.securitySettings', 'type': 'CacheSecuritySettings'}, + 'directory_services_settings': {'key': 'properties.directoryServicesSettings', 'type': 'CacheDirectorySettings'}, 'sku': {'key': 'sku', 'type': 'CacheSku'}, } @@ -142,6 +227,7 @@ def __init__(self, **kwargs): self.name = None self.type = None self.identity = kwargs.get('identity', None) + self.system_data = None self.cache_size_gb = kwargs.get('cache_size_gb', None) self.health = None self.mount_addresses = None @@ -151,9 +237,129 @@ def __init__(self, **kwargs): 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.directory_services_settings = kwargs.get('directory_services_settings', None) self.sku = kwargs.get('sku', None) +class CacheActiveDirectorySettings(Model): + """Active Directory settings used to join a cache to a domain. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param primary_dns_ip_address: Required. Primary DNS IP address used to + resolve the Active Directory domain controller's fully qualified domain + name. + :type primary_dns_ip_address: str + :param secondary_dns_ip_address: Secondary DNS IP address used to resolve + the Active Directory domain controller's fully qualified domain name. + :type secondary_dns_ip_address: str + :param domain_name: Required. The fully qualified domain name of the + Active Directory domain controller. + :type domain_name: str + :param domain_net_bios_name: Required. The Active Directory domain's + NetBIOS name. + :type domain_net_bios_name: str + :param cache_net_bios_name: Required. The NetBIOS name to assign to the + HPC Cache when it joins the Active Directory domain as a server. Length + must 1-15 characters from the class [-0-9a-zA-Z]. + :type cache_net_bios_name: str + :ivar domain_joined: True if the HPC Cache is joined to the Active + Directory domain. Possible values include: 'Yes', 'No', 'Error' + :vartype domain_joined: str or + ~azure.mgmt.storagecache.models.DomainJoinedType + :param credentials: Active Directory admin credentials used to join the + HPC Cache to a domain. + :type credentials: + ~azure.mgmt.storagecache.models.CacheActiveDirectorySettingsCredentials + """ + + _validation = { + 'primary_dns_ip_address': {'required': True}, + 'domain_name': {'required': True}, + 'domain_net_bios_name': {'required': True}, + 'cache_net_bios_name': {'required': True, 'pattern': r'^[-0-9a-zA-Z]{1,15}$'}, + 'domain_joined': {'readonly': True}, + } + + _attribute_map = { + 'primary_dns_ip_address': {'key': 'primaryDnsIpAddress', 'type': 'str'}, + 'secondary_dns_ip_address': {'key': 'secondaryDnsIpAddress', 'type': 'str'}, + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'domain_net_bios_name': {'key': 'domainNetBiosName', 'type': 'str'}, + 'cache_net_bios_name': {'key': 'cacheNetBiosName', 'type': 'str'}, + 'domain_joined': {'key': 'domainJoined', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'CacheActiveDirectorySettingsCredentials'}, + } + + def __init__(self, **kwargs): + super(CacheActiveDirectorySettings, self).__init__(**kwargs) + self.primary_dns_ip_address = kwargs.get('primary_dns_ip_address', None) + self.secondary_dns_ip_address = kwargs.get('secondary_dns_ip_address', None) + self.domain_name = kwargs.get('domain_name', None) + self.domain_net_bios_name = kwargs.get('domain_net_bios_name', None) + self.cache_net_bios_name = kwargs.get('cache_net_bios_name', None) + self.domain_joined = None + self.credentials = kwargs.get('credentials', None) + + +class CacheActiveDirectorySettingsCredentials(Model): + """Active Directory admin credentials used to join the HPC Cache to a domain. + + All required parameters must be populated in order to send to Azure. + + :param username: Required. Username of the Active Directory domain + administrator. This value is stored encrypted and not returned on + response. + :type username: str + :param password: Required. Plain text password of the Active Directory + domain administrator. This value is stored encrypted and not returned on + response. + :type password: str + """ + + _validation = { + 'username': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CacheActiveDirectorySettingsCredentials, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class CacheDirectorySettings(Model): + """Cache Directory Services settings. + + :param active_directory: Specifies settings for joining the HPC Cache to + an Active Directory domain. + :type active_directory: + ~azure.mgmt.storagecache.models.CacheActiveDirectorySettings + :param username_download: Specifies settings for Extended Groups. Extended + Groups allows users to be members of more than 16 groups. + :type username_download: + ~azure.mgmt.storagecache.models.CacheUsernameDownloadSettings + """ + + _attribute_map = { + 'active_directory': {'key': 'activeDirectory', 'type': 'CacheActiveDirectorySettings'}, + 'username_download': {'key': 'usernameDownload', 'type': 'CacheUsernameDownloadSettings'}, + } + + def __init__(self, **kwargs): + super(CacheDirectorySettings, self).__init__(**kwargs) + self.active_directory = kwargs.get('active_directory', None) + self.username_download = kwargs.get('username_download', None) + + class CacheEncryptionSettings(Model): """Cache encryption settings. @@ -261,17 +467,18 @@ def __init__(self, **kwargs): class CacheSecuritySettings(Model): """Cache security settings. - :param root_squash: root squash of cache property. - :type root_squash: bool + :param access_policies: NFS access policies defined for this cache. + :type access_policies: + list[~azure.mgmt.storagecache.models.NfsAccessPolicy] """ _attribute_map = { - 'root_squash': {'key': 'rootSquash', 'type': 'bool'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[NfsAccessPolicy]'}, } def __init__(self, **kwargs): super(CacheSecuritySettings, self).__init__(**kwargs) - self.root_squash = kwargs.get('root_squash', None) + self.access_policies = kwargs.get('access_policies', None) class CacheSku(Model): @@ -340,8 +547,118 @@ def __init__(self, **kwargs): self.pending_firmware_version = None +class CacheUsernameDownloadSettings(Model): + """Settings for Extended Groups username and group download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param extended_groups: Whether or not Extended Groups is enabled. + :type extended_groups: bool + :param username_source: This setting determines how the cache gets + username and group names for clients. Possible values include: 'AD', + 'LDAP', 'File', 'None'. Default value: "None" . + :type username_source: str or + ~azure.mgmt.storagecache.models.UsernameSource + :param group_file_uri: The URI of the file containing group information + (in /etc/group file format). This field must be populated when + 'usernameSource' is set to 'File'. + :type group_file_uri: str + :param user_file_uri: The URI of the file containing user information (in + /etc/passwd file format). This field must be populated when + 'usernameSource' is set to 'File'. + :type user_file_uri: str + :param ldap_server: The fully qualified domain name or IP address of the + LDAP server to use. + :type ldap_server: str + :param ldap_base_dn: The base distinguished name for the LDAP domain. + :type ldap_base_dn: str + :param encrypt_ldap_connection: Whether or not the LDAP connection should + be encrypted. + :type encrypt_ldap_connection: bool + :param require_valid_certificate: Determines if the certificates must be + validated by a certificate authority. When true, caCertificateURI must be + provided. + :type require_valid_certificate: bool + :param auto_download_certificate: Determines if the certificate should be + automatically downloaded. This applies to 'caCertificateURI' only if + 'requireValidCertificate' is true. + :type auto_download_certificate: bool + :param ca_certificate_uri: The URI of the CA certificate to validate the + LDAP secure connection. This field must be populated when + 'requireValidCertificate' is set to true. + :type ca_certificate_uri: str + :ivar username_downloaded: Indicates whether or not the HPC Cache has + performed the username download successfully. Possible values include: + 'Yes', 'No', 'Error' + :vartype username_downloaded: str or + ~azure.mgmt.storagecache.models.UsernameDownloadedType + :param credentials: When present, these are the credentials for the secure + LDAP connection. + :type credentials: + ~azure.mgmt.storagecache.models.CacheUsernameDownloadSettingsCredentials + """ + + _validation = { + 'username_downloaded': {'readonly': True}, + } + + _attribute_map = { + 'extended_groups': {'key': 'extendedGroups', 'type': 'bool'}, + 'username_source': {'key': 'usernameSource', 'type': 'str'}, + 'group_file_uri': {'key': 'groupFileURI', 'type': 'str'}, + 'user_file_uri': {'key': 'userFileURI', 'type': 'str'}, + 'ldap_server': {'key': 'ldapServer', 'type': 'str'}, + 'ldap_base_dn': {'key': 'ldapBaseDN', 'type': 'str'}, + 'encrypt_ldap_connection': {'key': 'encryptLdapConnection', 'type': 'bool'}, + 'require_valid_certificate': {'key': 'requireValidCertificate', 'type': 'bool'}, + 'auto_download_certificate': {'key': 'autoDownloadCertificate', 'type': 'bool'}, + 'ca_certificate_uri': {'key': 'caCertificateURI', 'type': 'str'}, + 'username_downloaded': {'key': 'usernameDownloaded', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'CacheUsernameDownloadSettingsCredentials'}, + } + + def __init__(self, **kwargs): + super(CacheUsernameDownloadSettings, self).__init__(**kwargs) + self.extended_groups = kwargs.get('extended_groups', None) + self.username_source = kwargs.get('username_source', "None") + self.group_file_uri = kwargs.get('group_file_uri', None) + self.user_file_uri = kwargs.get('user_file_uri', None) + self.ldap_server = kwargs.get('ldap_server', None) + self.ldap_base_dn = kwargs.get('ldap_base_dn', None) + self.encrypt_ldap_connection = kwargs.get('encrypt_ldap_connection', None) + self.require_valid_certificate = kwargs.get('require_valid_certificate', None) + self.auto_download_certificate = kwargs.get('auto_download_certificate', None) + self.ca_certificate_uri = kwargs.get('ca_certificate_uri', None) + self.username_downloaded = None + self.credentials = kwargs.get('credentials', None) + + +class CacheUsernameDownloadSettingsCredentials(Model): + """When present, these are the credentials for the secure LDAP connection. + + :param bind_dn: The Bind Distinguished Name identity to be used in the + secure LDAP connection. This value is stored encrypted and not returned on + response. + :type bind_dn: str + :param bind_password: The Bind password to be used in the secure LDAP + connection. This value is stored encrypted and not returned on response. + :type bind_password: str + """ + + _attribute_map = { + 'bind_dn': {'key': 'bindDn', 'type': 'str'}, + 'bind_password': {'key': 'bindPassword', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CacheUsernameDownloadSettingsCredentials, self).__init__(**kwargs) + self.bind_dn = kwargs.get('bind_dn', None) + self.bind_password = kwargs.get('bind_password', None) + + class ClfsTarget(Model): - """Properties pertained to ClfsTarget. + """Properties pertaining to the ClfsTarget. :param target: Resource ID of storage container. :type target: str @@ -368,8 +685,6 @@ class StorageTargetProperties(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. - :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', @@ -382,37 +697,35 @@ class StorageTargetProperties(Model): :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 + :param target_type: Required. Constant filled by server. + :type target_type: str """ _validation = { - 'target_base_type': {'required': True}, + 'target_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'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, } _subtype_map = { - 'target_base_type': {'nfs3': 'Nfs3TargetProperties', 'clfs': 'ClfsTargetProperties', 'unknown': 'UnknownTargetProperties'} + 'target_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 + self.target_type = None class ClfsTargetProperties(StorageTargetProperties): @@ -423,8 +736,6 @@ class ClfsTargetProperties(StorageTargetProperties): :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', @@ -437,27 +748,26 @@ class ClfsTargetProperties(StorageTargetProperties): :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 + :param target_type: Required. Constant filled by server. + :type target_type: str """ _validation = { - 'target_base_type': {'required': True}, + 'target_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'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, } def __init__(self, **kwargs): super(ClfsTargetProperties, self).__init__(**kwargs) - self.target_base_type = 'clfs' + self.target_type = 'clfs' class CloudError(Model): @@ -519,6 +829,26 @@ def __init__(self, **kwargs): self.target = kwargs.get('target', None) +class ErrorResponse(Model): + """Describes the format of Error response. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + class KeyVaultKeyReference(Model): """Describes a reference to Key Vault Key. @@ -565,6 +895,79 @@ def __init__(self, **kwargs): self.id = kwargs.get('id', None) +class MetricDimension(Model): + """Specifications of the Dimension of metrics. + + :param name: Name of the dimension + :type name: str + :param display_name: Localized friendly display name of the dimension + :type display_name: str + :param internal_name: Internal name of the dimension. + :type internal_name: str + :param to_be_exported_for_shoebox: To be exported to shoe box. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(MetricDimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) + + +class MetricSpecification(Model): + """Details about operation related to metrics. + + :param name: The name of the metric. + :type name: str + :param display_name: Localized display name of the metric. + :type display_name: str + :param display_description: The description of the metric. + :type display_description: str + :param unit: The unit that the metric is measured in. + :type unit: str + :param aggregation_type: The type of metric aggregation. + :type aggregation_type: str + :param supported_aggregation_types: Support metric aggregation type. + :type supported_aggregation_types: list[str or + ~azure.mgmt.storagecache.models.MetricAggregationType] + :param metric_class: Type of metrics. + :type metric_class: str + :param dimensions: Dimensions of the metric + :type dimensions: list[~azure.mgmt.storagecache.models.MetricDimension] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'metric_class': {'key': 'metricClass', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + self.metric_class = kwargs.get('metric_class', None) + self.dimensions = kwargs.get('dimensions', None) + + class NamespaceJunction(Model): """A namespace junction. @@ -574,12 +977,16 @@ class NamespaceJunction(Model): :type target_path: str :param nfs_export: NFS export where targetPath exists. :type nfs_export: str + :param nfs_access_policy: Name of the access policy applied to this + junction. + :type nfs_access_policy: str """ _attribute_map = { 'namespace_path': {'key': 'namespacePath', 'type': 'str'}, 'target_path': {'key': 'targetPath', 'type': 'str'}, 'nfs_export': {'key': 'nfsExport', 'type': 'str'}, + 'nfs_access_policy': {'key': 'nfsAccessPolicy', 'type': 'str'}, } def __init__(self, **kwargs): @@ -587,16 +994,17 @@ def __init__(self, **kwargs): self.namespace_path = kwargs.get('namespace_path', None) self.target_path = kwargs.get('target_path', None) self.nfs_export = kwargs.get('nfs_export', None) + self.nfs_access_policy = kwargs.get('nfs_access_policy', None) class Nfs3Target(Model): - """Properties pertained to Nfs3Target. + """Properties pertaining to the Nfs3Target. :param target: IP address or host name of an NFSv3 host (e.g., 10.0.44.44). :type target: str - :param usage_model: Identifies the primary usage model to be used for this - Storage Target. Get choices from .../usageModels + :param usage_model: Identifies the usage model to be used for this Storage + Target. Get choices from .../usageModels :type usage_model: str """ @@ -623,8 +1031,6 @@ class Nfs3TargetProperties(StorageTargetProperties): :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', @@ -637,27 +1043,121 @@ class Nfs3TargetProperties(StorageTargetProperties): :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 + :param target_type: Required. Constant filled by server. + :type target_type: str """ _validation = { - 'target_base_type': {'required': True}, + 'target_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'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, } def __init__(self, **kwargs): super(Nfs3TargetProperties, self).__init__(**kwargs) - self.target_base_type = 'nfs3' + self.target_type = 'nfs3' + + +class NfsAccessPolicy(Model): + """A set of rules describing access policies applied to NFSv3 clients of the + cache. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name identifying this policy. Access Policy names + are not case sensitive. + :type name: str + :param access_rules: Required. The set of rules describing client accesses + allowed under this policy. + :type access_rules: list[~azure.mgmt.storagecache.models.NfsAccessRule] + """ + + _validation = { + 'name': {'required': True}, + 'access_rules': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'access_rules': {'key': 'accessRules', 'type': '[NfsAccessRule]'}, + } + + def __init__(self, **kwargs): + super(NfsAccessPolicy, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.access_rules = kwargs.get('access_rules', None) + + +class NfsAccessRule(Model): + """Rule to place restrictions on portions of the cache namespace being + presented to clients. + + All required parameters must be populated in order to send to Azure. + + :param scope: Required. Scope for this rule. The scope and filter + determine which clients match the rule. Possible values include: + 'default', 'network', 'host' + :type scope: str or ~azure.mgmt.storagecache.models.NfsAccessRuleScope + :param filter: Filter applied to the scope for this rule. The filter's + format depends on its scope. 'default' scope matches all clients and has + no filter value. 'network' scope takes a filter in CIDR format (for + example, 10.99.1.0/24). 'host' takes an IP address or fully qualified + domain name as filter. If a client does not match any filter rule and + there is no default rule, access is denied. + :type filter: str + :param access: Required. Access allowed by this rule. Possible values + include: 'no', 'ro', 'rw' + :type access: str or ~azure.mgmt.storagecache.models.NfsAccessRuleAccess + :param suid: Allow SUID semantics. + :type suid: bool + :param submount_access: For the default policy, allow access to + subdirectories under the root export. If this is set to no, clients can + only mount the path '/'. If set to yes, clients can mount a deeper path, + like '/a/b'. + :type submount_access: bool + :param root_squash: Map root accesses to anonymousUID and anonymousGID. + :type root_squash: bool + :param anonymous_uid: UID value that replaces 0 when rootSquash is true. + Default value: "-2" . + :type anonymous_uid: str + :param anonymous_gid: GID value that replaces 0 when rootSquash is true. + Default value: "-2" . + :type anonymous_gid: str + """ + + _validation = { + 'scope': {'required': True}, + 'access': {'required': True}, + } + + _attribute_map = { + 'scope': {'key': 'scope', 'type': 'str'}, + 'filter': {'key': 'filter', 'type': 'str'}, + 'access': {'key': 'access', 'type': 'str'}, + 'suid': {'key': 'suid', 'type': 'bool'}, + 'submount_access': {'key': 'submountAccess', 'type': 'bool'}, + 'root_squash': {'key': 'rootSquash', 'type': 'bool'}, + 'anonymous_uid': {'key': 'anonymousUID', 'type': 'str'}, + 'anonymous_gid': {'key': 'anonymousGID', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NfsAccessRule, self).__init__(**kwargs) + self.scope = kwargs.get('scope', None) + self.filter = kwargs.get('filter', None) + self.access = kwargs.get('access', None) + self.suid = kwargs.get('suid', None) + self.submount_access = kwargs.get('submount_access', None) + self.root_squash = kwargs.get('root_squash', None) + self.anonymous_uid = kwargs.get('anonymous_uid', "-2") + self.anonymous_gid = kwargs.get('anonymous_gid', "-2") class ResourceSku(Model): @@ -672,11 +1172,11 @@ class ResourceSku(Model): throughput or ops/sec. :type capabilities: list[~azure.mgmt.storagecache.models.ResourceSkuCapabilities] - :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, + :ivar locations: The set of locations where the SKU is available. This is + the supported and registered Azure Geo Regions (e.g., West US, East US, Southeast Asia, etc.). :vartype locations: list[str] - :param location_info: The set of locations that the SKU is available. + :param location_info: The set of locations where the SKU is available. :type location_info: list[~azure.mgmt.storagecache.models.ResourceSkuLocationInfo] :param name: The name of this SKU. @@ -803,18 +1303,26 @@ class StorageTargetResource(Model): :ivar type: Type of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget :vartype type: str + :ivar location: Region name string. + :vartype location: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.storagecache.models.SystemData """ _validation = { 'name': {'readonly': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): @@ -822,6 +1330,8 @@ def __init__(self, **kwargs): self.name = None self.id = None self.type = None + self.location = None + self.system_data = None class StorageTarget(StorageTargetResource): @@ -837,11 +1347,13 @@ class StorageTarget(StorageTargetResource): :ivar type: Type of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget :vartype type: str + :ivar location: Region name string. + :vartype location: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.storagecache.models.SystemData :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', @@ -860,14 +1372,17 @@ class StorageTarget(StorageTargetResource): 'name': {'readonly': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'junctions': {'key': 'properties.junctions', 'type': '[NamespaceJunction]'}, - 'target_type': {'key': 'properties.targetType', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'nfs3': {'key': 'properties.nfs3', 'type': 'Nfs3Target'}, 'clfs': {'key': 'properties.clfs', 'type': 'ClfsTarget'}, @@ -877,15 +1392,56 @@ class StorageTarget(StorageTargetResource): def __init__(self, **kwargs): super(StorageTarget, 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) +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.storagecache.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.storagecache.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + class UnknownTarget(Model): - """Properties pertained to UnknownTarget. + """Properties pertaining to the UnknownTarget. :param unknown_map: Dictionary of string->string pairs containing information about the Storage Target. @@ -909,8 +1465,6 @@ class UnknownTargetProperties(StorageTargetProperties): :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', @@ -923,27 +1477,26 @@ class UnknownTargetProperties(StorageTargetProperties): :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 + :param target_type: Required. Constant filled by server. + :type target_type: str """ _validation = { - 'target_base_type': {'required': True}, + 'target_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'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, } def __init__(self, **kwargs): super(UnknownTargetProperties, self).__init__(**kwargs) - self.target_base_type = 'unknown' + self.target_type = 'unknown' class UsageModel(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 9ee016d95557..cee45a566e3f 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 @@ -19,19 +19,34 @@ class ApiOperation(Model): :param display: The object that represents the operation. :type display: ~azure.mgmt.storagecache.models.ApiOperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param is_data_action: The flag that indicates whether the operation + applies to data plane. + :type is_data_action: bool :param name: Operation name: {provider}/{resource}/{operation} :type name: str + :param service_specification: Specification of the all the metrics + provided for a resource type. + :type service_specification: + ~azure.mgmt.storagecache.models.ApiOperationPropertiesServiceSpecification """ _attribute_map = { 'display': {'key': 'display', 'type': 'ApiOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ApiOperationPropertiesServiceSpecification'}, } - def __init__(self, *, display=None, name: str=None, **kwargs) -> None: + def __init__(self, *, display=None, origin: str=None, is_data_action: bool=None, name: str=None, service_specification=None, **kwargs) -> None: super(ApiOperation, self).__init__(**kwargs) self.display = display + self.origin = origin + self.is_data_action = is_data_action self.name = name + self.service_specification = service_specification class ApiOperationDisplay(Model): @@ -43,19 +58,80 @@ class ApiOperationDisplay(Model): :type provider: str :param resource: Resource on which the operation is performed: Cache, etc. :type resource: str + :param description: The description of the operation + :type description: str """ _attribute_map = { 'operation': {'key': 'operation', 'type': 'str'}, 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, *, operation: str=None, provider: str=None, resource: str=None, **kwargs) -> None: + def __init__(self, *, operation: str=None, provider: str=None, resource: str=None, description: str=None, **kwargs) -> None: super(ApiOperationDisplay, self).__init__(**kwargs) self.operation = operation self.provider = provider self.resource = resource + self.description = description + + +class ApiOperationPropertiesServiceSpecification(Model): + """Specification of the all the metrics provided for a resource type. + + :param metric_specifications: Details about operations related to metrics. + :type metric_specifications: + list[~azure.mgmt.storagecache.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ApiOperationPropertiesServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class AscOperation(Model): + """The status of operation. + + :param id: The operation Id. + :type id: str + :param name: The operation name. + :type name: str + :param start_time: The start time of the operation. + :type start_time: str + :param end_time: The end time of the operation. + :type end_time: str + :param status: The status of the operation. + :type status: str + :param error: The error detail of the operation if any. + :type error: ~azure.mgmt.storagecache.models.ErrorResponse + :param output: Additional Operation Specific Properties + :type output: dict[str, object] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + 'output': {'key': 'properties.output', 'type': '{object}'}, + } + + def __init__(self, *, id: str=None, name: str=None, start_time: str=None, end_time: str=None, status: str=None, error=None, output=None, **kwargs) -> None: + super(AscOperation, self).__init__(**kwargs) + self.id = id + self.name = name + self.start_time = start_time + self.end_time = end_time + self.status = status + self.error = error + self.output = output class Cache(Model): @@ -77,6 +153,8 @@ class Cache(Model): :vartype type: str :param identity: The identity of the cache, if configured. :type identity: ~azure.mgmt.storagecache.models.CacheIdentity + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.storagecache.models.SystemData :param cache_size_gb: The size of this Cache, in GB. :type cache_size_gb: int :ivar health: Health of the Cache. @@ -103,6 +181,10 @@ class Cache(Model): :param security_settings: Specifies security settings of the cache. :type security_settings: ~azure.mgmt.storagecache.models.CacheSecuritySettings + :param directory_services_settings: Specifies Directory Services settings + of the cache. + :type directory_services_settings: + ~azure.mgmt.storagecache.models.CacheDirectorySettings :param sku: SKU for the Cache. :type sku: ~azure.mgmt.storagecache.models.CacheSku """ @@ -111,6 +193,7 @@ class Cache(Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'health': {'readonly': True}, 'mount_addresses': {'readonly': True}, } @@ -122,6 +205,7 @@ class Cache(Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'identity': {'key': 'identity', 'type': 'CacheIdentity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'cache_size_gb': {'key': 'properties.cacheSizeGB', 'type': 'int'}, 'health': {'key': 'properties.health', 'type': 'CacheHealth'}, 'mount_addresses': {'key': 'properties.mountAddresses', 'type': '[str]'}, @@ -131,10 +215,11 @@ class Cache(Model): 'network_settings': {'key': 'properties.networkSettings', 'type': 'CacheNetworkSettings'}, 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'CacheEncryptionSettings'}, 'security_settings': {'key': 'properties.securitySettings', 'type': 'CacheSecuritySettings'}, + 'directory_services_settings': {'key': 'properties.directoryServicesSettings', 'type': 'CacheDirectorySettings'}, 'sku': {'key': 'sku', 'type': 'CacheSku'}, } - 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: + 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, directory_services_settings=None, sku=None, **kwargs) -> None: super(Cache, self).__init__(**kwargs) self.tags = tags self.id = None @@ -142,6 +227,7 @@ def __init__(self, *, tags=None, location: str=None, identity=None, cache_size_g self.name = None self.type = None self.identity = identity + self.system_data = None self.cache_size_gb = cache_size_gb self.health = None self.mount_addresses = None @@ -151,9 +237,129 @@ def __init__(self, *, tags=None, location: str=None, identity=None, cache_size_g self.network_settings = network_settings self.encryption_settings = encryption_settings self.security_settings = security_settings + self.directory_services_settings = directory_services_settings self.sku = sku +class CacheActiveDirectorySettings(Model): + """Active Directory settings used to join a cache to a domain. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param primary_dns_ip_address: Required. Primary DNS IP address used to + resolve the Active Directory domain controller's fully qualified domain + name. + :type primary_dns_ip_address: str + :param secondary_dns_ip_address: Secondary DNS IP address used to resolve + the Active Directory domain controller's fully qualified domain name. + :type secondary_dns_ip_address: str + :param domain_name: Required. The fully qualified domain name of the + Active Directory domain controller. + :type domain_name: str + :param domain_net_bios_name: Required. The Active Directory domain's + NetBIOS name. + :type domain_net_bios_name: str + :param cache_net_bios_name: Required. The NetBIOS name to assign to the + HPC Cache when it joins the Active Directory domain as a server. Length + must 1-15 characters from the class [-0-9a-zA-Z]. + :type cache_net_bios_name: str + :ivar domain_joined: True if the HPC Cache is joined to the Active + Directory domain. Possible values include: 'Yes', 'No', 'Error' + :vartype domain_joined: str or + ~azure.mgmt.storagecache.models.DomainJoinedType + :param credentials: Active Directory admin credentials used to join the + HPC Cache to a domain. + :type credentials: + ~azure.mgmt.storagecache.models.CacheActiveDirectorySettingsCredentials + """ + + _validation = { + 'primary_dns_ip_address': {'required': True}, + 'domain_name': {'required': True}, + 'domain_net_bios_name': {'required': True}, + 'cache_net_bios_name': {'required': True, 'pattern': r'^[-0-9a-zA-Z]{1,15}$'}, + 'domain_joined': {'readonly': True}, + } + + _attribute_map = { + 'primary_dns_ip_address': {'key': 'primaryDnsIpAddress', 'type': 'str'}, + 'secondary_dns_ip_address': {'key': 'secondaryDnsIpAddress', 'type': 'str'}, + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'domain_net_bios_name': {'key': 'domainNetBiosName', 'type': 'str'}, + 'cache_net_bios_name': {'key': 'cacheNetBiosName', 'type': 'str'}, + 'domain_joined': {'key': 'domainJoined', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'CacheActiveDirectorySettingsCredentials'}, + } + + def __init__(self, *, primary_dns_ip_address: str, domain_name: str, domain_net_bios_name: str, cache_net_bios_name: str, secondary_dns_ip_address: str=None, credentials=None, **kwargs) -> None: + super(CacheActiveDirectorySettings, self).__init__(**kwargs) + self.primary_dns_ip_address = primary_dns_ip_address + self.secondary_dns_ip_address = secondary_dns_ip_address + self.domain_name = domain_name + self.domain_net_bios_name = domain_net_bios_name + self.cache_net_bios_name = cache_net_bios_name + self.domain_joined = None + self.credentials = credentials + + +class CacheActiveDirectorySettingsCredentials(Model): + """Active Directory admin credentials used to join the HPC Cache to a domain. + + All required parameters must be populated in order to send to Azure. + + :param username: Required. Username of the Active Directory domain + administrator. This value is stored encrypted and not returned on + response. + :type username: str + :param password: Required. Plain text password of the Active Directory + domain administrator. This value is stored encrypted and not returned on + response. + :type password: str + """ + + _validation = { + 'username': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, username: str, password: str, **kwargs) -> None: + super(CacheActiveDirectorySettingsCredentials, self).__init__(**kwargs) + self.username = username + self.password = password + + +class CacheDirectorySettings(Model): + """Cache Directory Services settings. + + :param active_directory: Specifies settings for joining the HPC Cache to + an Active Directory domain. + :type active_directory: + ~azure.mgmt.storagecache.models.CacheActiveDirectorySettings + :param username_download: Specifies settings for Extended Groups. Extended + Groups allows users to be members of more than 16 groups. + :type username_download: + ~azure.mgmt.storagecache.models.CacheUsernameDownloadSettings + """ + + _attribute_map = { + 'active_directory': {'key': 'activeDirectory', 'type': 'CacheActiveDirectorySettings'}, + 'username_download': {'key': 'usernameDownload', 'type': 'CacheUsernameDownloadSettings'}, + } + + def __init__(self, *, active_directory=None, username_download=None, **kwargs) -> None: + super(CacheDirectorySettings, self).__init__(**kwargs) + self.active_directory = active_directory + self.username_download = username_download + + class CacheEncryptionSettings(Model): """Cache encryption settings. @@ -261,17 +467,18 @@ def __init__(self, *, mtu: int=1500, **kwargs) -> None: class CacheSecuritySettings(Model): """Cache security settings. - :param root_squash: root squash of cache property. - :type root_squash: bool + :param access_policies: NFS access policies defined for this cache. + :type access_policies: + list[~azure.mgmt.storagecache.models.NfsAccessPolicy] """ _attribute_map = { - 'root_squash': {'key': 'rootSquash', 'type': 'bool'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[NfsAccessPolicy]'}, } - def __init__(self, *, root_squash: bool=None, **kwargs) -> None: + def __init__(self, *, access_policies=None, **kwargs) -> None: super(CacheSecuritySettings, self).__init__(**kwargs) - self.root_squash = root_squash + self.access_policies = access_policies class CacheSku(Model): @@ -340,8 +547,118 @@ def __init__(self, **kwargs) -> None: self.pending_firmware_version = None +class CacheUsernameDownloadSettings(Model): + """Settings for Extended Groups username and group download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param extended_groups: Whether or not Extended Groups is enabled. + :type extended_groups: bool + :param username_source: This setting determines how the cache gets + username and group names for clients. Possible values include: 'AD', + 'LDAP', 'File', 'None'. Default value: "None" . + :type username_source: str or + ~azure.mgmt.storagecache.models.UsernameSource + :param group_file_uri: The URI of the file containing group information + (in /etc/group file format). This field must be populated when + 'usernameSource' is set to 'File'. + :type group_file_uri: str + :param user_file_uri: The URI of the file containing user information (in + /etc/passwd file format). This field must be populated when + 'usernameSource' is set to 'File'. + :type user_file_uri: str + :param ldap_server: The fully qualified domain name or IP address of the + LDAP server to use. + :type ldap_server: str + :param ldap_base_dn: The base distinguished name for the LDAP domain. + :type ldap_base_dn: str + :param encrypt_ldap_connection: Whether or not the LDAP connection should + be encrypted. + :type encrypt_ldap_connection: bool + :param require_valid_certificate: Determines if the certificates must be + validated by a certificate authority. When true, caCertificateURI must be + provided. + :type require_valid_certificate: bool + :param auto_download_certificate: Determines if the certificate should be + automatically downloaded. This applies to 'caCertificateURI' only if + 'requireValidCertificate' is true. + :type auto_download_certificate: bool + :param ca_certificate_uri: The URI of the CA certificate to validate the + LDAP secure connection. This field must be populated when + 'requireValidCertificate' is set to true. + :type ca_certificate_uri: str + :ivar username_downloaded: Indicates whether or not the HPC Cache has + performed the username download successfully. Possible values include: + 'Yes', 'No', 'Error' + :vartype username_downloaded: str or + ~azure.mgmt.storagecache.models.UsernameDownloadedType + :param credentials: When present, these are the credentials for the secure + LDAP connection. + :type credentials: + ~azure.mgmt.storagecache.models.CacheUsernameDownloadSettingsCredentials + """ + + _validation = { + 'username_downloaded': {'readonly': True}, + } + + _attribute_map = { + 'extended_groups': {'key': 'extendedGroups', 'type': 'bool'}, + 'username_source': {'key': 'usernameSource', 'type': 'str'}, + 'group_file_uri': {'key': 'groupFileURI', 'type': 'str'}, + 'user_file_uri': {'key': 'userFileURI', 'type': 'str'}, + 'ldap_server': {'key': 'ldapServer', 'type': 'str'}, + 'ldap_base_dn': {'key': 'ldapBaseDN', 'type': 'str'}, + 'encrypt_ldap_connection': {'key': 'encryptLdapConnection', 'type': 'bool'}, + 'require_valid_certificate': {'key': 'requireValidCertificate', 'type': 'bool'}, + 'auto_download_certificate': {'key': 'autoDownloadCertificate', 'type': 'bool'}, + 'ca_certificate_uri': {'key': 'caCertificateURI', 'type': 'str'}, + 'username_downloaded': {'key': 'usernameDownloaded', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'CacheUsernameDownloadSettingsCredentials'}, + } + + def __init__(self, *, extended_groups: bool=None, username_source="None", group_file_uri: str=None, user_file_uri: str=None, ldap_server: str=None, ldap_base_dn: str=None, encrypt_ldap_connection: bool=None, require_valid_certificate: bool=None, auto_download_certificate: bool=None, ca_certificate_uri: str=None, credentials=None, **kwargs) -> None: + super(CacheUsernameDownloadSettings, self).__init__(**kwargs) + self.extended_groups = extended_groups + self.username_source = username_source + self.group_file_uri = group_file_uri + self.user_file_uri = user_file_uri + self.ldap_server = ldap_server + self.ldap_base_dn = ldap_base_dn + self.encrypt_ldap_connection = encrypt_ldap_connection + self.require_valid_certificate = require_valid_certificate + self.auto_download_certificate = auto_download_certificate + self.ca_certificate_uri = ca_certificate_uri + self.username_downloaded = None + self.credentials = credentials + + +class CacheUsernameDownloadSettingsCredentials(Model): + """When present, these are the credentials for the secure LDAP connection. + + :param bind_dn: The Bind Distinguished Name identity to be used in the + secure LDAP connection. This value is stored encrypted and not returned on + response. + :type bind_dn: str + :param bind_password: The Bind password to be used in the secure LDAP + connection. This value is stored encrypted and not returned on response. + :type bind_password: str + """ + + _attribute_map = { + 'bind_dn': {'key': 'bindDn', 'type': 'str'}, + 'bind_password': {'key': 'bindPassword', 'type': 'str'}, + } + + def __init__(self, *, bind_dn: str=None, bind_password: str=None, **kwargs) -> None: + super(CacheUsernameDownloadSettingsCredentials, self).__init__(**kwargs) + self.bind_dn = bind_dn + self.bind_password = bind_password + + class ClfsTarget(Model): - """Properties pertained to ClfsTarget. + """Properties pertaining to the ClfsTarget. :param target: Resource ID of storage container. :type target: str @@ -368,8 +685,6 @@ class StorageTargetProperties(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. - :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', @@ -382,37 +697,35 @@ class StorageTargetProperties(Model): :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 + :param target_type: Required. Constant filled by server. + :type target_type: str """ _validation = { - 'target_base_type': {'required': True}, + 'target_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'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, } _subtype_map = { - 'target_base_type': {'nfs3': 'Nfs3TargetProperties', 'clfs': 'ClfsTargetProperties', 'unknown': 'UnknownTargetProperties'} + 'target_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: + def __init__(self, *, junctions=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 + self.target_type = None class ClfsTargetProperties(StorageTargetProperties): @@ -423,8 +736,6 @@ class ClfsTargetProperties(StorageTargetProperties): :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', @@ -437,27 +748,26 @@ class ClfsTargetProperties(StorageTargetProperties): :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 + :param target_type: Required. Constant filled by server. + :type target_type: str """ _validation = { - 'target_base_type': {'required': True}, + 'target_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'}, + 'target_type': {'key': 'targetType', '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' + def __init__(self, *, junctions=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, **kwargs) -> None: + super(ClfsTargetProperties, self).__init__(junctions=junctions, provisioning_state=provisioning_state, nfs3=nfs3, clfs=clfs, unknown=unknown, **kwargs) + self.target_type = 'clfs' class CloudError(Model): @@ -519,6 +829,26 @@ def __init__(self, *, code: str=None, details=None, message: str=None, target: s self.target = target +class ErrorResponse(Model): + """Describes the format of Error response. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + class KeyVaultKeyReference(Model): """Describes a reference to Key Vault Key. @@ -565,6 +895,79 @@ def __init__(self, *, id: str=None, **kwargs) -> None: self.id = id +class MetricDimension(Model): + """Specifications of the Dimension of metrics. + + :param name: Name of the dimension + :type name: str + :param display_name: Localized friendly display name of the dimension + :type display_name: str + :param internal_name: Internal name of the dimension. + :type internal_name: str + :param to_be_exported_for_shoebox: To be exported to shoe box. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, internal_name: str=None, to_be_exported_for_shoebox: bool=None, **kwargs) -> None: + super(MetricDimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + + +class MetricSpecification(Model): + """Details about operation related to metrics. + + :param name: The name of the metric. + :type name: str + :param display_name: Localized display name of the metric. + :type display_name: str + :param display_description: The description of the metric. + :type display_description: str + :param unit: The unit that the metric is measured in. + :type unit: str + :param aggregation_type: The type of metric aggregation. + :type aggregation_type: str + :param supported_aggregation_types: Support metric aggregation type. + :type supported_aggregation_types: list[str or + ~azure.mgmt.storagecache.models.MetricAggregationType] + :param metric_class: Type of metrics. + :type metric_class: str + :param dimensions: Dimensions of the metric + :type dimensions: list[~azure.mgmt.storagecache.models.MetricDimension] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'metric_class': {'key': 'metricClass', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, supported_aggregation_types=None, metric_class: str=None, dimensions=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.supported_aggregation_types = supported_aggregation_types + self.metric_class = metric_class + self.dimensions = dimensions + + class NamespaceJunction(Model): """A namespace junction. @@ -574,29 +977,34 @@ class NamespaceJunction(Model): :type target_path: str :param nfs_export: NFS export where targetPath exists. :type nfs_export: str + :param nfs_access_policy: Name of the access policy applied to this + junction. + :type nfs_access_policy: str """ _attribute_map = { 'namespace_path': {'key': 'namespacePath', 'type': 'str'}, 'target_path': {'key': 'targetPath', 'type': 'str'}, 'nfs_export': {'key': 'nfsExport', 'type': 'str'}, + 'nfs_access_policy': {'key': 'nfsAccessPolicy', 'type': 'str'}, } - def __init__(self, *, namespace_path: str=None, target_path: str=None, nfs_export: str=None, **kwargs) -> None: + def __init__(self, *, namespace_path: str=None, target_path: str=None, nfs_export: str=None, nfs_access_policy: str=None, **kwargs) -> None: super(NamespaceJunction, self).__init__(**kwargs) self.namespace_path = namespace_path self.target_path = target_path self.nfs_export = nfs_export + self.nfs_access_policy = nfs_access_policy class Nfs3Target(Model): - """Properties pertained to Nfs3Target. + """Properties pertaining to the Nfs3Target. :param target: IP address or host name of an NFSv3 host (e.g., 10.0.44.44). :type target: str - :param usage_model: Identifies the primary usage model to be used for this - Storage Target. Get choices from .../usageModels + :param usage_model: Identifies the usage model to be used for this Storage + Target. Get choices from .../usageModels :type usage_model: str """ @@ -623,8 +1031,6 @@ class Nfs3TargetProperties(StorageTargetProperties): :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', @@ -637,27 +1043,121 @@ class Nfs3TargetProperties(StorageTargetProperties): :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 + :param target_type: Required. Constant filled by server. + :type target_type: str """ _validation = { - 'target_base_type': {'required': True}, + 'target_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'}, + 'target_type': {'key': 'targetType', 'type': 'str'}, + } + + def __init__(self, *, junctions=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, **kwargs) -> None: + super(Nfs3TargetProperties, self).__init__(junctions=junctions, provisioning_state=provisioning_state, nfs3=nfs3, clfs=clfs, unknown=unknown, **kwargs) + self.target_type = 'nfs3' + + +class NfsAccessPolicy(Model): + """A set of rules describing access policies applied to NFSv3 clients of the + cache. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name identifying this policy. Access Policy names + are not case sensitive. + :type name: str + :param access_rules: Required. The set of rules describing client accesses + allowed under this policy. + :type access_rules: list[~azure.mgmt.storagecache.models.NfsAccessRule] + """ + + _validation = { + 'name': {'required': True}, + 'access_rules': {'required': True}, } - 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' + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'access_rules': {'key': 'accessRules', 'type': '[NfsAccessRule]'}, + } + + def __init__(self, *, name: str, access_rules, **kwargs) -> None: + super(NfsAccessPolicy, self).__init__(**kwargs) + self.name = name + self.access_rules = access_rules + + +class NfsAccessRule(Model): + """Rule to place restrictions on portions of the cache namespace being + presented to clients. + + All required parameters must be populated in order to send to Azure. + + :param scope: Required. Scope for this rule. The scope and filter + determine which clients match the rule. Possible values include: + 'default', 'network', 'host' + :type scope: str or ~azure.mgmt.storagecache.models.NfsAccessRuleScope + :param filter: Filter applied to the scope for this rule. The filter's + format depends on its scope. 'default' scope matches all clients and has + no filter value. 'network' scope takes a filter in CIDR format (for + example, 10.99.1.0/24). 'host' takes an IP address or fully qualified + domain name as filter. If a client does not match any filter rule and + there is no default rule, access is denied. + :type filter: str + :param access: Required. Access allowed by this rule. Possible values + include: 'no', 'ro', 'rw' + :type access: str or ~azure.mgmt.storagecache.models.NfsAccessRuleAccess + :param suid: Allow SUID semantics. + :type suid: bool + :param submount_access: For the default policy, allow access to + subdirectories under the root export. If this is set to no, clients can + only mount the path '/'. If set to yes, clients can mount a deeper path, + like '/a/b'. + :type submount_access: bool + :param root_squash: Map root accesses to anonymousUID and anonymousGID. + :type root_squash: bool + :param anonymous_uid: UID value that replaces 0 when rootSquash is true. + Default value: "-2" . + :type anonymous_uid: str + :param anonymous_gid: GID value that replaces 0 when rootSquash is true. + Default value: "-2" . + :type anonymous_gid: str + """ + + _validation = { + 'scope': {'required': True}, + 'access': {'required': True}, + } + + _attribute_map = { + 'scope': {'key': 'scope', 'type': 'str'}, + 'filter': {'key': 'filter', 'type': 'str'}, + 'access': {'key': 'access', 'type': 'str'}, + 'suid': {'key': 'suid', 'type': 'bool'}, + 'submount_access': {'key': 'submountAccess', 'type': 'bool'}, + 'root_squash': {'key': 'rootSquash', 'type': 'bool'}, + 'anonymous_uid': {'key': 'anonymousUID', 'type': 'str'}, + 'anonymous_gid': {'key': 'anonymousGID', 'type': 'str'}, + } + + def __init__(self, *, scope, access, filter: str=None, suid: bool=None, submount_access: bool=None, root_squash: bool=None, anonymous_uid: str="-2", anonymous_gid: str="-2", **kwargs) -> None: + super(NfsAccessRule, self).__init__(**kwargs) + self.scope = scope + self.filter = filter + self.access = access + self.suid = suid + self.submount_access = submount_access + self.root_squash = root_squash + self.anonymous_uid = anonymous_uid + self.anonymous_gid = anonymous_gid class ResourceSku(Model): @@ -672,11 +1172,11 @@ class ResourceSku(Model): throughput or ops/sec. :type capabilities: list[~azure.mgmt.storagecache.models.ResourceSkuCapabilities] - :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, + :ivar locations: The set of locations where the SKU is available. This is + the supported and registered Azure Geo Regions (e.g., West US, East US, Southeast Asia, etc.). :vartype locations: list[str] - :param location_info: The set of locations that the SKU is available. + :param location_info: The set of locations where the SKU is available. :type location_info: list[~azure.mgmt.storagecache.models.ResourceSkuLocationInfo] :param name: The name of this SKU. @@ -803,18 +1303,26 @@ class StorageTargetResource(Model): :ivar type: Type of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget :vartype type: str + :ivar location: Region name string. + :vartype location: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.storagecache.models.SystemData """ _validation = { 'name': {'readonly': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs) -> None: @@ -822,6 +1330,8 @@ def __init__(self, **kwargs) -> None: self.name = None self.id = None self.type = None + self.location = None + self.system_data = None class StorageTarget(StorageTargetResource): @@ -837,11 +1347,13 @@ class StorageTarget(StorageTargetResource): :ivar type: Type of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget :vartype type: str + :ivar location: Region name string. + :vartype location: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.storagecache.models.SystemData :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', @@ -860,32 +1372,76 @@ class StorageTarget(StorageTargetResource): 'name': {'readonly': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'junctions': {'key': 'properties.junctions', 'type': '[NamespaceJunction]'}, - 'target_type': {'key': 'properties.targetType', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'nfs3': {'key': 'properties.nfs3', 'type': 'Nfs3Target'}, 'clfs': {'key': 'properties.clfs', 'type': 'ClfsTarget'}, 'unknown': {'key': 'properties.unknown', 'type': 'UnknownTarget'}, } - def __init__(self, *, junctions=None, target_type: str=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, **kwargs) -> None: + def __init__(self, *, junctions=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, **kwargs) -> None: super(StorageTarget, 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 +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.storagecache.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.storagecache.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + class UnknownTarget(Model): - """Properties pertained to UnknownTarget. + """Properties pertaining to the UnknownTarget. :param unknown_map: Dictionary of string->string pairs containing information about the Storage Target. @@ -909,8 +1465,6 @@ class UnknownTargetProperties(StorageTargetProperties): :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', @@ -923,27 +1477,26 @@ class UnknownTargetProperties(StorageTargetProperties): :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 + :param target_type: Required. Constant filled by server. + :type target_type: str """ _validation = { - 'target_base_type': {'required': True}, + 'target_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'}, + 'target_type': {'key': 'targetType', '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' + def __init__(self, *, junctions=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, **kwargs) -> None: + super(UnknownTargetProperties, self).__init__(junctions=junctions, provisioning_state=provisioning_state, nfs3=nfs3, clfs=clfs, unknown=unknown, **kwargs) + self.target_type = 'unknown' class UsageModel(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 77791c659078..5c47b428d14b 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,12 +12,31 @@ from enum import Enum +class MetricAggregationType(str, Enum): + + not_specified = "NotSpecified" + none = "None" + average = "Average" + minimum = "Minimum" + maximum = "Maximum" + total = "Total" + count = "Count" + + class CacheIdentityType(str, Enum): system_assigned = "SystemAssigned" none = "None" +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + class HealthStateType(str, Enum): unknown = "Unknown" @@ -47,11 +66,40 @@ class FirmwareStatusType(str, Enum): unavailable = "unavailable" -class StorageTargetType(str, Enum): +class NfsAccessRuleScope(str, Enum): + + default = "default" + network = "network" + host = "host" + + +class NfsAccessRuleAccess(str, Enum): + + no = "no" + ro = "ro" + rw = "rw" + + +class DomainJoinedType(str, Enum): + + yes = "Yes" + no = "No" + error = "Error" + + +class UsernameSource(str, Enum): + + ad = "AD" + ldap = "LDAP" + file = "File" + none = "None" + + +class UsernameDownloadedType(str, Enum): - nfs3 = "nfs3" - clfs = "clfs" - unknown = "unknown" + yes = "Yes" + no = "No" + error = "Error" class ReasonCode(str, Enum): diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/__init__.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/__init__.py index a172beeaba23..ef03e08ed00f 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/__init__.py @@ -12,6 +12,7 @@ from ._operations import Operations from ._skus_operations import SkusOperations from ._usage_models_operations import UsageModelsOperations +from ._asc_operations import AscOperations from ._caches_operations import CachesOperations from ._storage_targets_operations import StorageTargetsOperations @@ -19,6 +20,7 @@ 'Operations', 'SkusOperations', 'UsageModelsOperations', + 'AscOperations', 'CachesOperations', 'StorageTargetsOperations', ] diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_asc_operations.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_asc_operations.py new file mode 100644 index 000000000000..ad9f25af498e --- /dev/null +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_asc_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 AscOperations(object): + """AscOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2020-10-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01" + + self.config = config + + def get( + self, location, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets the status of an asynchronous operation for the Azure HPC Cache. + + :param location: The name of the region used to look up the operation. + :type location: str + :param operation_id: The operation id which uniquely identifies the + asynchronous operation. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AscOperation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storagecache.models.AscOperation or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'operationId': self._serialize.url("operation_id", operation_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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AscOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/locations/{location}/ascOperations/{operationId}'} 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 c64d09bd3dcb..7204c34cd752 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: "2020-03-01". + :ivar api_version: Client API version. Constant value: "2020-10-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 = "2020-03-01" + self.api_version = "2020-10-01" self.config = config @@ -194,7 +194,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -211,39 +210,28 @@ def _delete_initial( exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('object', response) - if response.status_code == 202: - deserialized = self._deserialize('object', response) - if response.status_code == 204: - deserialized = self._deserialize('object', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - def delete( self, resource_group_name, cache_name, custom_headers=None, raw=False, polling=True, **operation_config): """Schedules a Cache for deletion. :param resource_group_name: Target resource group. :type resource_group_name: str - :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. + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-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 direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns object or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -255,14 +243,10 @@ def delete( ) def get_long_running_output(response): - deserialized = self._deserialize('object', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -278,8 +262,8 @@ def get( :param resource_group_name: Target resource group. :type resource_group_name: str - :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. + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-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 @@ -371,7 +355,7 @@ def _create_or_update_initial( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -395,8 +379,8 @@ def create_or_update( :param resource_group_name: Target resource group. :type resource_group_name: str - :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. + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-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 @@ -448,8 +432,8 @@ def update( :param resource_group_name: Target resource group. :type resource_group_name: str - :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. + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-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 @@ -516,10 +500,10 @@ def update( update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}'} - def _flush_initial( + def _debug_info_initial( self, resource_group_name, cache_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.flush.metadata['url'] + url = self.debug_info.metadata['url'] 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'), @@ -533,7 +517,6 @@ def _flush_initial( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -550,21 +533,90 @@ def _flush_initial( exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response - if response.status_code == 200: - deserialized = self._deserialize('object', response) - if response.status_code == 202: - deserialized = self._deserialize('object', response) - if response.status_code == 204: - deserialized = self._deserialize('object', response) + def debug_info( + self, resource_group_name, cache_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Tells a Cache to write generate debug info for support to process. + + :param resource_group_name: Target resource group. + :type resource_group_name: str + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-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 + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._debug_info_initial( + resource_group_name=resource_group_name, + cache_name=cache_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': '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) + debug_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/debugInfo'} + + + def _flush_initial( + self, resource_group_name, cache_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.flush.metadata['url'] + 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,80}$') + } + 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') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - def flush( self, resource_group_name, cache_name, custom_headers=None, raw=False, polling=True, **operation_config): """Tells a Cache to write all dirty data to the Storage Target(s). During @@ -573,18 +625,18 @@ def flush( :param resource_group_name: Target resource group. :type resource_group_name: str - :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. + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-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 direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns object or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._flush_initial( @@ -596,14 +648,10 @@ def flush( ) def get_long_running_output(response): - deserialized = self._deserialize('object', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -631,7 +679,6 @@ def _start_initial( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -648,39 +695,28 @@ def _start_initial( exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('object', response) - if response.status_code == 202: - deserialized = self._deserialize('object', response) - if response.status_code == 204: - deserialized = self._deserialize('object', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - def start( self, resource_group_name, cache_name, custom_headers=None, raw=False, polling=True, **operation_config): """Tells a Stopped state Cache to transition to Active state. :param resource_group_name: Target resource group. :type resource_group_name: str - :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. + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-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 direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns object or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -692,14 +728,10 @@ def start( ) def get_long_running_output(response): - deserialized = self._deserialize('object', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -727,7 +759,6 @@ def _stop_initial( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -744,39 +775,28 @@ def _stop_initial( exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('object', response) - if response.status_code == 202: - deserialized = self._deserialize('object', response) - if response.status_code == 204: - deserialized = self._deserialize('object', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - def stop( self, resource_group_name, cache_name, custom_headers=None, raw=False, polling=True, **operation_config): """Tells an Active Cache to transition to Stopped state. :param resource_group_name: Target resource group. :type resource_group_name: str - :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. + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-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 direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns object or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -788,14 +808,10 @@ def stop( ) def get_long_running_output(response): - deserialized = self._deserialize('object', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -823,7 +839,6 @@ def _upgrade_firmware_initial( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -840,21 +855,10 @@ def _upgrade_firmware_initial( exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('object', response) - if response.status_code == 202: - deserialized = self._deserialize('object', response) - if response.status_code == 204: - deserialized = self._deserialize('object', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - def upgrade_firmware( self, resource_group_name, cache_name, custom_headers=None, raw=False, polling=True, **operation_config): """Upgrade a Cache's firmware if a new version is available. Otherwise, @@ -862,18 +866,18 @@ def upgrade_firmware( :param resource_group_name: Target resource group. :type resource_group_name: str - :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. + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-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 direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns object or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._upgrade_firmware_initial( @@ -885,14 +889,10 @@ def upgrade_firmware( ) def get_long_running_output(response): - deserialized = self._deserialize('object', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) 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 71eef0813ab0..4fc5100b2a80 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: "2020-03-01". + :ivar api_version: Client API version. Constant value: "2020-10-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 = "2020-03-01" + self.api_version = "2020-10-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 b22020cdfbb3..3c3e525d0fe0 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: "2020-03-01". + :ivar api_version: Client API version. Constant value: "2020-10-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 = "2020-03-01" + self.api_version = "2020-10-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 02250aecc604..539a3b049434 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: "2020-03-01". + :ivar api_version: Client API version. Constant value: "2020-10-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 = "2020-03-01" + self.api_version = "2020-10-01" self.config = config @@ -47,8 +47,8 @@ def list_by_cache( :param resource_group_name: Target resource group. :type resource_group_name: str - :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. + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-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 @@ -133,7 +133,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -150,21 +149,10 @@ def _delete_initial( exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('object', response) - if response.status_code == 202: - deserialized = self._deserialize('object', response) - if response.status_code == 204: - deserialized = self._deserialize('object', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - def delete( self, resource_group_name, cache_name, storage_target_name, custom_headers=None, raw=False, polling=True, **operation_config): """Removes a Storage Target from a Cache. This operation is allowed at any @@ -175,8 +163,8 @@ def delete( :param resource_group_name: Target resource group. :type resource_group_name: str - :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. + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-0-9a-zA-Z_] char class. :type cache_name: str :param storage_target_name: Name of Storage Target. :type storage_target_name: str @@ -185,10 +173,10 @@ def delete( direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns object or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -201,14 +189,10 @@ def delete( ) def get_long_running_output(response): - deserialized = self._deserialize('object', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -224,11 +208,11 @@ def get( :param resource_group_name: Target resource group. :type resource_group_name: str - :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. + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-0-9a-zA-Z_] char class. :type cache_name: str :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_] + must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class. :type storage_target_name: str :param dict custom_headers: headers that will be added to the request @@ -323,7 +307,7 @@ def _create_or_update_initial( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -350,11 +334,11 @@ def create_or_update( :param resource_group_name: Target resource group. :type resource_group_name: str - :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. + :param cache_name: Name of Cache. Length of name must not be greater + than 80 and chars must be from the [-0-9a-zA-Z_] char class. :type cache_name: str :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_] + must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class. :type storage_target_name: str :param storagetarget: Object containing the definition of a Storage 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 9053c43233ae..77fdd171f756 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: "2020-03-01". + :ivar api_version: Client API version. Constant value: "2020-10-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 = "2020-03-01" + self.api_version = "2020-10-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/version.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/version.py index 3e682bbd5fb1..85da2c00c1a6 100644 --- a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/version.py +++ b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.3.0" +VERSION = "0.4.0" diff --git a/sdk/storage/azure-mgmt-storagecache/sdk_packaging.toml b/sdk/storage/azure-mgmt-storagecache/sdk_packaging.toml index 6183998aa833..def1d9d46928 100644 --- a/sdk/storage/azure-mgmt-storagecache/sdk_packaging.toml +++ b/sdk/storage/azure-mgmt-storagecache/sdk_packaging.toml @@ -1,7 +1,7 @@ [packaging] package_name = "azure-mgmt-storagecache" package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "MyService Management" +package_pprint_name = "Storagecache Management" package_doc_id = "" is_stable = false is_arm = true diff --git a/sdk/storage/azure-mgmt-storagecache/setup.py b/sdk/storage/azure-mgmt-storagecache/setup.py index 8603a9645105..fe94bfa42428 100644 --- a/sdk/storage/azure-mgmt-storagecache/setup.py +++ b/sdk/storage/azure-mgmt-storagecache/setup.py @@ -13,7 +13,7 @@ # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-storagecache" -PACKAGE_PPRINT_NAME = "MyService Management" +PACKAGE_PPRINT_NAME = "Storagecache Management" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/')