diff --git a/src/azure-cli-core/azure/cli/core/profiles/_shared.py b/src/azure-cli-core/azure/cli/core/profiles/_shared.py index 5823b316ebd..9f42ec3b38f 100644 --- a/src/azure-cli-core/azure/cli/core/profiles/_shared.py +++ b/src/azure-cli-core/azure/cli/core/profiles/_shared.py @@ -155,7 +155,7 @@ def default_api_version(self): AZURE_API_PROFILES = { 'latest': { - ResourceType.MGMT_STORAGE: '2024-01-01', + ResourceType.MGMT_STORAGE: None, ResourceType.MGMT_NETWORK: '2022-01-01', ResourceType.MGMT_COMPUTE: SDKProfile('2024-11-01', { 'resource_skus': '2019-04-01', diff --git a/src/azure-cli/azure/cli/command_modules/storage/__init__.py b/src/azure-cli/azure/cli/command_modules/storage/__init__.py index 735e2f3c030..3dabf258f3c 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/storage/__init__.py @@ -133,7 +133,6 @@ def register_common_storage_account_options(self): arg_type=get_three_state_flag()) self.argument('sku', help='The storage account SKU.', arg_type=get_enum_type(t_sku_name)) self.argument('assign_identity', action='store_true', resource_type=ResourceType.MGMT_STORAGE, - min_api='2017-06-01', help='Generate and assign a new Storage Account Identity for this storage account for use ' 'with key management services like Azure KeyVault.') self.argument('access_tier', arg_type=get_enum_type(t_access_tier), @@ -146,7 +145,7 @@ def register_common_storage_account_options(self): encryption_choices = list( t_encryption_services._attribute_map.keys()) # pylint: disable=protected-access self.argument('encryption_services', arg_type=get_enum_type(encryption_choices), - resource_type=ResourceType.MGMT_STORAGE, min_api='2016-12-01', nargs='+', + resource_type=ResourceType.MGMT_STORAGE, nargs='+', validator=validate_encryption_services, help='Specifies which service(s) to encrypt.') def register_precondition_options(self, prefix=''): diff --git a/src/azure-cli/azure/cli/command_modules/storage/_params.py b/src/azure-cli/azure/cli/command_modules/storage/_params.py index 420aef94182..8f006f9dc28 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/_params.py +++ b/src/azure-cli/azure/cli/command_modules/storage/_params.py @@ -78,44 +78,44 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem progress_type = CLIArgumentType(help='Include this flag to disable progress reporting for the command.', action='store_true', validator=add_progress_callback) large_file_share_type = CLIArgumentType( - action='store_true', min_api='2019-04-01', + action='store_true', help='Enable the capability to support large file shares with more than 5 TiB capacity for storage account.' 'Once the property is enabled, the feature cannot be disabled. Currently only supported for LRS and ' 'ZRS replication types, hence account conversions to geo-redundant accounts would not be possible. ' 'For more information, please refer to https://go.microsoft.com/fwlink/?linkid=2086047.') - adds_type = CLIArgumentType(arg_type=get_three_state_flag(), min_api='2019-04-01', + adds_type = CLIArgumentType(arg_type=get_three_state_flag(), arg_group='Azure Files Identity Based Authentication', help='Enable Azure Files Active Directory Domain Service Authentication for ' 'storage account. When --enable-files-adds is set to true, Azure Active ' 'Directory Properties arguments must be provided.') - aadkerb_type = CLIArgumentType(arg_type=get_three_state_flag(), min_api='2022-05-01', + aadkerb_type = CLIArgumentType(arg_type=get_three_state_flag(), arg_group='Azure Files Identity Based Authentication', help='Enable Azure Files Active Directory Domain Service Kerberos Authentication ' 'for the storage account') - aadds_type = CLIArgumentType(arg_type=get_three_state_flag(), min_api='2018-11-01', + aadds_type = CLIArgumentType(arg_type=get_three_state_flag(), arg_group='Azure Files Identity Based Authentication', help='Enable Azure Active Directory Domain Services authentication for Azure Files') - domain_name_type = CLIArgumentType(min_api='2019-04-01', arg_group="Azure Active Directory Properties", + domain_name_type = CLIArgumentType(arg_group="Azure Active Directory Properties", help="Specify the primary domain that the AD DNS server is authoritative for. " "Required when --enable-files-adds is set to True") - net_bios_domain_name_type = CLIArgumentType(min_api='2019-04-01', arg_group="Azure Active Directory Properties", + net_bios_domain_name_type = CLIArgumentType(arg_group="Azure Active Directory Properties", help="Specify the NetBIOS domain name. " "Required when --enable-files-adds is set to True") - forest_name_type = CLIArgumentType(min_api='2019-04-01', arg_group="Azure Active Directory Properties", + forest_name_type = CLIArgumentType(arg_group="Azure Active Directory Properties", help="Specify the Active Directory forest to get. " "Required when --enable-files-adds is set to True") - domain_guid_type = CLIArgumentType(min_api='2019-04-01', arg_group="Azure Active Directory Properties", + domain_guid_type = CLIArgumentType(arg_group="Azure Active Directory Properties", help="Specify the domain GUID. Required when --enable-files-adds is set to True") - domain_sid_type = CLIArgumentType(min_api='2019-04-01', arg_group="Azure Active Directory Properties", + domain_sid_type = CLIArgumentType(arg_group="Azure Active Directory Properties", help="Specify the security identifier (SID). Required when --enable-files-adds " "is set to True") - azure_storage_sid_type = CLIArgumentType(min_api='2019-04-01', arg_group="Azure Active Directory Properties", + azure_storage_sid_type = CLIArgumentType(arg_group="Azure Active Directory Properties", help="Specify the security identifier (SID) for Azure Storage. " "Required when --enable-files-adds is set to True") - sam_account_name_type = CLIArgumentType(min_api='2021-08-01', arg_group="Azure Active Directory Properties", + sam_account_name_type = CLIArgumentType(arg_group="Azure Active Directory Properties", help="Specify the Active Directory SAMAccountName for Azure Storage.") - t_account_type = self.get_models('ActiveDirectoryPropertiesAccountType', resource_type=ResourceType.MGMT_STORAGE) - account_type_type = CLIArgumentType(min_api='2021-08-01', arg_group="Azure Active Directory Properties", + t_account_type = self.get_models('AccountType', resource_type=ResourceType.MGMT_STORAGE) + account_type_type = CLIArgumentType(arg_group="Azure Active Directory Properties", arg_type=get_enum_type(t_account_type), help="Specify the Active Directory account type for Azure Storage.") exclude_pattern_type = CLIArgumentType(arg_group='Additional Flags', help='Exclude these files where the name ' @@ -137,13 +137,12 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem t_routing_choice = self.get_models('RoutingChoice', resource_type=ResourceType.MGMT_STORAGE) routing_choice_type = CLIArgumentType( arg_group='Routing Preference', arg_type=get_enum_type(t_routing_choice), - help='Routing Choice defines the kind of network routing opted by the user.', - min_api='2019-06-01') + help='Routing Choice defines the kind of network routing opted by the user.') publish_microsoft_endpoints_type = CLIArgumentType( - arg_group='Routing Preference', arg_type=get_three_state_flag(), min_api='2019-06-01', + arg_group='Routing Preference', arg_type=get_three_state_flag(), help='A boolean flag which indicates whether microsoft routing storage endpoints are to be published.') publish_internet_endpoints_type = CLIArgumentType( - arg_group='Routing Preference', arg_type=get_three_state_flag(), min_api='2019-06-01', + arg_group='Routing Preference', arg_type=get_three_state_flag(), help='A boolean flag which indicates whether internet routing storage endpoints are to be published.') umask_type = CLIArgumentType( @@ -190,23 +189,23 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem type=get_datetime_type(False)) allow_shared_key_access_type = CLIArgumentType( - arg_type=get_three_state_flag(), options_list=['--allow-shared-key-access', '-k'], min_api='2019-04-01', + arg_type=get_three_state_flag(), options_list=['--allow-shared-key-access', '-k'], help='Indicate whether the storage account permits requests to be authorized with the account access key via ' 'Shared Key. If false, then all requests, including shared access signatures, must be authorized with ' 'Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.') sas_expiration_period_type = CLIArgumentType( - options_list=['--sas-expiration-period', '--sas-exp'], min_api='2021-02-01', + options_list=['--sas-expiration-period', '--sas-exp'], help='Expiration period of the SAS Policy assigned to the storage account, DD.HH:MM:SS.' ) key_expiration_period_in_days_type = CLIArgumentType( - options_list=['--key-expiration-period-in-days', '--key-exp-days'], min_api='2021-02-01', type=int, + options_list=['--key-expiration-period-in-days', '--key-exp-days'], type=int, help='Expiration period in days of the Key Policy assigned to the storage account' ) allow_cross_tenant_replication_type = CLIArgumentType( - arg_type=get_three_state_flag(), options_list=['--allow-cross-tenant-replication', '-r'], min_api='2021-04-01', + arg_type=get_three_state_flag(), options_list=['--allow-cross-tenant-replication', '-r'], help='Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing ' 'accounts only if object replication policies will involve storage accounts in different AAD tenants. ' 'If not specified, the default value is false for new accounts to follow best security practices.') @@ -216,7 +215,6 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem default_share_permission_type = CLIArgumentType( options_list=['--default-share-permission', '-d'], arg_type=get_enum_type(t_share_permission), - min_api='2020-08-01-preview', arg_group='Azure Files Identity Based Authentication', help='Default share permission for users using Kerberos authentication if RBAC role is not assigned.') @@ -225,7 +223,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem t_rehydrate_priority = self.get_sdk('_generated.models._azure_blob_storage_enums#RehydratePriority', resource_type=ResourceType.DATA_STORAGE_BLOB) tier_type = CLIArgumentType( - arg_type=get_enum_type(t_blob_tier), min_api='2019-02-02', + arg_type=get_enum_type(t_blob_tier), help='The tier value to set the blob to. For page blob, the tier correlates to the size of the blob ' 'and number of allowed IOPS. Possible values are P10, P15, P20, P30, P4, P40, P50, P6, P60, P70, P80 ' 'and this is only applicable to page blobs on premium storage accounts; For block blob, possible ' @@ -242,7 +240,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem ) immutability_period_since_creation_in_days_type = CLIArgumentType( - options_list=['--immutability-period-in-days', '--immutability-period'], min_api='2021-06-01', + options_list=['--immutability-period-in-days', '--immutability-period'], help='The immutability period for the blobs in the container since the policy creation, in days.' ) @@ -251,7 +249,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem resource_type=ResourceType.MGMT_STORAGE) immutability_policy_state_type = CLIArgumentType( arg_type=get_enum_type(account_immutability_policy_state_enum), - options_list='--immutability-state', min_api='2021-06-01', + options_list='--immutability-state', help='Defines the mode of the policy. Disabled state disables the policy, ' 'Unlocked state allows increase and decrease of immutability retention time ' 'and also allows toggling allow-protected-append-write property, ' @@ -329,16 +327,14 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem c.argument('kind', help='Indicate the type of storage account.', arg_type=get_enum_type(t_kind), default='StorageV2' if self.cli_ctx.cloud.profile == 'latest' else 'Storage') - c.argument('https_only', arg_type=get_three_state_flag(), min_api='2019-04-01', + c.argument('https_only', arg_type=get_three_state_flag(), help='Allow https traffic only to storage service if set to true. The default value is true.') - c.argument('https_only', arg_type=get_three_state_flag(), max_api='2018-11-01', - help='Allow https traffic only to storage service if set to true. The default value is false.') c.argument('tags', tags_type) c.argument('custom_domain', help='User domain assigned to the storage account. Name is the CNAME source.') c.argument('sku', help='The storage account SKU.', arg_type=get_enum_type(t_sku_name, default='standard_ragrs')) - c.argument('enable_sftp', arg_type=get_three_state_flag(), min_api='2021-08-01', + c.argument('enable_sftp', arg_type=get_three_state_flag(), help='Enable Secure File Transfer Protocol.') - c.argument('enable_local_user', arg_type=get_three_state_flag(), min_api='2021-08-01', + c.argument('enable_local_user', arg_type=get_three_state_flag(), help='Enable local user features.') c.argument('enable_files_aadds', aadds_type) c.argument('enable_files_adds', adds_type) @@ -356,18 +352,17 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem options_list=['--enable-hierarchical-namespace', '--hns', c.deprecate(target='--hierarchical-namespace', redirect='--hns', hide=True)], help=" Allow the blob service to exhibit filesystem semantics. This property can be enabled only " - "when storage account kind is StorageV2.", - min_api='2018-02-01') + "when storage account kind is StorageV2.") c.argument('encryption_key_type_for_table', arg_type=get_enum_type(['Account', 'Service']), help='Set the encryption key type for Table service. "Account": Table will be encrypted ' 'with account-scoped encryption key. "Service": Table will always be encrypted with ' 'service-scoped keys. Currently the default encryption key type is "Service".', - min_api='2019-06-01', options_list=['--encryption-key-type-for-table', '-t']) + options_list=['--encryption-key-type-for-table', '-t']) c.argument('encryption_key_type_for_queue', arg_type=get_enum_type(['Account', 'Service']), help='Set the encryption key type for Queue service. "Account": Queue will be encrypted ' 'with account-scoped encryption key. "Service": Queue will always be encrypted with ' 'service-scoped keys. Currently the default encryption key type is "Service".', - min_api='2019-06-01', options_list=['--encryption-key-type-for-queue', '-q']) + options_list=['--encryption-key-type-for-queue', '-q']) c.argument('routing_choice', routing_choice_type) c.argument('publish_microsoft_endpoints', publish_microsoft_endpoints_type) c.argument('publish_internet_endpoints', publish_internet_endpoints_type) @@ -375,7 +370,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem arg_type=get_three_state_flag(), help='A boolean indicating whether or not the service applies a secondary layer of encryption with ' 'platform managed keys for data at rest.') - c.argument('allow_blob_public_access', arg_type=get_three_state_flag(), min_api='2019-04-01', + c.argument('allow_blob_public_access', arg_type=get_three_state_flag(), help='Allow or disallow public access to all blobs or containers in the storage account. ' 'If not specified, the default value is false for new accounts to follow best security practices. ' 'When true, containers in the account may ' @@ -387,7 +382,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem 'While the default setting is TLS 1.0 for this property, ' 'Microsoft recommends setting MinimumTlsVersion to 1.2 or above.') c.argument('allow_shared_key_access', allow_shared_key_access_type) - c.argument('edge_zone', edge_zone_type, min_api='2020-08-01-preview') + c.argument('edge_zone', edge_zone_type) c.argument('identity_type', arg_type=get_enum_type(t_identity_type), arg_group='Identity', help='The identity type.') c.argument('user_identity_id', arg_group='Identity', @@ -397,9 +392,9 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem c.argument('sas_expiration_period', sas_expiration_period_type, is_preview=True) c.argument('allow_cross_tenant_replication', allow_cross_tenant_replication_type) c.argument('default_share_permission', default_share_permission_type) - c.argument('enable_nfs_v3', arg_type=get_three_state_flag(), min_api='2021-01-01', + c.argument('enable_nfs_v3', arg_type=get_three_state_flag(), help='NFS 3.0 protocol support enabled if sets to true.') - c.argument('enable_alw', arg_type=get_three_state_flag(), min_api='2021-06-01', + c.argument('enable_alw', arg_type=get_three_state_flag(), help='The account level immutability property. The property is immutable and can only be set to true' ' at the account creation time. When set to true, it enables object level immutability for all ' 'the containers in the account by default.', @@ -414,18 +409,17 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem validator=validate_immutability_arguments) c.argument('allow_protected_append_writes', arg_type=get_three_state_flag(), options_list=['--allow-protected-append-writes', '--allow-append', '-w'], - min_api='2021-06-01', help='This property can only be changed for disabled and unlocked time-based retention policies. ' 'When enabled, new blocks can be written to an append blob while maintaining immutability ' 'protection and compliance. Only new blocks can be added and any existing blocks cannot be ' 'modified or deleted.', arg_group='Account Level Immutability', validator=validate_immutability_arguments) - c.argument('public_network_access', arg_type=get_enum_type(public_network_access_enum), min_api='2021-06-01', + c.argument('public_network_access', arg_type=get_enum_type(public_network_access_enum), help='Enable or disable public network access to the storage account. ' 'Possible values include: `Enabled` or `Disabled`.') c.argument('dns_endpoint_type', arg_type=get_enum_type(t_dns_endpoint_type), - options_list=['--dns-endpoint-type', '--endpoint'], min_api='2021-09-01', + options_list=['--dns-endpoint-type', '--endpoint'], help='Allow you to specify the type of endpoint. Set this to AzureDNSZone to create a large number ' 'of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the ' 'endpoint URL will have an alphanumeric DNS Zone identifier.') @@ -461,9 +455,9 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem c.argument('use_subdomain', help='Specify whether to use indirect CNAME validation.', arg_type=get_enum_type(['true', 'false'])) c.argument('tags', tags_type, default=None) - c.argument('enable_sftp', arg_type=get_three_state_flag(), min_api='2021-08-01', + c.argument('enable_sftp', arg_type=get_three_state_flag(), help='Enable Secure File Transfer Protocol.') - c.argument('enable_local_user', arg_type=get_three_state_flag(), min_api='2021-08-01', + c.argument('enable_local_user', arg_type=get_three_state_flag(), help='Enable local user features.') c.argument('enable_files_aadds', aadds_type) c.argument('enable_files_adds', adds_type) @@ -480,7 +474,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem c.argument('routing_choice', routing_choice_type) c.argument('publish_microsoft_endpoints', publish_microsoft_endpoints_type) c.argument('publish_internet_endpoints', publish_internet_endpoints_type) - c.argument('allow_blob_public_access', arg_type=get_three_state_flag(), min_api='2019-04-01', + c.argument('allow_blob_public_access', arg_type=get_three_state_flag(), help='Allow or disallow public access to all blobs or containers in the storage account. ' 'If not specified, the default value is false for new account to follow best security practices. ' 'When true, containers ' @@ -508,13 +502,12 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem arg_group='Account Level Immutability') c.argument('allow_protected_append_writes', arg_type=get_three_state_flag(), options_list=['--allow-protected-append-writes', '--allow-append', '-w'], - min_api='2021-06-01', help='This property can only be changed for disabled and unlocked time-based retention policies. ' 'When enabled, new blocks can be written to an append blob while maintaining immutability ' 'protection and compliance. Only new blocks can be added and any existing blocks cannot be ' 'modified or deleted.', arg_group='Account Level Immutability') - c.argument('public_network_access', arg_type=get_enum_type(public_network_access_enum), min_api='2021-06-01', + c.argument('public_network_access', arg_type=get_enum_type(public_network_access_enum), help='Enable or disable public network access to the storage account. ' 'Possible values include: `Enabled` or `Disabled`.') c.argument('upgrade_to_storagev2', arg_type=get_three_state_flag(), @@ -522,7 +515,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem c.argument('yes', options_list=['--yes', '-y'], help='Do not prompt for confirmation.', action='store_true') for scope in ['storage account create', 'storage account update']: - with self.argument_context(scope, arg_group='Customer managed key', min_api='2017-06-01', + with self.argument_context(scope, arg_group='Customer managed key', resource_type=ResourceType.MGMT_STORAGE) as c: t_key_source = self.get_models('KeySource', resource_type=ResourceType.MGMT_STORAGE) c.argument('encryption_key_name', help='The name of the KeyVault key.', ) @@ -535,17 +528,15 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem help='The default encryption key source', validator=validate_encryption_source) c.argument('key_vault_user_identity_id', options_list=['--key-vault-user-identity-id', '-u'], - min_api='2021-01-01', help='Resource identifier of the UserAssigned identity to be associated with server-side ' 'encryption on the storage account.') c.argument('federated_identity_client_id', options_list=['--key-vault-federated-client-id', '-f'], - min_api='2021-08-01', help='ClientId of the multi-tenant application to be used ' 'in conjunction with the user-assigned identity for ' 'cross-tenant customer-managed-keys server-side encryption on the storage account.') for scope in ['storage account create', 'storage account update']: - with self.argument_context(scope, resource_type=ResourceType.MGMT_STORAGE, min_api='2017-06-01', + with self.argument_context(scope, resource_type=ResourceType.MGMT_STORAGE, arg_group='Network Rule') as c: t_bypass, t_default_action = self.get_models('Bypass', 'DefaultAction', resource_type=ResourceType.MGMT_STORAGE) @@ -585,7 +576,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem 'use the key referenced by the identifier to enable customer-managed key support on this ' 'encryption scope.') c.argument('require_infrastructure_encryption', options_list=['--require-infrastructure-encryption', '-i'], - arg_type=get_three_state_flag(), min_api='2021-01-01', + arg_type=get_three_state_flag(), help='A boolean indicating whether or not the service applies a secondary layer of encryption ' 'with platform managed keys for data at rest.') @@ -609,9 +600,8 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem c.argument('marker', arg_type=marker_type) with self.argument_context('storage account keys list', resource_type=ResourceType.MGMT_STORAGE) as c: - t_expand_key_type = self.get_models('ListKeyExpand', resource_type=ResourceType.MGMT_STORAGE) c.argument("expand", options_list=['--expand-key-type'], help='Specify the expanded key types to be listed.', - arg_type=get_enum_type(t_expand_key_type), min_api='2019-04-01', is_preview=True) + arg_type=get_enum_type(['kerb']), is_preview=True) with self.argument_context('storage account keys renew', resource_type=ResourceType.MGMT_STORAGE) as c: from ._validators import validate_key_name @@ -619,7 +609,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem validator=validate_key_name, arg_type=get_enum_type(list(storage_account_key_options.keys()))) c.extra('key_type', help='The key type to regenerate. If --key-type is not specified, one of access keys will ' - 'be regenerated by default.', arg_type=get_enum_type(['kerb']), min_api='2019-04-01') + 'be regenerated by default.', arg_type=get_enum_type(['kerb'])) c.argument('account_name', acct_name_type, id_part=None) with self.argument_context('storage account management-policy create') as c: @@ -642,10 +632,8 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem c.argument('subnet', help='Name or ID of subnet. If name is supplied, `--vnet-name` must be supplied.') c.argument('vnet_name', help='Name of a virtual network.', validator=validate_subnet) c.argument('action', action_type) - c.argument('resource_id', help='The resource id to add in network rule.', arg_group='Resource Access Rule', - min_api='2020-08-01-preview') - c.argument('tenant_id', help='The tenant id to add in network rule.', arg_group='Resource Access Rule', - min_api='2020-08-01-preview') + c.argument('resource_id', help='The resource id to add in network rule.', arg_group='Resource Access Rule') + c.argument('tenant_id', help='The tenant id to add in network rule.', arg_group='Resource Access Rule') with self.argument_context('storage account blob-service-properties', resource_type=ResourceType.MGMT_STORAGE) as c: @@ -656,11 +644,11 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem resource_type=ResourceType.MGMT_STORAGE) as c: c.argument('account_name', acct_name_type, id_part=None) c.argument('resource_group_name', required=False, validator=process_resource_group) - c.argument('enable_change_feed', arg_type=get_three_state_flag(), min_api='2019-04-01', + c.argument('enable_change_feed', arg_type=get_three_state_flag(), arg_group='Change Feed Policy') c.argument('change_feed_retention_days', is_preview=True, options_list=['--change-feed-retention-days', '--change-feed-days'], - type=int, min_api='2019-06-01', arg_group='Change Feed Policy', + type=int, arg_group='Change Feed Policy', validator=validator_change_feed_retention_days, help='Indicate the duration of changeFeed retention in days. ' 'Minimum value is 1 day and maximum value is 146000 days (400 years). ' @@ -669,31 +657,29 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem c.argument('enable_container_delete_retention', arg_type=get_three_state_flag(), options_list=['--enable-container-delete-retention', '--container-retention'], - arg_group='Container Delete Retention Policy', min_api='2019-06-01', + arg_group='Container Delete Retention Policy', help='Enable container delete retention policy for container soft delete when set to true. ' 'Disable container delete retention policy when set to false.') c.argument('container_delete_retention_days', options_list=['--container-delete-retention-days', '--container-days'], type=int, arg_group='Container Delete Retention Policy', - min_api='2019-06-01', validator=validate_container_delete_retention_days, + validator=validate_container_delete_retention_days, help='Indicate the number of days that the deleted container should be retained. The minimum ' 'specified value can be 1 and the maximum value can be 365.') - c.argument('enable_delete_retention', arg_type=get_three_state_flag(), arg_group='Delete Retention Policy', - min_api='2018-07-01') + c.argument('enable_delete_retention', arg_type=get_three_state_flag(), arg_group='Delete Retention Policy') c.argument('delete_retention_days', type=int, arg_group='Delete Retention Policy', - validator=validate_delete_retention_days, min_api='2018-07-01') + validator=validate_delete_retention_days) c.argument('enable_restore_policy', arg_type=get_three_state_flag(), arg_group='Restore Policy', - min_api='2019-06-01', help="Enable blob restore policy when it set to true.") + help="Enable blob restore policy when it set to true.") c.argument('restore_days', type=int, arg_group='Restore Policy', - min_api='2019-06-01', help="The number of days for the blob can be restored. It should be greater " + help="The number of days for the blob can be restored. It should be greater " "than zero and less than Delete Retention Days.") - c.argument('enable_versioning', arg_type=get_three_state_flag(), help='Versioning is enabled if set to true.', - min_api='2019-06-01') + c.argument('enable_versioning', arg_type=get_three_state_flag(), help='Versioning is enabled if set to true.') c.argument('default_service_version', options_list=['--default-service-version', '-d'], - type=get_api_version_type(), min_api='2018-07-01', + type=get_api_version_type(), help="Indicate the default version to use for requests to the Blob service if an incoming request's " "version is not specified.") - c.argument('enable_last_access_tracking', arg_type=get_three_state_flag(), min_api='2019-06-01', + c.argument('enable_last_access_tracking', arg_type=get_three_state_flag(), options_list=['--enable-last-access-tracking', '-t'], help='When set to true last access time based tracking policy is enabled.') @@ -721,26 +707,25 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem c.argument('account_name', acct_name_type, id_part=None) c.argument('resource_group_name', required=False, validator=process_resource_group) c.argument('enable_delete_retention', arg_type=get_three_state_flag(), arg_group='Delete Retention Policy', - min_api='2019-06-01', help='Enable file service properties for share soft delete.') + help='Enable file service properties for share soft delete.') c.argument('delete_retention_days', type=int, arg_group='Delete Retention Policy', - validator=validate_file_delete_retention_days, min_api='2019-06-01', + validator=validate_file_delete_retention_days, help='Indicate the number of days that the deleted item should be retained. The minimum specified ' 'value can be 1 and the maximum value can be 365.') c.argument('enable_smb_multichannel', options_list=['--enable-smb-multichannel', '--mc'], - arg_type=get_three_state_flag(), min_api='2020-08-01-preview', arg_group='SMB Setting', + arg_type=get_three_state_flag(), arg_group='SMB Setting', help='Set SMB Multichannel setting for file service. Applies to Premium FileStorage only.') - c.argument('versions', arg_group='SMB Setting', min_api='2020-08-01-preview', + c.argument('versions', arg_group='SMB Setting', help="SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, " "SMB3.1.1. Should be passed as a string with delimiter ';'.") c.argument('authentication_methods', options_list='--auth-methods', arg_group='SMB Setting', - min_api='2020-08-01-preview', help="SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. " "Should be passed as a string with delimiter ';'.") c.argument('kerberos_ticket_encryption', options_list=['--kerb-ticket-encryption', '-k'], - arg_group='SMB Setting', min_api='2020-08-01-preview', + arg_group='SMB Setting', help="Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. " "Should be passed as a string with delimiter ';'.") - c.argument('channel_encryption', arg_group='SMB Setting', min_api='2020-08-01-preview', + c.argument('channel_encryption', arg_group='SMB Setting', help="SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, " "AES-256-GCM. Should be passed as a string with delimiter ';' ") @@ -1702,7 +1687,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem with self.argument_context('storage container-rm create', resource_type=ResourceType.MGMT_STORAGE) as c: c.argument('fail_on_exist', help='Throw an exception if the container already exists.') - c.argument('enable_vlw', arg_type=get_three_state_flag(), min_api='2021-01-01', is_preview=True, + c.argument('enable_vlw', arg_type=get_three_state_flag(), is_preview=True, help='The object level immutability property of the container. The property is immutable and can ' 'only be set to true at the container creation time. Existing containers must undergo a migration ' 'process.') @@ -1712,18 +1697,18 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem resource_type=ResourceType.MGMT_STORAGE) as c: from ._validators import validate_container_nfsv3_squash t_root_squash = self.get_models('RootSquashType', resource_type=ResourceType.MGMT_STORAGE) - c.extra('root_squash', arg_type=get_enum_type(t_root_squash), min_api='2021-06-01', + c.extra('root_squash', arg_type=get_enum_type(t_root_squash), help='Enable NFSv3 squash on blob container.', validator=validate_container_nfsv3_squash) c.ignore('enable_nfs_v3_root_squash') c.ignore('enable_nfs_v3_all_squash') with self.argument_context('storage container-rm create', resource_type=ResourceType.MGMT_STORAGE) as c: c.argument('default_encryption_scope', options_list=['--default-encryption-scope', '-d'], - arg_group='Encryption Policy', min_api='2019-06-01', + arg_group='Encryption Policy', help='Default the container to use specified encryption scope for all writes.') c.argument('deny_encryption_scope_override', options_list=['--deny-encryption-scope-override', '--deny-override'], - arg_type=get_three_state_flag(), arg_group='Encryption Policy', min_api='2019-06-01', + arg_type=get_three_state_flag(), arg_group='Encryption Policy', help='Block override of encryption scope from the container default.') with self.argument_context('storage container-rm list', resource_type=ResourceType.MGMT_STORAGE) as c: @@ -1756,11 +1741,11 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem 'This overwrites any existing metadata', validator=validate_metadata) c.argument('enabled_protocols', arg_type=get_enum_type(t_enabled_protocols), - min_api='2019-06-01', help='Immutable property for file shares protocol. NFS protocol will be ' + help='Immutable property for file shares protocol. NFS protocol will be ' 'only available for premium file shares (file shares in the FileStorage account type).') c.argument('root_squash', arg_type=get_enum_type(t_root_squash), - min_api='2019-06-01', help='Reduction of the access rights for the remote superuser.') - c.argument('access_tier', arg_type=get_enum_type(t_access_tier), min_api='2019-06-01', + help='Reduction of the access rights for the remote superuser.') + c.argument('access_tier', arg_type=get_enum_type(t_access_tier), help='Access tier for specific share. GpV2 account can choose between TransactionOptimized ' '(default), Hot, and Cool. FileStorage account can choose Premium.') @@ -2210,8 +2195,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem options_list='--services', required=False) with self.argument_context('storage cors add') as c: - t_cors_rule_allowed_methods = self.get_models('CorsRuleAllowedMethodsItem', - resource_type=ResourceType.MGMT_STORAGE) + t_cors_rule_allowed_methods = self.get_models('AllowedMethods', resource_type=ResourceType.MGMT_STORAGE) c.extra('services', validator=get_char_options_validator('bfqt', 'services'), required=True, options_list='--services') c.argument('max_age') diff --git a/src/azure-cli/azure/cli/command_modules/storage/commands.py b/src/azure-cli/azure/cli/command_modules/storage/commands.py index 66fb74e823b..edb737433e4 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/commands.py +++ b/src/azure-cli/azure/cli/command_modules/storage/commands.py @@ -109,18 +109,16 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT g.show_command('show', 'get_properties') g.custom_command('list', 'list_storage_accounts') g.custom_command( - 'show-usage', 'show_storage_account_usage', min_api='2018-02-01') - g.custom_command( - 'show-usage', 'show_storage_account_usage_no_location', max_api='2017-10-01') + 'show-usage', 'show_storage_account_usage') g.custom_command('show-connection-string', 'show_storage_account_connection_string') g.generic_update_command('update', getter_name='get_properties', setter_name='update', - custom_func_name='update_storage_account', min_api='2016-12-01') - g.custom_command('failover', 'begin_failover', supports_no_wait=True, is_preview=True, min_api='2018-07-01') + custom_func_name='update_storage_account') + g.custom_command('failover', 'begin_failover', supports_no_wait=True, is_preview=True) g.command('hns-migration start', 'begin_hierarchical_namespace_migration', - supports_no_wait=True, min_api='2021-06-01') + supports_no_wait=True) g.command('hns-migration stop', 'begin_abort_hierarchical_namespace_migration', - supports_no_wait=True, min_api='2021-06-01') + supports_no_wait=True) with self.command_group('storage account', storage_account_sdk_keys, resource_type=ResourceType.MGMT_STORAGE, custom_command_type=storage_account_custom_type) as g: @@ -128,7 +126,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT transform=lambda x: getattr(x, 'keys', x)) g.command('keys list', 'list_keys', transform=lambda x: getattr(x, 'keys', x)) - g.command('revoke-delegation-keys', 'revoke_user_delegation_keys', min_api='2019-04-01') + g.command('revoke-delegation-keys', 'revoke_user_delegation_keys') account_blob_service_custom_sdk = get_custom_sdk('account', client_factory=cf_blob_service, resource_type=ResourceType.DATA_STORAGE_BLOB) @@ -150,7 +148,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT with self.command_group('storage account blob-inventory-policy', blob_inventory_sdk, custom_command_type=blob_inventory_custom_type, is_preview=True, - resource_type=ResourceType.MGMT_STORAGE, min_api='2020-08-01-preview') as g: + resource_type=ResourceType.MGMT_STORAGE) as g: g.custom_command('create', 'create_blob_inventory_policy') g.generic_update_command('update', getter_name='get_blob_inventory_policy', getter_type=blob_inventory_custom_type, @@ -173,7 +171,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT with self.command_group('storage account encryption-scope', encryption_scope_sdk, custom_command_type=encryption_scope_custom_type, - resource_type=ResourceType.MGMT_STORAGE, min_api='2019-06-01') as g: + resource_type=ResourceType.MGMT_STORAGE) as g: g.custom_command('create', 'create_encryption_scope') g.show_command('show', 'get') @@ -196,7 +194,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT resource_type=ResourceType.MGMT_STORAGE) with self.command_group('storage account management-policy', management_policy_sdk, - resource_type=ResourceType.MGMT_STORAGE, min_api='2018-11-01', + resource_type=ResourceType.MGMT_STORAGE, custom_command_type=management_policy_custom_type) as g: g.custom_show_command('show', 'get_management_policy') g.custom_command('create', 'create_management_policies') @@ -208,7 +206,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT with self.command_group('storage account network-rule', storage_account_sdk, custom_command_type=storage_account_custom_type, - resource_type=ResourceType.MGMT_STORAGE, min_api='2017-06-01') as g: + resource_type=ResourceType.MGMT_STORAGE) as g: g.custom_command('add', 'add_network_rule') g.custom_command('list', 'list_network_rules') g.custom_command('remove', 'remove_network_rule') @@ -223,7 +221,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT client_factory=cf_or_policy) with self.command_group('storage account or-policy', or_policy_sdk, is_preview=True, - resource_type=ResourceType.MGMT_STORAGE, min_api='2019-06-01', + resource_type=ResourceType.MGMT_STORAGE, custom_command_type=or_policy_custom_type) as g: g.show_command('show', 'get') g.command('list', 'list') @@ -232,7 +230,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT g.command('delete', 'delete') with self.command_group('storage account or-policy rule', or_policy_sdk, is_preview=True, - resource_type=ResourceType.MGMT_STORAGE, min_api='2019-06-01', + resource_type=ResourceType.MGMT_STORAGE, custom_command_type=or_policy_custom_type) as g: g.custom_show_command('show', 'get_or_rule') g.custom_command('list', 'list_or_rules') @@ -242,7 +240,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT with self.command_group('storage account private-endpoint-connection', private_endpoint_sdk, custom_command_type=private_endpoint_custom_type, is_preview=True, - resource_type=ResourceType.MGMT_STORAGE, min_api='2019-06-01') as g: + resource_type=ResourceType.MGMT_STORAGE) as g: from ._validators import validate_private_endpoint_connection_id g.command('delete', 'delete', confirmation=True, validator=validate_private_endpoint_connection_id) g.show_command('show', 'get', validator=validate_private_endpoint_connection_id) @@ -254,12 +252,12 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT with self.command_group('storage account private-link-resource', private_link_resource_sdk, resource_type=ResourceType.MGMT_STORAGE) as g: from azure.cli.core.commands.transform import gen_dict_to_list_transform - g.command('list', 'list_by_storage_account', is_preview=True, min_api='2019-06-01', + g.command('list', 'list_by_storage_account', is_preview=True, transform=gen_dict_to_list_transform(key="value")) with self.command_group('storage account blob-service-properties', blob_service_mgmt_sdk, custom_command_type=storage_account_custom_type, - resource_type=ResourceType.MGMT_STORAGE, min_api='2018-07-01') as g: + resource_type=ResourceType.MGMT_STORAGE) as g: from ._transformers import transform_restore_policy_output g.show_command('show', 'get_service_properties', transform=transform_restore_policy_output) g.generic_update_command('update', @@ -269,7 +267,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT transform=transform_restore_policy_output) with self.command_group('storage account blob-service-properties cors-rule', - blob_service_mgmt_sdk, resource_type=ResourceType.MGMT_STORAGE, min_api='2022-09-01', + blob_service_mgmt_sdk, resource_type=ResourceType.MGMT_STORAGE, custom_command_type=get_custom_sdk('account', client_factory=cf_mgmt_blob_services, resource_type=ResourceType.MGMT_STORAGE)) as g: @@ -280,7 +278,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT with self.command_group('storage account file-service-properties', file_service_mgmt_sdk, custom_command_type=get_custom_sdk('account', client_factory=cf_mgmt_file_services, resource_type=ResourceType.MGMT_STORAGE), - resource_type=ResourceType.MGMT_STORAGE, min_api='2019-06-01') as g: + resource_type=ResourceType.MGMT_STORAGE) as g: g.show_command('show', 'get_service_properties') g.generic_update_command('update', getter_name='get_service_properties', @@ -302,7 +300,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT with self.command_group('storage account local-user', local_users_sdk, custom_command_type=local_users_custom_type, - resource_type=ResourceType.MGMT_STORAGE, min_api='2021-08-01') as g: + resource_type=ResourceType.MGMT_STORAGE) as g: g.custom_command('create', 'create_local_user') g.custom_command('update', 'update_local_user') g.command('delete', 'delete') @@ -432,7 +430,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT with self.command_group('storage blob', storage_account_sdk, resource_type=ResourceType.MGMT_STORAGE, custom_command_type=storage_blob_custom_type) as g: - g.custom_command('restore', 'restore_blob_ranges', min_api='2019-06-01', supports_no_wait=True) + g.custom_command('restore', 'restore_blob_ranges', supports_no_wait=True) with self.command_group('storage blob incremental-copy', operations_tmpl='azure.multiapi.storage.blob.pageblobservice#PageBlobService.{}', @@ -560,12 +558,11 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT with self.command_group('storage container-rm', command_type=blob_container_mgmt_sdk, custom_command_type=get_custom_sdk('blob', cf_blob_container_mgmt, resource_type=ResourceType.MGMT_STORAGE), - resource_type=ResourceType.MGMT_STORAGE, min_api='2018-02-01') as g: + resource_type=ResourceType.MGMT_STORAGE) as g: g.custom_command('create', 'create_container_rm') g.command('delete', 'delete', confirmation=True) - g.generic_update_command('update', setter_name='update', max_api='2019-04-01') g.generic_update_command('update', setter_name='update', setter_arg_name='blob_container', - custom_func_name='update_container_rm', min_api='2019-06-01') + custom_func_name='update_container_rm') g.custom_command('list', 'list_container_rm') g.custom_command('exists', 'container_rm_exists', transform=create_boolean_result_output_transformer('exists'), table_transformer=transform_boolean_for_table) @@ -596,12 +593,12 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT custom_command_type=get_custom_sdk('file', cf_mgmt_file_shares, resource_type=ResourceType.MGMT_STORAGE), - resource_type=ResourceType.MGMT_STORAGE, min_api='2019-04-01') as g: + resource_type=ResourceType.MGMT_STORAGE) as g: from ._transformers import transform_share_rm_output g.custom_command('exists', '_file_share_exists', transform=create_boolean_result_output_transformer('exists')) g.custom_command('stats', 'get_stats', transform=lambda x: getattr(x, 'share_usage_bytes')) g.custom_command('restore', 'restore_share_rm') - g.custom_command('snapshot', 'snapshot_share_rm', min_api='2020-08-01-preview', is_preview=True, + g.custom_command('snapshot', 'snapshot_share_rm', is_preview=True, transform=transform_share_rm_output) with self.command_group('storage share-rm'): diff --git a/src/azure-cli/azure/cli/command_modules/storage/operations/blob.py b/src/azure-cli/azure/cli/command_modules/storage/operations/blob.py index 8415c832443..7963a7f7686 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/operations/blob.py +++ b/src/azure-cli/azure/cli/command_modules/storage/operations/blob.py @@ -69,22 +69,19 @@ def create_container_rm(cmd, client, container_name, resource_group_name, accoun account_name=account_name, container_name=container_name): raise CLIError('The specified container already exists.') - if cmd.supported_api_version(min_api='2019-06-01', resource_type=ResourceType.MGMT_STORAGE): - BlobContainer = cmd.get_models('BlobContainer', resource_type=ResourceType.MGMT_STORAGE) - blob_container = BlobContainer(public_access=public_access, - default_encryption_scope=default_encryption_scope, - deny_encryption_scope_override=deny_encryption_scope_override, - metadata=metadata, - enable_nfs_v3_all_squash=enable_nfs_v3_all_squash, - enable_nfs_v3_root_squash=enable_nfs_v3_root_squash) - if enable_vlw is not None: - ImmutableStorageWithVersioning = cmd.get_models('ImmutableStorageWithVersioning', - resource_type=ResourceType.MGMT_STORAGE) - blob_container.immutable_storage_with_versioning = ImmutableStorageWithVersioning(enabled=enable_vlw) - return client.create(resource_group_name=resource_group_name, account_name=account_name, - container_name=container_name, blob_container=blob_container) + BlobContainer = cmd.get_models('BlobContainer', resource_type=ResourceType.MGMT_STORAGE) + blob_container = BlobContainer(public_access=public_access, + default_encryption_scope=default_encryption_scope, + deny_encryption_scope_override=deny_encryption_scope_override, + metadata=metadata, + enable_nfs_v3_all_squash=enable_nfs_v3_all_squash, + enable_nfs_v3_root_squash=enable_nfs_v3_root_squash) + if enable_vlw is not None: + ImmutableStorageWithVersioning = cmd.get_models('ImmutableStorageWithVersioning', + resource_type=ResourceType.MGMT_STORAGE) + blob_container.immutable_storage_with_versioning = ImmutableStorageWithVersioning(enabled=enable_vlw) return client.create(resource_group_name=resource_group_name, account_name=account_name, - container_name=container_name, public_access=public_access, metadata=metadata) + container_name=container_name, blob_container=blob_container) def update_container_rm(cmd, instance, metadata=None, public_access=None, diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py index bd6a48928a7..c4a294eaccf 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py @@ -17,9 +17,7 @@ from azure.cli.testsdk.scenario_tests import AllowLargeResponse -@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01') class StorageAccountTests(StorageScenarioMixin, ScenarioTest): - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2017-06-01') @ResourceGroupPreparer(name_prefix='cli_test_storage_service_endpoints') def test_storage_account_service_endpoints(self, resource_group): kwargs = { @@ -99,7 +97,6 @@ def test_storage_account_service_endpoints(self, resource_group): JMESPathCheck('length(virtualNetworkRules)', 0) ]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2020-08-01-preview') @ResourceGroupPreparer(name_prefix='cli_test_storage_service_endpoints') @StorageAccountPreparer() def test_storage_account_resource_access_rules(self, resource_group, storage_account): @@ -152,7 +149,6 @@ def test_storage_account_resource_access_rules(self, resource_group, storage_acc ]) @serial_test() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2017-06-01') @ResourceGroupPreparer(location='southcentralus') def test_create_storage_account_with_assigned_identity(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -164,7 +160,6 @@ def test_create_storage_account_with_assigned_identity(self, resource_group): self.assertTrue(result['identity']['tenantId']) @serial_test() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2017-06-01') @ResourceGroupPreparer(location='southcentralus') def test_update_storage_account_with_assigned_identity(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -178,7 +173,6 @@ def test_update_storage_account_with_assigned_identity(self, resource_group): self.assertTrue(result['identity']['principalId']) self.assertTrue(result['identity']['tenantId']) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-06-01') @ResourceGroupPreparer(location='eastus2euap') def test_create_storage_account_with_public_network_access(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -195,7 +189,6 @@ def test_create_storage_account_with_public_network_access(self, resource_group) self.assertIn('publicNetworkAccess', result) self.assertTrue(result['publicNetworkAccess'] == 'Disabled') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-06-01') @ResourceGroupPreparer(location='eastus2euap') def test_update_storage_account_with_public_network_access(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -211,7 +204,6 @@ def test_update_storage_account_with_public_network_access(self, resource_group) self.assertTrue(result['publicNetworkAccess'] == 'Disabled') @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-09-01') @ResourceGroupPreparer(name_prefix='cli_test_storage_account_dns') def test_create_storage_account_with_dns_endpoint_type(self, resource_group): self.kwargs.update({ @@ -286,7 +278,6 @@ def test_create_storage_account(self, resource_group, location): JMESPathCheck('largeFileSharesState', 'Enabled') ]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(location='eastus2euap') def test_create_storage_account_with_double_encryption(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -300,7 +291,6 @@ def test_create_storage_account_with_double_encryption(self, resource_group): JMESPathCheck('encryption.requireInfrastructureEncryption', True) ]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2017-10-01') @ResourceGroupPreparer(parameter_name_for_location='location', location='southcentralus') def test_create_storage_account_v2(self, resource_group, location): self.kwargs.update({ @@ -316,42 +306,36 @@ def test_create_storage_account_v2(self, resource_group, location): JMESPathCheck('reason', 'AlreadyExists') ]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-01-01') @ResourceGroupPreparer(location='southcentralus') def test_storage_create_default_sku(self, resource_group): name = self.create_random_name(prefix='cli', length=24) create_cmd = 'az storage account create -n {} -g {}'.format(name, resource_group) self.cmd(create_cmd, checks=[JMESPathCheck('sku.name', 'Standard_RAGRS')]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2017-10-01') @ResourceGroupPreparer(location='southcentralus') def test_storage_create_default_kind(self, resource_group): name = self.create_random_name(prefix='cli', length=24) create_cmd = 'az storage account create -n {} -g {}'.format(name, resource_group) self.cmd(create_cmd, checks=[JMESPathCheck('kind', 'StorageV2')]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2018-02-01') @ResourceGroupPreparer(location='southcentralus', name_prefix='cli_storage_account_hns') def test_storage_create_with_hns(self, resource_group): name = self.create_random_name(prefix='cli', length=24) create_cmd = 'az storage account create -n {} -g {} --kind StorageV2 --hns'.format(name, resource_group) self.cmd(create_cmd, checks=[JMESPathCheck('isHnsEnabled', True)]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2018-02-01') @ResourceGroupPreparer(location='southcentralus', name_prefix='cli_storage_account_hns') def test_storage_create_with_hns_true(self, resource_group): name = self.create_random_name(prefix='cli', length=24) create_cmd = 'az storage account create -n {} -g {} --kind StorageV2 --hns true'.format(name, resource_group) self.cmd(create_cmd, checks=[JMESPathCheck('isHnsEnabled', True)]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2018-02-01') @ResourceGroupPreparer(location='southcentralus', name_prefix='cli_storage_account_hns') def test_storage_create_with_hns_false(self, resource_group): name = self.create_random_name(prefix='cli', length=24) create_cmd = 'az storage account create -n {} -g {} --kind StorageV2 --hns false'.format(name, resource_group) self.cmd(create_cmd, checks=[JMESPathCheck('isHnsEnabled', False)]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(location='eastus2euap', name_prefix='cli_storage_account_encryption') def test_storage_create_with_encryption_key_type(self, resource_group): name = self.create_random_name(prefix='cliencryption', length=24) @@ -363,7 +347,6 @@ def test_storage_create_with_encryption_key_type(self, resource_group): JMESPathCheck('encryption.services.table.keyType', 'Account'), ]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer(location='eastus', name_prefix='cli_storage_account') def test_storage_create_with_public_access(self, resource_group): name1 = self.create_random_name(prefix='cli', length=24) @@ -379,7 +362,6 @@ def test_storage_create_with_public_access(self, resource_group): checks=[JMESPathCheck('allowBlobPublicAccess', False)]) @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer(location='eastus', name_prefix='cli_storage_account') @StorageAccountPreparer(name_prefix='blob') def test_storage_update_with_public_access(self, storage_account): @@ -393,7 +375,6 @@ def test_storage_update_with_public_access(self, storage_account): checks=[JMESPathCheck('allowBlobPublicAccess', False)]) @unittest.skip('Failure due to service behavior change') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer(location='eastus', name_prefix='cli_storage_account') def test_storage_create_with_min_tls(self, resource_group): name1 = self.create_random_name(prefix='cli', length=24) @@ -416,7 +397,6 @@ def test_storage_create_with_min_tls(self, resource_group): checks=[JMESPathCheck('minimumTlsVersion', 'TLS1_3')]) @unittest.skip('Failure due to service behavior change') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer(location='eastus', name_prefix='cli_storage_account') @StorageAccountPreparer(name_prefix='tls') def test_storage_update_with_min_tls(self, storage_account, resource_group): @@ -435,7 +415,6 @@ def test_storage_update_with_min_tls(self, storage_account, resource_group): self.cmd('az storage account update -n {} -g {} --min-tls-version TLS1_0'.format( storage_account, resource_group), checks=[JMESPathCheck('minimumTlsVersion', 'TLS1_0')]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(location='eastus', name_prefix='cli_storage_account_routing') def test_storage_account_with_routing_preference(self, resource_group): # Create Storage Account with Publish MicrosoftEndpoint, choose MicrosoftRouting @@ -494,7 +473,6 @@ def test_storage_account_with_routing_preference(self, resource_group): ]) @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-01-01') @ResourceGroupPreparer(location='eastus', name_prefix='cli_storage_account') def test_storage_account_with_shared_key_access(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -513,7 +491,6 @@ def test_storage_account_with_shared_key_access(self, resource_group): self.cmd('az storage account update -n {} --allow-shared-key-access true'.format(name), checks=[JMESPathCheck('allowSharedKeyAccess', True)]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-02-01') @ResourceGroupPreparer(location='eastus', name_prefix='cli_storage_account') def test_storage_account_with_key_and_sas_policy(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -537,7 +514,6 @@ def test_storage_account_with_key_and_sas_policy(self, resource_group): checks=[JMESPathCheck('keyPolicy.keyExpirationPeriodInDays', 100000), JMESPathCheck('sasPolicy.sasExpirationPeriod', '100000.00:00:00')]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2020-08-01-preview') @ResourceGroupPreparer() def test_storage_account_with_default_share_permission(self, resource_group): self.kwargs = { @@ -556,7 +532,6 @@ def test_storage_account_with_default_share_permission(self, resource_group): 'None')]) @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-01-01') @ResourceGroupPreparer(location='westus', name_prefix='cli_storage_account') def test_storage_account_with_nfs(self, resource_group): self.kwargs = { @@ -584,7 +559,6 @@ def test_storage_account_with_nfs(self, resource_group): checks=[JMESPathCheck('enableNfsV3', True)]) @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-06-01') @ResourceGroupPreparer(location='centraluseuap', name_prefix='cli_storage_account') def test_storage_account_with_alw(self, resource_group): self.kwargs = { @@ -657,7 +631,6 @@ def test_storage_account_with_alw(self, resource_group): self.cmd('storage account update -n {name1} --allow-append') @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-08-01') @ResourceGroupPreparer(name_prefix='cli_test_storage_account_sftp') def test_storage_account_sftp(self, resource_group): self.kwargs.update({ @@ -840,7 +813,6 @@ def test_renew_account_key(self, resource_group, storage_account): assert renewed_keys[1] != original_keys[1] @record_only() # Need to configure domain service first - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_renew_account_kerb_key(self, resource_group): name = self.create_random_name(prefix='clistoragekerbkey', length=24) @@ -1323,7 +1295,6 @@ def test_management_policy(self, resource_group, storage_account): self.cmd('storage account management-policy show --account-name {sa} -g {rg}', expect_failure=True) @record_only() # Need to configure domain service first - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_update_storage_account_with_files_aadds(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1336,7 +1307,6 @@ def test_update_storage_account_with_files_aadds(self, resource_group): self.assertIn('azureFilesIdentityBasedAuthentication', result) self.assertEqual(result['azureFilesIdentityBasedAuthentication']['directoryServiceOptions'], 'AADDS') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_update_storage_account_with_files_aadds_false(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1350,7 +1320,6 @@ def test_update_storage_account_with_files_aadds_false(self, resource_group): self.assertEqual(result['azureFilesIdentityBasedAuthentication']['directoryServiceOptions'], 'None') @record_only() # Need to configure domain service first - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_update_storage_account_with_files_aadds_true(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1364,7 +1333,6 @@ def test_update_storage_account_with_files_aadds_true(self, resource_group): self.assertEqual(result['azureFilesIdentityBasedAuthentication']['directoryServiceOptions'], 'AADDS') @record_only() # Need to configure domain service first - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_create_storage_account_with_files_aadds(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1374,7 +1342,6 @@ def test_create_storage_account_with_files_aadds(self, resource_group): self.assertIn('azureFilesIdentityBasedAuthentication', result) self.assertEqual(result['azureFilesIdentityBasedAuthentication']['directoryServiceOptions'], 'AADDS') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_create_storage_account_with_files_aadds_false(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1385,7 +1352,6 @@ def test_create_storage_account_with_files_aadds_false(self, resource_group): self.assertEqual(result['azureFilesIdentityBasedAuthentication']['directoryServiceOptions'], 'None') @record_only() # Need to configure domain service first - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_create_storage_account_with_files_aadds_true(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1395,7 +1361,6 @@ def test_create_storage_account_with_files_aadds_true(self, resource_group): self.assertIn('azureFilesIdentityBasedAuthentication', result) self.assertEqual(result['azureFilesIdentityBasedAuthentication']['directoryServiceOptions'], 'AADDS') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_create_storage_account_with_files_adds(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1424,7 +1389,6 @@ def test_create_storage_account_with_files_adds(self, resource_group): self.assertEqual(activeDirectoryProperties['forestName'], self.kwargs['forest_name']) self.assertEqual(activeDirectoryProperties['netBiosDomainName'], self.kwargs['net_bios_domain_name']) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_create_storage_account_with_files_adds_false(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1437,7 +1401,6 @@ def test_create_storage_account_with_files_adds_false(self, resource_group): self.assertIn('azureFilesIdentityBasedAuthentication', result) self.assertEqual(result['azureFilesIdentityBasedAuthentication']['directoryServiceOptions'], 'None') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_create_storage_account_with_files_adds_true(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1466,7 +1429,6 @@ def test_create_storage_account_with_files_adds_true(self, resource_group): self.assertEqual(activeDirectoryProperties['forestName'], self.kwargs['forest_name']) self.assertEqual(activeDirectoryProperties['netBiosDomainName'], self.kwargs['net_bios_domain_name']) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_update_storage_account_with_files_adds(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1497,7 +1459,6 @@ def test_update_storage_account_with_files_adds(self, resource_group): self.assertEqual(activeDirectoryProperties['forestName'], self.kwargs['forest_name']) self.assertEqual(activeDirectoryProperties['netBiosDomainName'], self.kwargs['net_bios_domain_name']) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_update_storage_account_with_files_adds_false(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1510,7 +1471,6 @@ def test_update_storage_account_with_files_adds_false(self, resource_group): self.assertIn('azureFilesIdentityBasedAuthentication', result) self.assertEqual(result['azureFilesIdentityBasedAuthentication']['directoryServiceOptions'], 'None') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_update_storage_account_with_files_adds_true(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1541,7 +1501,6 @@ def test_update_storage_account_with_files_adds_true(self, resource_group): self.assertEqual(activeDirectoryProperties['forestName'], self.kwargs['forest_name']) self.assertEqual(activeDirectoryProperties['netBiosDomainName'], self.kwargs['net_bios_domain_name']) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-08-01') @ResourceGroupPreparer() def test_storage_account_with_files_adds_sam_account_name(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1595,7 +1554,6 @@ def test_storage_account_with_files_adds_sam_account_name(self, resource_group): self.assertEqual(activeDirectoryProperties['forestName'], self.kwargs['forest_name']) self.assertEqual(activeDirectoryProperties['netBiosDomainName'], self.kwargs['net_bios_domain_name']) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2022-05-01') @ResourceGroupPreparer() def test_create_storage_account_with_files_aadkerb(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1615,7 +1573,6 @@ def test_create_storage_account_with_files_aadkerb(self, resource_group): self.assertEqual(activeDirectoryProperties['domainGuid'], self.kwargs['domain_guid']) self.assertEqual(activeDirectoryProperties['domainName'], self.kwargs['domain_name']) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2022-05-01') @ResourceGroupPreparer() def test_create_storage_account_with_files_aadkerb_false(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1629,7 +1586,6 @@ def test_create_storage_account_with_files_aadkerb_false(self, resource_group): self.assertIn('azureFilesIdentityBasedAuthentication', result) self.assertEqual(result['azureFilesIdentityBasedAuthentication']['directoryServiceOptions'], 'None') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2022-05-01') @ResourceGroupPreparer() def test_create_storage_account_with_files_aadkerb_true(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1649,7 +1605,6 @@ def test_create_storage_account_with_files_aadkerb_true(self, resource_group): self.assertEqual(activeDirectoryProperties['domainGuid'], self.kwargs['domain_guid']) self.assertEqual(activeDirectoryProperties['domainName'], self.kwargs['domain_name']) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2022-05-01') @ResourceGroupPreparer() def test_update_storage_account_with_files_aadkerb(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1677,7 +1632,6 @@ def test_update_storage_account_with_files_aadkerb(self, resource_group): self.assertEqual(activeDirectoryProperties['domainGuid'], self.kwargs['domain_guid']) self.assertEqual(activeDirectoryProperties['domainName'], self.kwargs['domain_name']) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2022-05-01') @ResourceGroupPreparer() def test_update_storage_account_with_files_aadkerb_false(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1690,7 +1644,6 @@ def test_update_storage_account_with_files_aadkerb_false(self, resource_group): self.assertIn('azureFilesIdentityBasedAuthentication', result) self.assertEqual(result['azureFilesIdentityBasedAuthentication']['directoryServiceOptions'], 'None') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer() def test_update_storage_account_with_files_aadkerb_true(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1712,7 +1665,6 @@ def test_update_storage_account_with_files_aadkerb_true(self, resource_group): self.assertEqual(activeDirectoryProperties['domainGuid'], self.kwargs['domain_guid']) self.assertEqual(activeDirectoryProperties['domainName'], self.kwargs['domain_name']) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-08-01') @ResourceGroupPreparer() def test_storage_account_with_files_adds_sam_account_name(self, resource_group): name = self.create_random_name(prefix='cli', length=24) @@ -1766,7 +1718,6 @@ def test_storage_account_with_files_adds_sam_account_name(self, resource_group): self.assertEqual(activeDirectoryProperties['forestName'], self.kwargs['forest_name']) self.assertEqual(activeDirectoryProperties['netBiosDomainName'], self.kwargs['net_bios_domain_name']) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2020-08-01-preview') @ResourceGroupPreparer(location='westus', name_prefix='cliedgezone') def test_storage_account_extended_location(self, resource_group): self.kwargs = { @@ -1862,7 +1813,6 @@ def run_under_service_principal(self): return account_info['user']['type'] == 'servicePrincipal' -@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') class RevokeStorageAccountTests(StorageScenarioMixin, RoleScenarioTest, LiveScenarioTest): @ResourceGroupPreparer(name_prefix='cli_storage_revoke_keys') @StorageAccountPreparer() @@ -1913,9 +1863,7 @@ def test_storage_account_revoke_delegation_keys(self, resource_group, storage_ac self.cmd('storage blob show -c {container} -n {blob} --account-name {account} --sas-token {blob_sas}', expect_failure=True) -@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') class BlobServicePropertiesTests(StorageScenarioMixin, ScenarioTest): - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(name_prefix='cli_storage_account_update_change_feed') @StorageAccountPreparer(kind='StorageV2', name_prefix='clitest', location="eastus2euap") def test_storage_account_update_change_feed(self, resource_group, storage_account): @@ -2000,7 +1948,6 @@ def test_storage_account_update_delete_retention_policy(self, resource_group, st self.assertEqual(result['deleteRetentionPolicy']['enabled'], False) self.assertEqual(result['deleteRetentionPolicy']['days'], None) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(name_prefix="cli_test_sa_versioning") @StorageAccountPreparer(location="eastus2euap", kind="StorageV2") def test_storage_account_update_versioning(self): @@ -2016,7 +1963,6 @@ def test_storage_account_update_versioning(self): result = self.cmd('storage account blob-service-properties show -n {sa} -g {rg}').get_output_in_json() self.assertEqual(result['isVersioningEnabled'], True) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(name_prefix='cli_storage_account_update_delete_retention_policy') @StorageAccountPreparer(kind='StorageV2', name_prefix='clitest', location='eastus2euap') def test_storage_account_update_container_delete_retention_policy(self, resource_group, storage_account): @@ -2076,7 +2022,6 @@ def test_storage_account_default_service_properties(self): self.cmd('storage account blob-service-properties show -n {sa} -g {rg}', checks=[self.check('defaultServiceVersion', '2018-11-09')]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(name_prefix="cli_test_sa_versioning") @StorageAccountPreparer(location="eastus2", kind="StorageV2") def test_storage_account_update_last_access(self): @@ -2177,7 +2122,6 @@ def test_storage_account_file_delete_retention_policy(self, resource_group, stor JMESPathCheck('shareDeleteRetentionPolicy.enabled', True), JMESPathCheck('shareDeleteRetentionPolicy.days', 1)) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2020-08-01-preview') @ResourceGroupPreparer(name_prefix='cli_file_smb') @StorageAccountPreparer(parameter_name='storage_account1', name_prefix='filesmb1', kind='FileStorage', sku='Premium_LRS', location='centralus') @@ -2217,7 +2161,6 @@ def test_storage_account_file_smb_multichannel(self, resource_group, storage_acc '{cmd} update --enable-smb-multichannel true -n {sa} -g {rg}').assert_with_checks( JMESPathCheck('protocolSettings.smb.multichannel.enabled', True)) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2020-08-01-preview') @ResourceGroupPreparer(name_prefix='cli_file_smb') @StorageAccountPreparer(name_prefix='filesmb', kind='FileStorage', sku='Premium_LRS', location='centralus') def test_storage_account_file_secured_smb(self, resource_group, storage_account): @@ -2329,7 +2272,6 @@ def test_storage_account_private_endpoint(self, storage_account): class StorageAccountSkuScenarioTest(ScenarioTest): @unittest.skip('Storage account type Standard_ZRS cannot be changed to Standard_GZRS') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-04-01') @ResourceGroupPreparer(name_prefix='clistorage', location='eastus2') @StorageAccountPreparer(name_prefix='clistoragesku', location='eastus2euap', kind='StorageV2', sku='Standard_ZRS') def test_storage_account_sku(self, resource_group, storage_account): @@ -2364,7 +2306,6 @@ def test_storage_account_sku(self, resource_group, storage_account): self.cmd('az storage account delete -n {gzrs_sa} -g {rg} -y') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2024-01-01') @ResourceGroupPreparer(name_prefix='clistorage', location='eastus2euap') def test_storage_account_provisioned_v2_sku(self, resource_group): self.kwargs = { @@ -2405,7 +2346,6 @@ def test_storage_account_provisioned_v2_sku(self, resource_group): class StorageAccountFailoverScenarioTest(ScenarioTest): - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2022-09-01') @ResourceGroupPreparer(name_prefix='clistorage', location='westus2') def test_storage_account_failover(self, resource_group): self.kwargs = { @@ -2455,7 +2395,6 @@ def test_storage_account_local_context(self): class StorageAccountORScenarioTest(StorageScenarioMixin, ScenarioTest): @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(name_prefix='cli_test_storage_account_ors', location='eastus2') @StorageAccountPreparer(parameter_name='source_account', location='eastus2', kind='StorageV2') @StorageAccountPreparer(parameter_name='destination_account', location='eastus2', kind='StorageV2') @@ -2592,7 +2531,6 @@ def test_storage_account_or_policy(self, resource_group, source_account, destina .assert_with_checks(JMESPathCheck('length(@)', 0)) @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-04-01') @ResourceGroupPreparer(name_prefix='cli_test_storage_account_ors', location='eastus2') def test_storage_account_allow_cross_tenant_replication(self, resource_group): self.kwargs.update({ @@ -2616,7 +2554,6 @@ def test_storage_account_allow_cross_tenant_replication(self, resource_group): @record_only() @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-04-01') @ResourceGroupPreparer(name_prefix='cli_test_storage_account_ors', location='eastus2') @StorageAccountPreparer(parameter_name='destination_account', location='eastus2euap', kind='StorageV2') def test_storage_account_cross_tenant_or_policy(self, resource_group, destination_account): @@ -2644,7 +2581,6 @@ def test_storage_account_cross_tenant_or_policy(self, resource_group, destinatio class StorageAccountBlobInventoryScenarioTest(StorageScenarioMixin, ScenarioTest): @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-09-01') @ResourceGroupPreparer(name_prefix='cli_test_blob_inventory', location='eastus2euap') @StorageAccountPreparer(location='eastus2euap', kind='StorageV2') def test_storage_account_blob_inventory_policy(self, resource_group, storage_account): @@ -2772,7 +2708,6 @@ def test_storage_account_blob_inventory_policy(self, resource_group, storage_acc self.assertIn(field, containerDefinition["schemaFields"]) @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-09-01') @ResourceGroupPreparer(name_prefix='cli_test_blob_inventory_hns', location='eastus2euap') @StorageAccountPreparer(location='eastus2euap', kind='StorageV2', hns=True) def test_storage_account_blob_inventory_policy_hns(self, resource_group, storage_account): @@ -2814,7 +2749,6 @@ def test_storage_account_blob_inventory_policy_hns(self, resource_group, storage self.assertIn(field, containerDefinition["schemaFields"]) class StorageAccountHNSMigrationScenarioTest(StorageScenarioMixin, ScenarioTest): - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-06-01') @ResourceGroupPreparer(name_prefix='cli_test_hns_migrate', location='eastus2') @StorageAccountPreparer(location='eastus2', kind='StorageV2', key='sa1', parameter_name='storage_account1') @StorageAccountPreparer(location='eastus2', kind='StorageV2', key='sa2', parameter_name='storage_account2') diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_acl_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_acl_scenarios.py index 7f928a47f38..20460eda48a 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_acl_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_acl_scenarios.py @@ -9,7 +9,6 @@ from ..storage_test_util import StorageScenarioMixin -@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01') class StorageAccessControlListTests(StorageScenarioMixin, ScenarioTest): @ResourceGroupPreparer() @StorageAccountPreparer() diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_adls_upload_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_adls_upload_scenarios.py index ad297e8ecba..080439f1a2b 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_adls_upload_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_adls_upload_scenarios.py @@ -12,7 +12,6 @@ from ..storage_test_util import StorageScenarioMixin -@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01') class StorageADLSUploadLiveTests(LiveScenarioTest): @ResourceGroupPreparer() @StorageAccountPreparer(kind='StorageV2', hns=True) diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_live_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_live_scenarios.py index 8782865d183..f61258d6de6 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_live_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_live_scenarios.py @@ -12,7 +12,6 @@ from ..storage_test_util import StorageScenarioMixin -@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01') class StorageBlobUploadLiveTests(LiveScenarioTest): @serial_test() @ResourceGroupPreparer() diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_scenarios.py index 27334f86b80..6c3d294383c 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_scenarios.py @@ -17,7 +17,6 @@ from azure.cli.testsdk.scenario_tests import AllowLargeResponse -@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01') class StorageBlobUploadTests(StorageScenarioMixin, ScenarioTest): @ResourceGroupPreparer() @StorageAccountPreparer(parameter_name='source_account') @@ -932,7 +931,6 @@ def test_storage_blob_list_scenarios(self, resource_group, storage_account): JMESPathCheck('length(@)', 2)) -@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') class StorageBlobPITRTests(StorageScenarioMixin, ScenarioTest): @AllowLargeResponse() @ResourceGroupPreparer(name_prefix="storage_blob_restore", location="centraluseuap") diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_immutability_policy.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_immutability_policy.py index 5283ec43638..248806d925b 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_immutability_policy.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_immutability_policy.py @@ -75,7 +75,6 @@ def test_immutability_policy(self, resource_group, storage_account): @AllowLargeResponse() @ResourceGroupPreparer() @StorageAccountPreparer(kind='StorageV2', name_prefix='clitest', location='eastus2euap') - @api_version_constraint(resource_type=ResourceType.MGMT_STORAGE, min_api='2021-06-01') def test_immutability_policy_with_allow_protected_append_writes_all(self, resource_group, storage_account): container_name = 'container1' self.cmd('storage container create --account-name {} -n {}'.format(storage_account, container_name)) diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_legal_hold.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_legal_hold.py index 1d8f0817d74..8fef7c2447a 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_legal_hold.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_legal_hold.py @@ -32,7 +32,6 @@ def test_legal_hold(self, resource_group, storage_account): @AllowLargeResponse() @ResourceGroupPreparer() @StorageAccountPreparer(kind='StorageV2', name_prefix='clitest', location='eastus2euap') - @api_version_constraint(resource_type=ResourceType.MGMT_STORAGE, min_api='2021-06-01') def test_legal_hold_with_allow_protected_append_writes_all(self, resource_group, storage_account): container_name = 'container1' self.cmd('storage container create --account-name {} -n {} --metadata k1=v1 k2=v2'.format(storage_account, diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_rm_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_rm_scenarios.py index a05ad7aa71f..48a1fb36825 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_rm_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_rm_scenarios.py @@ -9,7 +9,6 @@ from azure.cli.testsdk.scenario_tests import AllowLargeResponse -@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') class StorageContainerRmScenarios(ScenarioTest): @AllowLargeResponse() @ResourceGroupPreparer(name_prefix="cli", location="eastus") diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_cors_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_cors_scenarios.py index 1498f899dfd..d517fc39584 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_cors_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_cors_scenarios.py @@ -11,7 +11,6 @@ from azure.cli.core.profiles import ResourceType -@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01') class StorageCorsTests(ScenarioTest): @ResourceGroupPreparer() @StorageAccountPreparer(parameter_name='account') diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_encryption_scope_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_encryption_scope_scenarios.py index 81c73de5130..86cdd8dc59a 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_encryption_scope_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_encryption_scope_scenarios.py @@ -13,7 +13,6 @@ class StorageAccountEncryptionTests(StorageScenarioMixin, ScenarioTest): @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(name_prefix='cli_test_storage_encryption') @StorageAccountPreparer(name_prefix='encryption', kind="StorageV2") @KeyVaultPreparer(name_prefix='envault', key='vault', additional_params='--enable-purge-protection ' @@ -135,7 +134,6 @@ def test_storage_account_encryption_scope(self, resource_group, storage_account, self.kwargs['con'], blob2, file, self.kwargs['encryption'], result['connectionString'])) @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2022-09-01') @ResourceGroupPreparer(name_prefix='cli_test_storage_encryption') @StorageAccountPreparer(name_prefix='encryption', kind="StorageV2") def test_storage_account_encryption_scope_list(self, resource_group, storage_account): diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_file_rm_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_file_rm_scenarios.py index faf0df75ed4..080aba1f822 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_file_rm_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_file_rm_scenarios.py @@ -15,7 +15,6 @@ class StorageFileShareRmScenarios(StorageScenarioMixin, ScenarioTest): @AllowLargeResponse() - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(name_prefix="cli", location="eastus") @StorageAccountPreparer(name_prefix="sharerm", location="eastus") def test_storage_file_using_rm_main_scenario(self): @@ -147,7 +146,6 @@ def test_storage_file_using_rm_main_scenario(self): result = self.cmd('storage share-rm exists --ids {share_id_2}').get_output_in_json() self.assertEqual(result['exists'], False) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2024-01-01') @ResourceGroupPreparer(name_prefix="cli", location="eastus2euap") def test_storage_file_using_rm_provisioned_v2_scenario(self, resource_group): self.kwargs = { @@ -218,7 +216,6 @@ def test_storage_file_using_rm_provisioned_v2_scenario(self, resource_group): self.cmd('az storage share-rm list --storage-account {sa} -g {rg}', checks=[self.check('length(@)', 1)]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2024-01-01') @ResourceGroupPreparer(name_prefix="cli", location="eastus2euap") def test_storage_file_using_rm_provisioned_v1_scenario(self, resource_group): self.kwargs = { @@ -264,7 +261,6 @@ def test_storage_file_using_rm_provisioned_v1_scenario(self, resource_group): self.cmd('az storage share-rm list --storage-account {sa} -g {rg}', checks=[self.check('length(@)', 1)]) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(name_prefix="cli_nfs", location="eastus2euap") @StorageAccountPreparer(name_prefix="nfs", location="eastus2", kind='FileStorage', sku='Premium_LRS') def test_storage_share_rm_with_NFS(self): @@ -300,7 +296,6 @@ def test_storage_share_rm_with_NFS(self): JMESPathCheck('length(@)', 0) }) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2020-08-01-preview') @ResourceGroupPreparer(name_prefix="cli_snapshot", location="eastus") @StorageAccountPreparer(name_prefix="snapshot", location="eastus", kind='StorageV2') def test_storage_share_rm_with_snapshot(self): @@ -352,7 +347,6 @@ def test_storage_share_rm_with_snapshot(self): JMESPathCheck('length(@)', 1) }) - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(name_prefix="cli_tier", location="eastus") @StorageAccountPreparer(name_prefix="tier", location="eastus", kind='StorageV2') def test_storage_share_rm_with_access_tier(self): @@ -411,7 +405,6 @@ def test_storage_share_rm_with_stats(self, resource_group, storage_account): self.assertEqual(result, str(512 * 1024)) # @unittest.skip('FileServiceProperties object has no attribute protocol_settings') - @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') @ResourceGroupPreparer(name_prefix="cli_sf", location="francecentral") @StorageAccountPreparer(name_prefix="clitest", location="francecentral") def test_storage_share_rm_soft_delete(self): diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py index a1f70eb5e6d..7d06803af3d 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py @@ -189,7 +189,6 @@ def test_get_not_none_validator(self): validate_arg(cmd, Namespace(arg=False)) -@api_version_constraint(resource_type=ResourceType.MGMT_STORAGE, min_api='2016-12-01') class TestEncryptionValidators(unittest.TestCase): def setUp(self): self.cli = MockCLI() diff --git a/src/azure-cli/requirements.py3.Darwin.txt b/src/azure-cli/requirements.py3.Darwin.txt index b221c2ebed4..39b2a13eea5 100644 --- a/src/azure-cli/requirements.py3.Darwin.txt +++ b/src/azure-cli/requirements.py3.Darwin.txt @@ -75,7 +75,7 @@ azure-mgmt-servicelinker==1.2.0b3 azure-mgmt-sql==4.0.0b21 azure-mgmt-signalr==2.0.0b2 azure-mgmt-sqlvirtualmachine==1.0.0b5 -azure-mgmt-storage==22.1.0 +azure-mgmt-storage==23.0.0 azure-mgmt-synapse==2.1.0b5 azure-mgmt-trafficmanager==1.0.0 azure-mgmt-web==7.3.1 diff --git a/src/azure-cli/requirements.py3.Linux.txt b/src/azure-cli/requirements.py3.Linux.txt index b0fb9f403f6..57fdc7db8a9 100644 --- a/src/azure-cli/requirements.py3.Linux.txt +++ b/src/azure-cli/requirements.py3.Linux.txt @@ -75,7 +75,7 @@ azure-mgmt-servicelinker==1.2.0b3 azure-mgmt-sql==4.0.0b21 azure-mgmt-signalr==2.0.0b2 azure-mgmt-sqlvirtualmachine==1.0.0b5 -azure-mgmt-storage==22.1.0 +azure-mgmt-storage==23.0.0 azure-mgmt-synapse==2.1.0b5 azure-mgmt-trafficmanager==1.0.0 azure-mgmt-web==7.3.1 diff --git a/src/azure-cli/requirements.py3.windows.txt b/src/azure-cli/requirements.py3.windows.txt index 94000cc5a57..dba5e301489 100644 --- a/src/azure-cli/requirements.py3.windows.txt +++ b/src/azure-cli/requirements.py3.windows.txt @@ -75,7 +75,7 @@ azure-mgmt-servicelinker==1.2.0b3 azure-mgmt-sql==4.0.0b21 azure-mgmt-signalr==2.0.0b2 azure-mgmt-sqlvirtualmachine==1.0.0b5 -azure-mgmt-storage==22.1.0 +azure-mgmt-storage==23.0.0 azure-mgmt-synapse==2.1.0b5 azure-mgmt-trafficmanager==1.0.0 azure-mgmt-web==7.3.1 diff --git a/src/azure-cli/setup.py b/src/azure-cli/setup.py index 22c3a12ba8b..d40ac5c6964 100644 --- a/src/azure-cli/setup.py +++ b/src/azure-cli/setup.py @@ -118,7 +118,7 @@ 'azure-mgmt-signalr==2.0.0b2', 'azure-mgmt-sqlvirtualmachine==1.0.0b5', 'azure-mgmt-sql==4.0.0b21', - 'azure-mgmt-storage==22.1.0', + 'azure-mgmt-storage==23.0.0', 'azure-mgmt-synapse==2.1.0b5', 'azure-mgmt-trafficmanager~=1.0.0', 'azure-mgmt-web==7.3.1',