From aa26e13825f3fa5974d0ac363ada4cf75803ed08 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 5 Mar 2021 19:03:45 +0000 Subject: [PATCH 1/2] CodeGen from PR 12875 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.StorageCache to add version stable/2021-03-01 (#12875) * Adds base for updating Microsoft.StorageCache from version stable/2020-10-01 to version 2021-03-01 * Updates readme * Updates API version in new specs and examples * Add storagecache 2021-03-01 content * Add blobNfs and fix issues found by autorest. * Updating anonymous UID and GID * Update dns and storage target descriptions and condition readonly status. --- .../_storage_cache_management_client.py | 2 +- .../mgmt/storagecache/models/__init__.py | 20 +- .../azure/mgmt/storagecache/models/_models.py | 300 ++++++----------- .../mgmt/storagecache/models/_models_py3.py | 304 ++++++------------ .../_storage_cache_management_client_enums.py | 8 + .../operations/_asc_operations.py | 4 +- .../operations/_caches_operations.py | 4 +- .../storagecache/operations/_operations.py | 4 +- .../operations/_skus_operations.py | 4 +- .../operations/_storage_targets_operations.py | 96 +++++- .../operations/_usage_models_operations.py | 4 +- 11 files changed, 323 insertions(+), 427 deletions(-) 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 3fd81aab77d4..6c53abac02e3 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 @@ -58,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-10-01' + self.api_version = '2021-03-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/__init__.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/__init__.py index 3937bd90ba08..c1f3bebe62dc 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 @@ -14,6 +14,7 @@ from ._models_py3 import ApiOperationDisplay from ._models_py3 import ApiOperationPropertiesServiceSpecification from ._models_py3 import AscOperation + from ._models_py3 import BlobNfsTarget from ._models_py3 import Cache from ._models_py3 import CacheActiveDirectorySettings from ._models_py3 import CacheActiveDirectorySettingsCredentials @@ -28,8 +29,8 @@ 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 Condition from ._models_py3 import ErrorResponse from ._models_py3 import KeyVaultKeyReference from ._models_py3 import KeyVaultKeyReferenceSourceVault @@ -37,7 +38,6 @@ 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 @@ -45,11 +45,9 @@ from ._models_py3 import ResourceSkuLocationInfo from ._models_py3 import Restriction from ._models_py3 import StorageTarget - from ._models_py3 import StorageTargetProperties from ._models_py3 import StorageTargetResource from ._models_py3 import SystemData from ._models_py3 import UnknownTarget - from ._models_py3 import UnknownTargetProperties from ._models_py3 import UsageModel from ._models_py3 import UsageModelDisplay except (SyntaxError, ImportError): @@ -57,6 +55,7 @@ from ._models import ApiOperationDisplay from ._models import ApiOperationPropertiesServiceSpecification from ._models import AscOperation + from ._models import BlobNfsTarget from ._models import Cache from ._models import CacheActiveDirectorySettings from ._models import CacheActiveDirectorySettingsCredentials @@ -71,8 +70,8 @@ from ._models import CacheUsernameDownloadSettings from ._models import CacheUsernameDownloadSettingsCredentials from ._models import ClfsTarget - from ._models import ClfsTargetProperties from ._models import CloudErrorBody + from ._models import Condition from ._models import ErrorResponse from ._models import KeyVaultKeyReference from ._models import KeyVaultKeyReferenceSourceVault @@ -80,7 +79,6 @@ 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 @@ -88,11 +86,9 @@ from ._models import ResourceSkuLocationInfo from ._models import Restriction 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 from ._models import UsageModelDisplay from ._paged_models import ApiOperationPaged @@ -112,6 +108,7 @@ DomainJoinedType, UsernameSource, UsernameDownloadedType, + StorageTargetType, ReasonCode, ) @@ -120,6 +117,7 @@ 'ApiOperationDisplay', 'ApiOperationPropertiesServiceSpecification', 'AscOperation', + 'BlobNfsTarget', 'Cache', 'CacheActiveDirectorySettings', 'CacheActiveDirectorySettingsCredentials', @@ -134,8 +132,8 @@ 'CacheUsernameDownloadSettings', 'CacheUsernameDownloadSettingsCredentials', 'ClfsTarget', - 'ClfsTargetProperties', 'CloudErrorBody', + 'Condition', 'ErrorResponse', 'KeyVaultKeyReference', 'KeyVaultKeyReferenceSourceVault', @@ -143,7 +141,6 @@ 'MetricSpecification', 'NamespaceJunction', 'Nfs3Target', - 'Nfs3TargetProperties', 'NfsAccessPolicy', 'NfsAccessRule', 'ResourceSku', @@ -151,11 +148,9 @@ 'ResourceSkuLocationInfo', 'Restriction', 'StorageTarget', - 'StorageTargetProperties', 'StorageTargetResource', 'SystemData', 'UnknownTarget', - 'UnknownTargetProperties', 'UsageModel', 'UsageModelDisplay', 'ApiOperationPaged', @@ -174,5 +169,6 @@ 'DomainJoinedType', 'UsernameSource', 'UsernameDownloadedType', + 'StorageTargetType', 'ReasonCode', ] diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/models/_models.py index 1e7c2c449380..1b4a2eb38515 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 @@ -109,7 +109,7 @@ class AscOperation(Model): :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 + :param output: Additional operation-specific output. :type output: dict[str, object] """ @@ -134,6 +134,27 @@ def __init__(self, **kwargs): self.output = kwargs.get('output', None) +class BlobNfsTarget(Model): + """Properties pertaining to the BlobNfsTarget. + + :param target: Resource ID of the storage container. + :type target: str + :param usage_model: Identifies the StorageCache usage model to be used for + this storage target. + :type usage_model: str + """ + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'usage_model': {'key': 'usageModel', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BlobNfsTarget, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.usage_model = kwargs.get('usage_model', None) + + class Cache(Model): """A Cache instance. Follows Azure Resource Manager standards: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md. @@ -141,8 +162,8 @@ class Cache(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param tags: ARM tags as name/value pairs. - :type tags: object + :param tags: Resource tags. + :type tags: dict[str, str] :ivar id: Resource ID of the Cache. :vartype id: str :param location: Region name string. @@ -199,7 +220,7 @@ class Cache(Model): } _attribute_map = { - 'tags': {'key': 'tags', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'id': {'key': 'id', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, @@ -382,23 +403,35 @@ class CacheHealth(Model): """An indication of Cache health. Gives more information about health than just that related to provisioning. + Variables are only populated by the server, and will be ignored when + sending a request. + :param state: List of Cache health states. Possible values include: 'Unknown', 'Healthy', 'Degraded', 'Down', 'Transitioning', 'Stopping', 'Stopped', 'Upgrading', 'Flushing' :type state: str or ~azure.mgmt.storagecache.models.HealthStateType :param status_description: Describes explanation of state. :type status_description: str + :ivar conditions: Outstanding conditions that need to be investigated and + resolved. + :vartype conditions: list[~azure.mgmt.storagecache.models.Condition] """ + _validation = { + 'conditions': {'readonly': True}, + } + _attribute_map = { 'state': {'key': 'state', 'type': 'str'}, 'status_description': {'key': 'statusDescription', 'type': 'str'}, + 'conditions': {'key': 'conditions', 'type': '[Condition]'}, } def __init__(self, **kwargs): super(CacheHealth, self).__init__(**kwargs) self.state = kwargs.get('state', None) self.status_description = kwargs.get('status_description', None) + self.conditions = None class CacheIdentity(Model): @@ -446,6 +479,14 @@ class CacheNetworkSettings(Model): :ivar utility_addresses: Array of additional IP addresses used by this Cache. :vartype utility_addresses: list[str] + :param dns_servers: DNS servers for the cache to use. It will be set from + the network configuration if no value is provided. + :type dns_servers: list[str] + :param dns_search_domain: DNS search domain + :type dns_search_domain: str + :param ntp_server: NTP server IP Address or FQDN for the cache to use. The + default is time.windows.com. + :type ntp_server: str """ _validation = { @@ -456,12 +497,18 @@ class CacheNetworkSettings(Model): _attribute_map = { 'mtu': {'key': 'mtu', 'type': 'int'}, 'utility_addresses': {'key': 'utilityAddresses', 'type': '[str]'}, + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'dns_search_domain': {'key': 'dnsSearchDomain', 'type': 'str'}, + 'ntp_server': {'key': 'ntpServer', 'type': 'str'}, } def __init__(self, **kwargs): super(CacheNetworkSettings, self).__init__(**kwargs) self.mtu = kwargs.get('mtu', 1500) self.utility_addresses = None + self.dns_servers = kwargs.get('dns_servers', None) + self.dns_search_domain = kwargs.get('dns_search_domain', None) + self.ntp_server = kwargs.get('ntp_server', None) class CacheSecuritySettings(Model): @@ -673,103 +720,6 @@ def __init__(self, **kwargs): self.target = kwargs.get('target', None) -class StorageTargetProperties(Model): - """Properties of the Storage Target. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Nfs3TargetProperties, ClfsTargetProperties, - UnknownTargetProperties - - All required parameters must be populated in order to send to Azure. - - :param junctions: List of Cache namespace junctions to target for - namespace associations. - :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] - :param provisioning_state: ARM provisioning state, see - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. - Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', - 'Deleting', 'Updating' - :type provisioning_state: str or - ~azure.mgmt.storagecache.models.ProvisioningStateType - :param nfs3: Properties when targetType is nfs3. - :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target - :param clfs: Properties when targetType is clfs. - :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget - :param unknown: Properties when targetType is unknown. - :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget - :param target_type: Required. Constant filled by server. - :type target_type: str - """ - - _validation = { - 'target_type': {'required': True}, - } - - _attribute_map = { - 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, - 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, - 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, - 'target_type': {'key': 'targetType', 'type': 'str'}, - } - - _subtype_map = { - 'target_type': {'nfs3': 'Nfs3TargetProperties', 'clfs': 'ClfsTargetProperties', 'unknown': 'UnknownTargetProperties'} - } - - def __init__(self, **kwargs): - super(StorageTargetProperties, self).__init__(**kwargs) - self.junctions = kwargs.get('junctions', 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_type = None - - -class ClfsTargetProperties(StorageTargetProperties): - """Storage container for use as a CLFS Storage Target. - - All required parameters must be populated in order to send to Azure. - - :param junctions: List of Cache namespace junctions to target for - namespace associations. - :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] - :param provisioning_state: ARM provisioning state, see - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. - Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', - 'Deleting', 'Updating' - :type provisioning_state: str or - ~azure.mgmt.storagecache.models.ProvisioningStateType - :param nfs3: Properties when targetType is nfs3. - :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target - :param clfs: Properties when targetType is clfs. - :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget - :param unknown: Properties when targetType is unknown. - :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget - :param target_type: Required. Constant filled by server. - :type target_type: str - """ - - _validation = { - 'target_type': {'required': True}, - } - - _attribute_map = { - 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, - 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, - 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, - 'target_type': {'key': 'targetType', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ClfsTargetProperties, self).__init__(**kwargs) - self.target_type = 'clfs' - - class CloudError(Model): """An error response. @@ -829,6 +779,34 @@ def __init__(self, **kwargs): self.target = kwargs.get('target', None) +class Condition(Model): + """Outstanding conditions that will need to be resolved. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar timestamp: The time when the condition was raised. + :vartype timestamp: datetime + :ivar message: The issue requiring attention. + :vartype message: str + """ + + _validation = { + 'timestamp': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Condition, self).__init__(**kwargs) + self.timestamp = None + self.message = None + + class ErrorResponse(Model): """Describes the format of Error response. @@ -1003,8 +981,8 @@ class Nfs3Target(Model): :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 usage model to be used for this Storage - Target. Get choices from .../usageModels + :param usage_model: Identifies the StorageCache usage model to be used for + this storage target. :type usage_model: str """ @@ -1023,48 +1001,6 @@ def __init__(self, **kwargs): self.usage_model = kwargs.get('usage_model', None) -class Nfs3TargetProperties(StorageTargetProperties): - """An NFSv3 mount point for use as a Storage Target. - - All required parameters must be populated in order to send to Azure. - - :param junctions: List of Cache namespace junctions to target for - namespace associations. - :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] - :param provisioning_state: ARM provisioning state, see - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. - Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', - 'Deleting', 'Updating' - :type provisioning_state: str or - ~azure.mgmt.storagecache.models.ProvisioningStateType - :param nfs3: Properties when targetType is nfs3. - :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target - :param clfs: Properties when targetType is clfs. - :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget - :param unknown: Properties when targetType is unknown. - :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget - :param target_type: Required. Constant filled by server. - :type target_type: str - """ - - _validation = { - 'target_type': {'required': True}, - } - - _attribute_map = { - 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, - 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, - 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, - 'target_type': {'key': 'targetType', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Nfs3TargetProperties, self).__init__(**kwargs) - self.target_type = 'nfs3' - - class NfsAccessPolicy(Model): """A set of rules describing access policies applied to NFSv3 clients of the cache. @@ -1125,10 +1061,10 @@ class NfsAccessRule(Model): :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" . + 65534 will be used if not provided. :type anonymous_uid: str :param anonymous_gid: GID value that replaces 0 when rootSquash is true. - Default value: "-2" . + This will use the value of anonymousUID if not provided. :type anonymous_gid: str """ @@ -1156,8 +1092,8 @@ def __init__(self, **kwargs): 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") + self.anonymous_uid = kwargs.get('anonymous_uid', None) + self.anonymous_gid = kwargs.get('anonymous_gid', None) class ResourceSku(Model): @@ -1340,6 +1276,8 @@ class StorageTarget(StorageTargetResource): 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. + :ivar name: Name of the Storage Target. :vartype name: str :ivar id: Resource ID of the Storage Target. @@ -1354,6 +1292,10 @@ class StorageTarget(StorageTargetResource): :param junctions: List of Cache namespace junctions to target for namespace associations. :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] + :param target_type: Required. Type of the Storage Target. Possible values + include: 'nfs3', 'clfs', 'unknown', 'blobNfs' + :type target_type: str or + ~azure.mgmt.storagecache.models.StorageTargetType :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', @@ -1366,6 +1308,8 @@ class StorageTarget(StorageTargetResource): :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget :param unknown: Properties when targetType is unknown. :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget + :param blob_nfs: Properties when targetType is blobNfs. + :type blob_nfs: ~azure.mgmt.storagecache.models.BlobNfsTarget """ _validation = { @@ -1374,6 +1318,7 @@ class StorageTarget(StorageTargetResource): 'type': {'readonly': True}, 'location': {'readonly': True}, 'system_data': {'readonly': True}, + 'target_type': {'required': True}, } _attribute_map = { @@ -1383,19 +1328,23 @@ class StorageTarget(StorageTargetResource): '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'}, + 'blob_nfs': {'key': 'properties.blobNfs', 'type': 'BlobNfsTarget'}, } 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) + self.blob_nfs = kwargs.get('blob_nfs', None) class SystemData(Model): @@ -1416,8 +1365,7 @@ class SystemData(Model): '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. + :param last_modified_at: The timestamp of resource last modification (UTC) :type last_modified_at: datetime """ @@ -1443,60 +1391,18 @@ def __init__(self, **kwargs): class UnknownTarget(Model): """Properties pertaining to the UnknownTarget. - :param unknown_map: Dictionary of string->string pairs containing + :param attributes: Dictionary of string->string pairs containing information about the Storage Target. - :type unknown_map: dict[str, str] + :type attributes: dict[str, str] """ _attribute_map = { - 'unknown_map': {'key': 'unknownMap', 'type': '{str}'}, + 'attributes': {'key': 'attributes', 'type': '{str}'}, } def __init__(self, **kwargs): super(UnknownTarget, self).__init__(**kwargs) - self.unknown_map = kwargs.get('unknown_map', None) - - -class UnknownTargetProperties(StorageTargetProperties): - """Storage container for use as an Unknown Storage Target. - - All required parameters must be populated in order to send to Azure. - - :param junctions: List of Cache namespace junctions to target for - namespace associations. - :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] - :param provisioning_state: ARM provisioning state, see - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. - Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', - 'Deleting', 'Updating' - :type provisioning_state: str or - ~azure.mgmt.storagecache.models.ProvisioningStateType - :param nfs3: Properties when targetType is nfs3. - :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target - :param clfs: Properties when targetType is clfs. - :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget - :param unknown: Properties when targetType is unknown. - :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget - :param target_type: Required. Constant filled by server. - :type target_type: str - """ - - _validation = { - 'target_type': {'required': True}, - } - - _attribute_map = { - 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, - 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, - 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, - 'target_type': {'key': 'targetType', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UnknownTargetProperties, self).__init__(**kwargs) - self.target_type = 'unknown' + self.attributes = kwargs.get('attributes', None) 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 cee45a566e3f..f5056a3eddfc 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 @@ -109,7 +109,7 @@ class AscOperation(Model): :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 + :param output: Additional operation-specific output. :type output: dict[str, object] """ @@ -134,6 +134,27 @@ def __init__(self, *, id: str=None, name: str=None, start_time: str=None, end_ti self.output = output +class BlobNfsTarget(Model): + """Properties pertaining to the BlobNfsTarget. + + :param target: Resource ID of the storage container. + :type target: str + :param usage_model: Identifies the StorageCache usage model to be used for + this storage target. + :type usage_model: str + """ + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'usage_model': {'key': 'usageModel', 'type': 'str'}, + } + + def __init__(self, *, target: str=None, usage_model: str=None, **kwargs) -> None: + super(BlobNfsTarget, self).__init__(**kwargs) + self.target = target + self.usage_model = usage_model + + class Cache(Model): """A Cache instance. Follows Azure Resource Manager standards: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md. @@ -141,8 +162,8 @@ class Cache(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param tags: ARM tags as name/value pairs. - :type tags: object + :param tags: Resource tags. + :type tags: dict[str, str] :ivar id: Resource ID of the Cache. :vartype id: str :param location: Region name string. @@ -199,7 +220,7 @@ class Cache(Model): } _attribute_map = { - 'tags': {'key': 'tags', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'id': {'key': 'id', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, @@ -382,23 +403,35 @@ class CacheHealth(Model): """An indication of Cache health. Gives more information about health than just that related to provisioning. + Variables are only populated by the server, and will be ignored when + sending a request. + :param state: List of Cache health states. Possible values include: 'Unknown', 'Healthy', 'Degraded', 'Down', 'Transitioning', 'Stopping', 'Stopped', 'Upgrading', 'Flushing' :type state: str or ~azure.mgmt.storagecache.models.HealthStateType :param status_description: Describes explanation of state. :type status_description: str + :ivar conditions: Outstanding conditions that need to be investigated and + resolved. + :vartype conditions: list[~azure.mgmt.storagecache.models.Condition] """ + _validation = { + 'conditions': {'readonly': True}, + } + _attribute_map = { 'state': {'key': 'state', 'type': 'str'}, 'status_description': {'key': 'statusDescription', 'type': 'str'}, + 'conditions': {'key': 'conditions', 'type': '[Condition]'}, } def __init__(self, *, state=None, status_description: str=None, **kwargs) -> None: super(CacheHealth, self).__init__(**kwargs) self.state = state self.status_description = status_description + self.conditions = None class CacheIdentity(Model): @@ -446,6 +479,14 @@ class CacheNetworkSettings(Model): :ivar utility_addresses: Array of additional IP addresses used by this Cache. :vartype utility_addresses: list[str] + :param dns_servers: DNS servers for the cache to use. It will be set from + the network configuration if no value is provided. + :type dns_servers: list[str] + :param dns_search_domain: DNS search domain + :type dns_search_domain: str + :param ntp_server: NTP server IP Address or FQDN for the cache to use. The + default is time.windows.com. + :type ntp_server: str """ _validation = { @@ -456,12 +497,18 @@ class CacheNetworkSettings(Model): _attribute_map = { 'mtu': {'key': 'mtu', 'type': 'int'}, 'utility_addresses': {'key': 'utilityAddresses', 'type': '[str]'}, + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'dns_search_domain': {'key': 'dnsSearchDomain', 'type': 'str'}, + 'ntp_server': {'key': 'ntpServer', 'type': 'str'}, } - def __init__(self, *, mtu: int=1500, **kwargs) -> None: + def __init__(self, *, mtu: int=1500, dns_servers=None, dns_search_domain: str=None, ntp_server: str=None, **kwargs) -> None: super(CacheNetworkSettings, self).__init__(**kwargs) self.mtu = mtu self.utility_addresses = None + self.dns_servers = dns_servers + self.dns_search_domain = dns_search_domain + self.ntp_server = ntp_server class CacheSecuritySettings(Model): @@ -673,103 +720,6 @@ def __init__(self, *, target: str=None, **kwargs) -> None: self.target = target -class StorageTargetProperties(Model): - """Properties of the Storage Target. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Nfs3TargetProperties, ClfsTargetProperties, - UnknownTargetProperties - - All required parameters must be populated in order to send to Azure. - - :param junctions: List of Cache namespace junctions to target for - namespace associations. - :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] - :param provisioning_state: ARM provisioning state, see - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. - Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', - 'Deleting', 'Updating' - :type provisioning_state: str or - ~azure.mgmt.storagecache.models.ProvisioningStateType - :param nfs3: Properties when targetType is nfs3. - :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target - :param clfs: Properties when targetType is clfs. - :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget - :param unknown: Properties when targetType is unknown. - :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget - :param target_type: Required. Constant filled by server. - :type target_type: str - """ - - _validation = { - 'target_type': {'required': True}, - } - - _attribute_map = { - 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, - 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, - 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, - 'target_type': {'key': 'targetType', 'type': 'str'}, - } - - _subtype_map = { - 'target_type': {'nfs3': 'Nfs3TargetProperties', 'clfs': 'ClfsTargetProperties', 'unknown': 'UnknownTargetProperties'} - } - - 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.provisioning_state = provisioning_state - self.nfs3 = nfs3 - self.clfs = clfs - self.unknown = unknown - self.target_type = None - - -class ClfsTargetProperties(StorageTargetProperties): - """Storage container for use as a CLFS Storage Target. - - All required parameters must be populated in order to send to Azure. - - :param junctions: List of Cache namespace junctions to target for - namespace associations. - :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] - :param provisioning_state: ARM provisioning state, see - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. - Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', - 'Deleting', 'Updating' - :type provisioning_state: str or - ~azure.mgmt.storagecache.models.ProvisioningStateType - :param nfs3: Properties when targetType is nfs3. - :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target - :param clfs: Properties when targetType is clfs. - :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget - :param unknown: Properties when targetType is unknown. - :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget - :param target_type: Required. Constant filled by server. - :type target_type: str - """ - - _validation = { - 'target_type': {'required': True}, - } - - _attribute_map = { - 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, - 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, - 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, - 'target_type': {'key': 'targetType', 'type': 'str'}, - } - - 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): """An error response. @@ -829,6 +779,34 @@ def __init__(self, *, code: str=None, details=None, message: str=None, target: s self.target = target +class Condition(Model): + """Outstanding conditions that will need to be resolved. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar timestamp: The time when the condition was raised. + :vartype timestamp: datetime + :ivar message: The issue requiring attention. + :vartype message: str + """ + + _validation = { + 'timestamp': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Condition, self).__init__(**kwargs) + self.timestamp = None + self.message = None + + class ErrorResponse(Model): """Describes the format of Error response. @@ -1003,8 +981,8 @@ class Nfs3Target(Model): :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 usage model to be used for this Storage - Target. Get choices from .../usageModels + :param usage_model: Identifies the StorageCache usage model to be used for + this storage target. :type usage_model: str """ @@ -1023,48 +1001,6 @@ def __init__(self, *, target: str=None, usage_model: str=None, **kwargs) -> None self.usage_model = usage_model -class Nfs3TargetProperties(StorageTargetProperties): - """An NFSv3 mount point for use as a Storage Target. - - All required parameters must be populated in order to send to Azure. - - :param junctions: List of Cache namespace junctions to target for - namespace associations. - :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] - :param provisioning_state: ARM provisioning state, see - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. - Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', - 'Deleting', 'Updating' - :type provisioning_state: str or - ~azure.mgmt.storagecache.models.ProvisioningStateType - :param nfs3: Properties when targetType is nfs3. - :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target - :param clfs: Properties when targetType is clfs. - :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget - :param unknown: Properties when targetType is unknown. - :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget - :param target_type: Required. Constant filled by server. - :type target_type: str - """ - - _validation = { - 'target_type': {'required': True}, - } - - _attribute_map = { - 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, - 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, - 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, - '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. @@ -1125,10 +1061,10 @@ class NfsAccessRule(Model): :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" . + 65534 will be used if not provided. :type anonymous_uid: str :param anonymous_gid: GID value that replaces 0 when rootSquash is true. - Default value: "-2" . + This will use the value of anonymousUID if not provided. :type anonymous_gid: str """ @@ -1148,7 +1084,7 @@ class NfsAccessRule(Model): '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: + def __init__(self, *, scope, access, filter: str=None, suid: bool=None, submount_access: bool=None, root_squash: bool=None, anonymous_uid: str=None, anonymous_gid: str=None, **kwargs) -> None: super(NfsAccessRule, self).__init__(**kwargs) self.scope = scope self.filter = filter @@ -1340,6 +1276,8 @@ class StorageTarget(StorageTargetResource): 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. + :ivar name: Name of the Storage Target. :vartype name: str :ivar id: Resource ID of the Storage Target. @@ -1354,6 +1292,10 @@ class StorageTarget(StorageTargetResource): :param junctions: List of Cache namespace junctions to target for namespace associations. :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] + :param target_type: Required. Type of the Storage Target. Possible values + include: 'nfs3', 'clfs', 'unknown', 'blobNfs' + :type target_type: str or + ~azure.mgmt.storagecache.models.StorageTargetType :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', @@ -1366,6 +1308,8 @@ class StorageTarget(StorageTargetResource): :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget :param unknown: Properties when targetType is unknown. :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget + :param blob_nfs: Properties when targetType is blobNfs. + :type blob_nfs: ~azure.mgmt.storagecache.models.BlobNfsTarget """ _validation = { @@ -1374,6 +1318,7 @@ class StorageTarget(StorageTargetResource): 'type': {'readonly': True}, 'location': {'readonly': True}, 'system_data': {'readonly': True}, + 'target_type': {'required': True}, } _attribute_map = { @@ -1383,19 +1328,23 @@ class StorageTarget(StorageTargetResource): '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'}, + 'blob_nfs': {'key': 'properties.blobNfs', 'type': 'BlobNfsTarget'}, } - def __init__(self, *, junctions=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, **kwargs) -> None: + def __init__(self, *, target_type, junctions=None, provisioning_state=None, nfs3=None, clfs=None, unknown=None, blob_nfs=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 + self.blob_nfs = blob_nfs class SystemData(Model): @@ -1416,8 +1365,7 @@ class SystemData(Model): '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. + :param last_modified_at: The timestamp of resource last modification (UTC) :type last_modified_at: datetime """ @@ -1443,60 +1391,18 @@ def __init__(self, *, created_by: str=None, created_by_type=None, created_at=Non class UnknownTarget(Model): """Properties pertaining to the UnknownTarget. - :param unknown_map: Dictionary of string->string pairs containing + :param attributes: Dictionary of string->string pairs containing information about the Storage Target. - :type unknown_map: dict[str, str] + :type attributes: dict[str, str] """ _attribute_map = { - 'unknown_map': {'key': 'unknownMap', 'type': '{str}'}, + 'attributes': {'key': 'attributes', 'type': '{str}'}, } - def __init__(self, *, unknown_map=None, **kwargs) -> None: + def __init__(self, *, attributes=None, **kwargs) -> None: super(UnknownTarget, self).__init__(**kwargs) - self.unknown_map = unknown_map - - -class UnknownTargetProperties(StorageTargetProperties): - """Storage container for use as an Unknown Storage Target. - - All required parameters must be populated in order to send to Azure. - - :param junctions: List of Cache namespace junctions to target for - namespace associations. - :type junctions: list[~azure.mgmt.storagecache.models.NamespaceJunction] - :param provisioning_state: ARM provisioning state, see - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. - Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', - 'Deleting', 'Updating' - :type provisioning_state: str or - ~azure.mgmt.storagecache.models.ProvisioningStateType - :param nfs3: Properties when targetType is nfs3. - :type nfs3: ~azure.mgmt.storagecache.models.Nfs3Target - :param clfs: Properties when targetType is clfs. - :type clfs: ~azure.mgmt.storagecache.models.ClfsTarget - :param unknown: Properties when targetType is unknown. - :type unknown: ~azure.mgmt.storagecache.models.UnknownTarget - :param target_type: Required. Constant filled by server. - :type target_type: str - """ - - _validation = { - 'target_type': {'required': True}, - } - - _attribute_map = { - 'junctions': {'key': 'junctions', 'type': '[NamespaceJunction]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'nfs3': {'key': 'nfs3', 'type': 'Nfs3Target'}, - 'clfs': {'key': 'clfs', 'type': 'ClfsTarget'}, - 'unknown': {'key': 'unknown', 'type': 'UnknownTarget'}, - 'target_type': {'key': 'targetType', 'type': 'str'}, - } - - 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' + self.attributes = attributes 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 5c47b428d14b..f3953dbfc004 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 @@ -102,6 +102,14 @@ class UsernameDownloadedType(str, Enum): error = "Error" +class StorageTargetType(str, Enum): + + nfs3 = "nfs3" + clfs = "clfs" + unknown = "unknown" + blob_nfs = "blobNfs" + + class ReasonCode(str, Enum): quota_id = "QuotaId" 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 index ad9f25af498e..9e0dd74a3cfc 100644 --- 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 @@ -25,7 +25,7 @@ class AscOperations(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-10-01". + :ivar api_version: Client API version. Constant value: "2021-03-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-10-01" + self.api_version = "2021-03-01" self.config = config 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 7204c34cd752..6182bd16102b 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-10-01". + :ivar api_version: Client API version. Constant value: "2021-03-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-10-01" + self.api_version = "2021-03-01" self.config = config 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 4fc5100b2a80..1e2c8221c00f 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-10-01". + :ivar api_version: Client API version. Constant value: "2021-03-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-10-01" + self.api_version = "2021-03-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_skus_operations.py index 3c3e525d0fe0..989f41757225 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-10-01". + :ivar api_version: Client API version. Constant value: "2021-03-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-10-01" + self.api_version = "2021-03-01" self.config = config diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_storage_targets_operations.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_storage_targets_operations.py index 539a3b049434..ffbe4cf6099e 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-10-01". + :ivar api_version: Client API version. Constant value: "2021-03-01". """ models = models @@ -37,10 +37,94 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-10-01" + self.api_version = "2021-03-01" self.config = config + + def _dns_refresh_initial( + self, resource_group_name, cache_name, storage_target_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.dns_refresh.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}$'), + 'storageTargetName': self._serialize.url("storage_target_name", storage_target_name, 'str', pattern=r'^[-0-9a-zA-Z_]{1,80}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def dns_refresh( + self, resource_group_name, cache_name, storage_target_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Tells a storage target to refresh its DNS information. + + :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 storage_target_name: Name of Storage Target. + :type storage_target_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._dns_refresh_initial( + resource_group_name=resource_group_name, + cache_name=cache_name, + storage_target_name=storage_target_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) + dns_refresh.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}/dnsRefresh'} + def list_by_cache( self, resource_group_name, cache_name, custom_headers=None, raw=False, **operation_config): """Returns a list of Storage Targets for the specified Cache. @@ -211,9 +295,7 @@ def get( :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 not be greater than 80 and chars must be from the [-0-9a-zA-Z_] - char class. + :param storage_target_name: Name of Storage Target. :type storage_target_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -337,9 +419,7 @@ def create_or_update( :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 not be greater than 80 and chars must be from the [-0-9a-zA-Z_] - char class. + :param storage_target_name: Name of Storage Target. :type storage_target_name: str :param storagetarget: Object containing the definition of a Storage Target. diff --git a/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_usage_models_operations.py b/sdk/storage/azure-mgmt-storagecache/azure/mgmt/storagecache/operations/_usage_models_operations.py index 77fdd171f756..c79c028e0c50 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-10-01". + :ivar api_version: Client API version. Constant value: "2021-03-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-10-01" + self.api_version = "2021-03-01" self.config = config From 4f72ab64d8ecbcd49d7287178ccfca2fdd450712 Mon Sep 17 00:00:00 2001 From: "Yan Zhang (WICRESOFT NORTH AMERICA LTD)" Date: Mon, 8 Mar 2021 11:01:08 +0800 Subject: [PATCH 2/2] test,version,CHANGELOG --- sdk/storage/azure-mgmt-storagecache/CHANGELOG.md | 16 ++++++++++++++++ .../azure/mgmt/storagecache/version.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sdk/storage/azure-mgmt-storagecache/CHANGELOG.md b/sdk/storage/azure-mgmt-storagecache/CHANGELOG.md index fea2c2652689..c4ec98ca5c96 100644 --- a/sdk/storage/azure-mgmt-storagecache/CHANGELOG.md +++ b/sdk/storage/azure-mgmt-storagecache/CHANGELOG.md @@ -1,5 +1,21 @@ # Release History +## 0.5.0 (2021-03-08) + +**Features** + + - Model CacheHealth has a new parameter conditions + - Model StorageTarget has a new parameter blob_nfs + - Model CacheNetworkSettings has a new parameter dns_search_domain + - Model CacheNetworkSettings has a new parameter ntp_server + - Model CacheNetworkSettings has a new parameter dns_servers + - Added operation StorageTargetsOperations.dns_refresh + +**Breaking changes** + + - Model StorageTarget has a new required parameter target_type + - Model UnknownTarget has a new signature + ## 0.4.0 (2021-02-18) **Features** 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 85da2c00c1a6..266f5a486d79 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.4.0" +VERSION = "0.5.0"