Skip to content

Commit

Permalink
{Storage} Change api version range for storage account kind (#12265)
Browse files Browse the repository at this point in the history
* change min_api

* change test
  • Loading branch information
Juliehzl authored Feb 24, 2020
1 parent 2263f5d commit af4fca8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/azure-cli/azure/cli/command_modules/storage/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
c.argument('location', get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group)
c.argument('account_type', help='The storage account type', arg_type=get_enum_type(t_account_type))
c.argument('account_name', acct_name_type, options_list=['--name', '-n'], completer=None)
c.argument('kind', help='Indicates the type of storage account.', min_api="2017-10-01",
c.argument('kind', help='Indicates the type of storage account.', min_api="2018-02-01",
arg_type=get_enum_type(t_kind), default='StorageV2')
c.argument('kind', help='Indicates the type of storage account.', max_api="2017-06-01",
c.argument('kind', help='Indicates the type of storage account.', max_api="2017-10-01",
arg_type=get_enum_type(t_kind), default='Storage')
c.argument('https_only', arg_type=get_three_state_flag(), min_api='2019-04-01',
help='Allow https traffic only to storage service if set to true. The default value is true.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ interactions:
- -n -g
User-Agent:
- python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2
azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.0.81
azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.1.0
accept-language:
- en-US
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2018-05-01
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"southcentralus","tags":{"product":"azurecli","cause":"automation","date":"2020-02-10T03:29:59Z"},"properties":{"provisioningState":"Succeeded"}}'
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"southcentralus","tags":{"product":"azurecli","cause":"automation","date":"2020-02-19T07:21:55Z"},"properties":{"provisioningState":"Succeeded"}}'
headers:
cache-control:
- no-cache
Expand All @@ -30,7 +30,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Mon, 10 Feb 2020 03:30:05 GMT
- Wed, 19 Feb 2020 07:22:04 GMT
expires:
- '-1'
pragma:
Expand All @@ -45,7 +45,7 @@ interactions:
code: 200
message: OK
- request:
body: '{"sku": {"name": "Standard_RAGRS"}, "kind": "StorageV2", "location": "southcentralus",
body: '{"sku": {"name": "Standard_RAGRS"}, "kind": "Storage", "location": "southcentralus",
"properties": {"supportsHttpsTrafficOnly": false}}'
headers:
Accept:
Expand All @@ -57,14 +57,14 @@ interactions:
Connection:
- keep-alive
Content-Length:
- '137'
- '135'
Content-Type:
- application/json; charset=utf-8
ParameterSetName:
- -n -g
User-Agent:
- python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2
azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.0.81
azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0
accept-language:
- en-US
method: PUT
Expand All @@ -80,11 +80,11 @@ interactions:
content-type:
- text/plain; charset=utf-8
date:
- Mon, 10 Feb 2020 03:30:14 GMT
- Wed, 19 Feb 2020 07:22:10 GMT
expires:
- '-1'
location:
- https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/southcentralus/asyncoperations/989aea2c-82b0-4a66-bb6c-e0cac9a6d47e?monitor=true&api-version=2017-10-01
- https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/southcentralus/asyncoperations/1e1573f0-50db-49e0-8413-18fee0ae0dd9?monitor=true&api-version=2017-10-01
pragma:
- no-cache
server:
Expand Down Expand Up @@ -113,21 +113,21 @@ interactions:
- -n -g
User-Agent:
- python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2
azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.0.81
azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/southcentralus/asyncoperations/989aea2c-82b0-4a66-bb6c-e0cac9a6d47e?monitor=true&api-version=2017-10-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/southcentralus/asyncoperations/1e1573f0-50db-49e0-8413-18fee0ae0dd9?monitor=true&api-version=2017-10-01
response:
body:
string: '{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/cli000002","name":"cli000002","type":"Microsoft.Storage/storageAccounts","location":"southcentralus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":false,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2020-02-10T03:30:14.2829997Z"},"blob":{"enabled":true,"lastEnabledTime":"2020-02-10T03:30:14.2829997Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-02-10T03:30:14.2205465Z","primaryEndpoints":{"blob":"https://cli000002.blob.core.windows.net/","queue":"https://cli000002.queue.core.windows.net/","table":"https://cli000002.table.core.windows.net/","file":"https://cli000002.file.core.windows.net/"},"primaryLocation":"southcentralus","statusOfPrimary":"available","secondaryLocation":"northcentralus","statusOfSecondary":"available","secondaryEndpoints":{"blob":"https://cli000002-secondary.blob.core.windows.net/","queue":"https://cli000002-secondary.queue.core.windows.net/","table":"https://cli000002-secondary.table.core.windows.net/"}}}'
string: '{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/cli000002","name":"cli000002","type":"Microsoft.Storage/storageAccounts","location":"southcentralus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":false,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2020-02-19T07:22:09.8863728Z"},"blob":{"enabled":true,"lastEnabledTime":"2020-02-19T07:22:09.8863728Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-02-19T07:22:09.8394874Z","primaryEndpoints":{"blob":"https://cli000002.blob.core.windows.net/","queue":"https://cli000002.queue.core.windows.net/","table":"https://cli000002.table.core.windows.net/","file":"https://cli000002.file.core.windows.net/"},"primaryLocation":"southcentralus","statusOfPrimary":"available","secondaryLocation":"northcentralus","statusOfSecondary":"available","secondaryEndpoints":{"blob":"https://cli000002-secondary.blob.core.windows.net/","queue":"https://cli000002-secondary.queue.core.windows.net/","table":"https://cli000002-secondary.table.core.windows.net/"}}}'
headers:
cache-control:
- no-cache
content-length:
- '1529'
- '1508'
content-type:
- application/json
date:
- Mon, 10 Feb 2020 03:30:32 GMT
- Wed, 19 Feb 2020 07:22:28 GMT
expires:
- '-1'
pragma:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test_storage_create_default_sku(self, resource_group):
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')])
self.cmd(create_cmd, checks=[JMESPathCheck('kind', 'Storage')])

def test_show_usage(self):
self.cmd('storage account show-usage', checks=JMESPathCheck('name.value', 'StorageAccounts'))
Expand Down

0 comments on commit af4fca8

Please sign in to comment.