From 6d2e9fb62db01deb349906e3edf89cf339b00a0c Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Fri, 11 Jun 2021 10:52:49 +0800 Subject: [PATCH 01/18] track 2 --- .../command_modules/maps/_client_factory.py | 13 +- .../cli/command_modules/maps/commands.py | 4 +- .../azure/cli/command_modules/maps/custom.py | 199 +++++++++++++----- src/azure-cli/requirements.py3.Darwin.txt | 2 +- src/azure-cli/requirements.py3.Linux.txt | 2 +- src/azure-cli/requirements.py3.windows.txt | 2 +- src/azure-cli/setup.py | 2 +- 7 files changed, 167 insertions(+), 57 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py b/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py index 96c1a3ca3b7..9d95879fedb 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py @@ -6,9 +6,18 @@ def cf_maps(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client - from azure.mgmt.maps import MapsManagementClient - return get_mgmt_service_client(cli_ctx, MapsManagementClient) + from azure.mgmt.maps import AzureMapsManagementClient + return get_mgmt_service_client(cli_ctx, AzureMapsManagementClient) def cf_accounts(cli_ctx, *_): return cf_maps(cli_ctx).accounts + + +def cf_map(cli_ctx, *_): + return cf_maps_cl(cli_ctx).maps + + +def cf_creator(cli_ctx, *_): + return cf_maps_cl(cli_ctx).creators + diff --git a/src/azure-cli/azure/cli/command_modules/maps/commands.py b/src/azure-cli/azure/cli/command_modules/maps/commands.py index bd7dfa71fbf..fe56599abbd 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/commands.py +++ b/src/azure-cli/azure/cli/command_modules/maps/commands.py @@ -9,13 +9,13 @@ def load_command_table(self, _): mgmt_type = CliCommandType( - operations_tmpl='azure.mgmt.maps.operations#AccountsOperations.{}', + operations_tmpl='azure.mgmt.maps.operations._accounts_operations#AccountsOperations.{}', client_factory=cf_accounts) with self.command_group('maps account', mgmt_type) as g: g.show_command('show', 'get') g.custom_command('list', 'list_accounts') - g.custom_command('create', 'create_account') + g.custom_command('create', 'maps_account_create') g.command('delete', 'delete') g.generic_update_command('update', getter_name='get', diff --git a/src/azure-cli/azure/cli/command_modules/maps/custom.py b/src/azure-cli/azure/cli/command_modules/maps/custom.py index 8d05a7a6343..72528481e2b 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/custom.py +++ b/src/azure-cli/azure/cli/command_modules/maps/custom.py @@ -3,64 +3,165 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from knack.log import get_logger -from knack.prompting import prompt_y_n -from knack.util import CLIError -from azure.mgmt.maps.models import ( - MapsAccountCreateParameters, - Sku) +def maps_account_create(client, + resource_group_name, + account_name, + location, + name, + tags=None, + kind=None, + disable_local_auth=None, + linked_resources=None, + type_=None, + user_assigned_identities=None): + if kind is None: + kind = "Gen1" + if disable_local_auth is None: + disable_local_auth = False + maps_account = {} + maps_account['tags'] = tags + maps_account['location'] = location + maps_account['kind'] = "Gen1" if kind is None else kind + maps_account['properties'] = {} + maps_account['properties']['disable_local_auth'] = False if disable_local_auth is None else disable_local_auth + maps_account['properties']['linked_resources'] = linked_resources + maps_account['identity'] = {} + maps_account['identity']['type'] = type_ + maps_account['identity']['user_assigned_identities'] = user_assigned_identities + maps_account['sku'] = {} + maps_account['sku']['name'] = name + return client.create_or_update(resource_group_name=resource_group_name, + account_name=account_name, + maps_account=maps_account) -ACCOUNT_LOCATION = 'global' -logger = get_logger(__name__) +def list_accounts(client, resource_group_name=None): + # Retrieve accounts via subscription + if resource_group_name is None: + return client.list_by_subscription() + # Retrieve accounts via resource group + return client.list_by_resource_group(resource_group_name) -def create_account(client, resource_group_name, account_name, sku_name='S0', tags=None, force=None): - terms = 'By creating an Azure Maps account, you agree that you have read and agree to the ' \ - '\nLicense (https://azure.microsoft.com/support/legal/) and ' \ - '\nPrivacy Statement (https://privacy.microsoft.com/privacystatement).' \ - '\nNote - Azure Maps shares customer-provided address/location queries (“Queries”) ' \ - 'with third party TomTom for mapping functionality purposes.' \ - '\nQueries are not linked to any customer or end-user when shared with TomTom ' \ - 'and cannot be used to identify individuals.' \ - '\nMicrosoft is currently in the process of adding TomTom to the Online Services Subcontractor List. ' \ - '\nNote that the Mobility and Weather Services which include integration with ' \ - 'Moovit and AccuWeather are currently in PREVIEW ' \ - '(see https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/). ' - hint = 'Please select.' - client_denied_terms = 'You must agree to the License and Privacy Statement to create an account.' +def maps_account_show(client, + resource_group_name, + account_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name) - # Show ToS message to the user - logger.warning(terms) - # Prompt yes/no for the user, if --force parameter is not passed in. - if not force: - option = prompt_y_n(hint) - if not option: - raise CLIError(client_denied_terms) +def maps_account_update(client, + resource_group_name, + account_name, + tags=None, + kind=None, + disable_local_auth=None, + linked_resources=None, + type_=None, + user_assigned_identities=None, + name=None): + if kind is None: + kind = "Gen1" + if disable_local_auth is None: + disable_local_auth = False + maps_account_update_parameters = {} + maps_account_update_parameters['tags'] = tags + maps_account_update_parameters['kind'] = "Gen1" if kind is None else kind + maps_account_update_parameters['disable_local_auth'] = False if disable_local_auth is None else disable_local_auth + maps_account_update_parameters['linked_resources'] = linked_resources + maps_account_update_parameters['identity'] = {} + maps_account_update_parameters['identity']['type'] = type_ + maps_account_update_parameters['identity']['user_assigned_identities'] = user_assigned_identities + maps_account_update_parameters['sku'] = {} + maps_account_update_parameters['sku']['name'] = name + return client.update(resource_group_name=resource_group_name, + account_name=account_name, + maps_account_update_parameters=maps_account_update_parameters) - # Submit query - sku = Sku(name=sku_name) - maps_account_create_params = MapsAccountCreateParameters(location=ACCOUNT_LOCATION, sku=sku, tags=tags) - return client.create_or_update(resource_group_name, account_name, maps_account_create_params) +def maps_account_delete(client, + resource_group_name, + account_name): + return client.delete(resource_group_name=resource_group_name, + account_name=account_name) -def list_accounts(client, resource_group_name=None): - # Retrieve accounts via subscription - if resource_group_name is None: - return client.list_by_subscription() - # Retrieve accounts via resource group - return client.list_by_resource_group(resource_group_name) + +def maps_account_list_key(client, + resource_group_name, + account_name): + return client.list_keys(resource_group_name=resource_group_name, + account_name=account_name) + + +def maps_account_regenerate_key(client, + resource_group_name, + account_name, + key_type): + key_specification = {} + key_specification['key_type'] = key_type + return client.regenerate_keys(resource_group_name=resource_group_name, + account_name=account_name, + key_specification=key_specification) + + +def maps_map_list_operation(client): + return client.list_operations() + + +def maps_creator_list(client, + resource_group_name, + account_name): + return client.list_by_account(resource_group_name=resource_group_name, + account_name=account_name) + + +def maps_creator_show(client, + resource_group_name, + account_name, + creator_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name, + creator_name=creator_name) + + +def maps_creator_create(client, + resource_group_name, + account_name, + creator_name, + location, + storage_units, + tags=None): + creator_resource = {} + creator_resource['tags'] = tags + creator_resource['location'] = location + creator_resource['properties'] = {} + creator_resource['properties']['storage_units'] = storage_units + return client.create_or_update(resource_group_name=resource_group_name, + account_name=account_name, + creator_name=creator_name, + creator_resource=creator_resource) + + +def maps_creator_update(client, + resource_group_name, + account_name, + creator_name, + tags=None, + storage_units=None): + creator_update_parameters = {} + creator_update_parameters['tags'] = tags + creator_update_parameters['storage_units'] = storage_units + return client.update(resource_group_name=resource_group_name, + account_name=account_name, + creator_name=creator_name, + creator_update_parameters=creator_update_parameters) -def generic_update_account(instance, sku_name=None, tags=None): - # Pre-populate with old instance - maps_account_create_params = MapsAccountCreateParameters(location=ACCOUNT_LOCATION, sku=instance.sku, - tags=instance.tags) - # Update fields with new parameter values - if sku_name: - maps_account_create_params.sku.name = sku_name - if tags: - maps_account_create_params.tags = tags - return maps_account_create_params +def maps_creator_delete(client, + resource_group_name, + account_name, + creator_name): + return client.delete(resource_group_name=resource_group_name, + account_name=account_name, + creator_name=creator_name) \ No newline at end of file diff --git a/src/azure-cli/requirements.py3.Darwin.txt b/src/azure-cli/requirements.py3.Darwin.txt index 99fd3b5266e..22ff29700c3 100644 --- a/src/azure-cli/requirements.py3.Darwin.txt +++ b/src/azure-cli/requirements.py3.Darwin.txt @@ -55,7 +55,7 @@ azure-mgmt-keyvault==9.0.0 azure-mgmt-kusto==0.3.0 azure-mgmt-loganalytics==8.0.0 azure-mgmt-managementgroups==0.2.0 -azure-mgmt-maps==0.1.0 +azure-mgmt-maps==2.0.0 azure-mgmt-marketplaceordering==1.1.0 azure-mgmt-media==3.0.0 azure-mgmt-monitor==2.0.0 diff --git a/src/azure-cli/requirements.py3.Linux.txt b/src/azure-cli/requirements.py3.Linux.txt index 84df42d8405..b939ba4e7d2 100644 --- a/src/azure-cli/requirements.py3.Linux.txt +++ b/src/azure-cli/requirements.py3.Linux.txt @@ -55,7 +55,7 @@ azure-mgmt-keyvault==9.0.0 azure-mgmt-kusto==0.3.0 azure-mgmt-loganalytics==8.0.0 azure-mgmt-managementgroups==0.2.0 -azure-mgmt-maps==0.1.0 +azure-mgmt-maps==2.0.0 azure-mgmt-marketplaceordering==1.1.0 azure-mgmt-media==3.0.0 azure-mgmt-monitor==2.0.0 diff --git a/src/azure-cli/requirements.py3.windows.txt b/src/azure-cli/requirements.py3.windows.txt index d622f9b4223..96db356a32c 100644 --- a/src/azure-cli/requirements.py3.windows.txt +++ b/src/azure-cli/requirements.py3.windows.txt @@ -55,7 +55,7 @@ azure-mgmt-keyvault==9.0.0 azure-mgmt-kusto==0.3.0 azure-mgmt-loganalytics==8.0.0 azure-mgmt-managementgroups==0.2.0 -azure-mgmt-maps==0.1.0 +azure-mgmt-maps==2.0.0 azure-mgmt-marketplaceordering==1.1.0 azure-mgmt-media==3.0.0 azure-mgmt-monitor==2.0.0 diff --git a/src/azure-cli/setup.py b/src/azure-cli/setup.py index af6ce3acd49..d6ad7100768 100644 --- a/src/azure-cli/setup.py +++ b/src/azure-cli/setup.py @@ -98,7 +98,7 @@ 'azure-mgmt-loganalytics~=8.0.0', 'azure-mgmt-managedservices~=1.0', 'azure-mgmt-managementgroups~=0.1', - 'azure-mgmt-maps~=0.1.0', + 'azure-mgmt-maps~=2.0.0', 'azure-mgmt-marketplaceordering==1.1.0', 'azure-mgmt-media~=3.0', 'azure-mgmt-monitor~=2.0.0', From a714654746b311331244afa73196796a27269d46 Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Fri, 11 Jun 2021 16:29:18 +0800 Subject: [PATCH 02/18] uodate --- .../command_modules/maps/_client_factory.py | 2 +- .../cli/command_modules/maps/commands.py | 24 ++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py b/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py index 9d95879fedb..a43d682878b 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py @@ -15,7 +15,7 @@ def cf_accounts(cli_ctx, *_): def cf_map(cli_ctx, *_): - return cf_maps_cl(cli_ctx).maps + return cf_maps(cli_ctx).maps def cf_creator(cli_ctx, *_): diff --git a/src/azure-cli/azure/cli/command_modules/maps/commands.py b/src/azure-cli/azure/cli/command_modules/maps/commands.py index fe56599abbd..d20212ed758 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/commands.py +++ b/src/azure-cli/azure/cli/command_modules/maps/commands.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType -from azure.cli.command_modules.maps._client_factory import cf_accounts +from azure.cli.command_modules.maps._client_factory import cf_accounts,cf_map def load_command_table(self, _): @@ -19,9 +19,27 @@ def load_command_table(self, _): g.command('delete', 'delete') g.generic_update_command('update', getter_name='get', - setter_arg_name='maps_account_create_parameters', - custom_func_name='generic_update_account') + custom_func_name='maps_account_update') + g.custom_command('list-key', 'maps_account_list_key') + g.custom_command('regenerate-key', 'maps_account_regenerate_key') with self.command_group('maps account keys', mgmt_type) as g: g.command('renew', 'regenerate_keys') g.command('list', 'list_keys') + + maps_map = CliCommandType( + operations_tmpl='azure.mgmt.maps.operations._maps_operations#MapsOperations.{}', + client_factory=cf_map) + + with self.command_group('maps map', maps_map, client_factory=cf_map) as g: + g.custom_command('list-operation', 'maps_map_list_operation') + + maps_creator = CliCommandType( + operations_tmpl='azext_maps.vendored_sdks.maps.operations._creators_operations#CreatorsOperations.{}', + client_factory=cf_creator) + with self.command_group('maps creator', maps_creator, client_factory=cf_creator) as g: + g.custom_command('list', 'maps_creator_list') + g.custom_show_command('show', 'maps_creator_show') + g.custom_command('create', 'maps_creator_create') + g.custom_command('update', 'maps_creator_update') + g.custom_command('delete', 'maps_creator_delete', confirmation=True) From 8599a33452326a8c527a5e19a912d724a1d7ec3c Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Tue, 15 Jun 2021 17:43:34 +0800 Subject: [PATCH 03/18] update --- .../azure/cli/command_modules/maps/_help.py | 185 ++++++++++++++++-- .../cli/command_modules/maps/commands.py | 2 +- 2 files changed, 165 insertions(+), 22 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/_help.py b/src/azure-cli/azure/cli/command_modules/maps/_help.py index 5761d2ceae5..8be01e64b08 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_help.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_help.py @@ -18,29 +18,48 @@ """ helps['maps account create'] = """ -type: command -short-summary: Create a maps account. -parameters: - - name: --accept-tos - short-summary: Accept the Terms of Service, and do not prompt for confirmation. - long-summary: | - By creating an Azure Maps account, you agree that you have read and agree to the - License (https://azure.microsoft.com/support/legal/) and - Privacy Statement (https://privacy.microsoft.com/privacystatement). + type: command + short-summary: "Create a Maps Account. A Maps Account holds the keys which allow access to the Maps REST APIs." + parameters: + - name: --linked-resources + short-summary: "Sets the resources to be used for Managed Identities based operations for the Map account \ +resource." + long-summary: | + Usage: --linked-resources unique-name=XX id=XX -examples: - - name: Create a maps account. (autogenerated) - text: az maps account create --name MyMapsAccount --resource-group MyResourceGroup --sku S0 --subscription MySubscription - crafted: true + unique-name: Required. A provided name which uniquely identifies the linked resource. + id: Required. ARM resource id in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupNa\ +me}/providers/Microsoft.Storage/accounts/{storageName}'. + + Multiple actions can be specified by using more than one --linked-resources argument. + examples: + - name: Create Account with Managed Identities + text: |- + az maps account create --type "SystemAssigned, UserAssigned" --user-assigned-identities \ +"{\\"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIden\ +tity/userAssignedIdentities/identityName\\":{}}" --kind "Gen2" --location "eastus" --disable-local-auth false \ +--linked-resources id="/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Mic\ +rosoft.Storage/accounts/mystorageacc" unique-name="myBatchStorageAccount" --linked-resources \ +id="/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/acco\ +unts/mystorageacc" unique-name="myBlobDataSource" --name "G2" --tags test="true" --account-name "myMapsAccount" \ +--resource-group "myResourceGroup" + - name: Create Gen1 Account + text: |- + az maps account create --kind "Gen1" --location "global" --disable-local-auth false --name "S0" --tags \ +test="true" --account-name "myMapsAccount" --resource-group "myResourceGroup" + - name: Create Gen2 Account + text: |- + az maps account create --kind "Gen2" --location "global" --disable-local-auth true --name "G2" --tags \ +test="true" --account-name "myMapsAccount" --resource-group "myResourceGroup" """ helps['maps account delete'] = """ -type: command -short-summary: Delete a maps account. -examples: - - name: Delete a maps account. (autogenerated) - text: az maps account delete --name MyMapsAccount --resource-group MyResourceGroup - crafted: true + type: command + short-summary: "Delete a Maps Account." + examples: + - name: DeleteAccount + text: |- + az maps account delete --name "myMapsAccount" --resource-group "myResourceGroup" """ helps['maps account keys'] = """ @@ -81,6 +100,130 @@ """ helps['maps account update'] = """ -type: command -short-summary: Update the properties of a maps account. + type: command + short-summary: "Updates a Maps Account. Only a subset of the parameters may be updated after creation, such as \ +Sku, Tags, Properties." + parameters: + - name: --linked-resources + short-summary: "Sets the resources to be used for Managed Identities based operations for the Map account \ +resource." + long-summary: | + Usage: --linked-resources unique-name=XX id=XX + + unique-name: Required. A provided name which uniquely identifies the linked resource. + id: Required. ARM resource id in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupNa\ +me}/providers/Microsoft.Storage/accounts/{storageName}'. + + Multiple actions can be specified by using more than one --linked-resources argument. + examples: + - name: Update Account Managed Identities + text: |- + az maps account update --type "SystemAssigned, UserAssigned" --user-assigned-identities \ +"{\\"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIden\ +tity/userAssignedIdentities/identityName\\":{}}" --kind "Gen2" --linked-resources id="/subscriptions/{subscriptionId}/r\ +esourceGroups/{resourceGroupName}/providers/Microsoft.Storage/accounts/{storageName}" unique-name="myBatchStorageAccoun\ +t" --name "G2" --account-name "myMapsAccount" --resource-group "myResourceGroup" + - name: Update Account Tags + text: |- + az maps account update --tags specialTag="true" --account-name "myMapsAccount" --resource-group \ +"myResourceGroup" + - name: Update to Gen1 Account + text: |- + az maps account update --kind "Gen1" --name "S1" --account-name "myMapsAccount" --resource-group \ +"myResourceGroup" + - name: Update to Gen2 Account + text: |- + az maps account update --kind "Gen2" --name "G2" --account-name "myMapsAccount" --resource-group \ +"myResourceGroup" +""" + +helps['maps account list-key'] = """ + type: command + short-summary: "Get the keys to use with the Maps APIs. A key is used to authenticate and authorize access to the \ +Maps REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration." + examples: + - name: List Keys + text: |- + az maps account list-key --name "myMapsAccount" --resource-group "myResourceGroup" +""" + +helps['maps account regenerate-key'] = """ + type: command + short-summary: "Regenerate either the primary or secondary key for use with the Maps APIs. The old key will stop \ +working immediately." + examples: + - name: Regenerate Key + text: |- + az maps account regenerate-key --name "myMapsAccount" --key-type "primary" --resource-group \ +"myResourceGroup" +""" + +helps['maps map'] = """ + type: group + short-summary: Manage map with maps +""" + +helps['maps map list-operation'] = """ + type: command + short-summary: "List operations available for the Maps Resource Provider." + examples: + - name: Get Operations + text: |- + az maps map list-operation +""" + +helps['maps creator'] = """ + type: group + short-summary: Manage creator with maps +""" + +helps['maps creator list'] = """ + type: command + short-summary: "Get all Creator instances for an Azure Maps Account." + examples: + - name: List Creator Resources By Account + text: |- + az maps creator list --account-name "myMapsAccount" --resource-group "myResourceGroup" +""" + +helps['maps creator show'] = """ + type: command + short-summary: "Get a Maps Creator resource." + examples: + - name: Get Creator Resource + text: |- + az maps creator show --account-name "myMapsAccount" --name "myCreator" --resource-group \ +"myResourceGroup" +""" + +helps['maps creator create'] = """ + type: command + short-summary: "Create a Maps Creator resource. Creator resource will manage Azure resources required to populate \ +a custom set of mapping data. It requires an account to exist before it can be created." + examples: + - name: Create Creator Resource + text: |- + az maps creator create --location "eastus2" --storage-units 5 --tags test="true" --account-name \ +"myMapsAccount" --name "myCreator" --resource-group "myResourceGroup" +""" + +helps['maps creator update'] = """ + type: command + short-summary: "Updates the Maps Creator resource. Only a subset of the parameters may be updated after creation, \ +such as Tags." + examples: + - name: Update Creator Resource + text: |- + az maps creator update --storage-units 10 --tags specialTag="true" --account-name "myMapsAccount" \ +--name "myCreator" --resource-group "myResourceGroup" +""" + +helps['maps creator delete'] = """ + type: command + short-summary: "Delete a Maps Creator resource." + examples: + - name: Delete Creator Resource + text: |- + az maps creator delete --account-name "myMapsAccount" --name "myCreator" --resource-group \ +"myResourceGroup" """ diff --git a/src/azure-cli/azure/cli/command_modules/maps/commands.py b/src/azure-cli/azure/cli/command_modules/maps/commands.py index d20212ed758..65efeed5aca 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/commands.py +++ b/src/azure-cli/azure/cli/command_modules/maps/commands.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType -from azure.cli.command_modules.maps._client_factory import cf_accounts,cf_map +from azure.cli.command_modules.maps._client_factory import cf_accounts,cf_map,cf_creator def load_command_table(self, _): From bbf238a9dfb5bdfda4d6498cb3772b626e22d077 Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Thu, 17 Jun 2021 17:02:10 +0800 Subject: [PATCH 04/18] update --- .../azure/cli/command_modules/maps/_params.py | 48 ++++++++++++++++--- .../azure/cli/command_modules/maps/action.py | 41 ++++++++++++++++ 2 files changed, 82 insertions(+), 7 deletions(-) create mode 100644 src/azure-cli/azure/cli/command_modules/maps/action.py diff --git a/src/azure-cli/azure/cli/command_modules/maps/_params.py b/src/azure-cli/azure/cli/command_modules/maps/_params.py index 36e4702a2b7..f0e0b4859f9 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_params.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_params.py @@ -9,9 +9,16 @@ get_enum_type, get_resource_name_completion_list, resource_group_name_type, - tags_type) + tags_type, + get_location_type, + get_three_state_flag) +from azure.cli.core.commands.validators import ( + get_default_location_from_resource_group, + validate_file_or_dict +) from azure.mgmt.maps.models import KeyType +from azure.cli.command_modules.maps.action import AddLinkedResources def load_arguments(self, _): @@ -29,19 +36,41 @@ def load_arguments(self, _): c.argument('account_name', id_part='name', arg_type=maps_name_type) - with self.argument_context('maps account') as c: c.argument('sku_name', options_list=['--sku', '-s'], help='The name of the SKU.', - arg_type=get_enum_type(['S0', 'S1'])) + arg_type=get_enum_type(['S0', 'S1', 'G2'])) c.argument('tags', arg_type=tags_type) - with self.argument_context('maps account create') as c: - c.argument('force', - options_list=['--accept-tos'], - action='store_true') + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' + 'Maps Account.',id_part='name') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('kind', options_list=['--kind'], arg_type=get_enum_type(['Gen1', 'Gen2']), + help='Get or Set Kind property.') + c.argument('disable_local_auth', options_list=['--disable_local_auth'], arg_type=get_three_state_flag(), + help='Allows toggle functionality on Azure ' + 'Policy to disable Azure Maps local authentication support. This will disable Shared Keys ' + 'authentication from any usage.') + c.argument('linked_resources', options_list=['--linked-resources'], action=AddLinkedResources, nargs='+', + help='Sets the resources to be used for ' + 'Managed Identities based operations for the Map account resource.') + c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', + 'SystemAssigned, UserAssigned', 'None']), + help='The identity type.', arg_group='Identity') + c.argument('user_assigned_identities', options_list=['--user-assigned-identites'], type=validate_file_or_dict, + help='The list of user identities associated with the resource. ' + 'The user identity dictionary key references will be ARM resource ids ' + 'in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microso' + 'ft.ManagedIdentity/userAssignedIdentities/{identityName}\'. Expected value: ' + 'json-string/@json-file.', arg_group='Identity') + c.argument('name', options_list=['--sku', '-s'],arg_type=get_enum_type(['S0', 'S1', 'G2']), + help='The name of the SKU, in standard format ' + '(such as S0).', arg_group='Sku') + c.argument('force',options_list=['--accept-tos'],action='store_true') # Prevent --ids argument in keys with id_part=None with self.argument_context('maps account keys') as c: @@ -53,3 +82,8 @@ def load_arguments(self, _): c.argument('key_type', options_list=['--key'], arg_type=get_enum_type(KeyType)) + + with self.argument_context('maps account show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' + 'Maps Account.', id_part='name') diff --git a/src/azure-cli/azure/cli/command_modules/maps/action.py b/src/azure-cli/azure/cli/command_modules/maps/action.py new file mode 100644 index 00000000000..ba8518564a3 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/maps/action.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access + +import argparse +from collections import defaultdict +from knack.util import CLIError + + +class AddLinkedResources(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddLinkedResources, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'unique-name': + d['unique_name'] = v[0] + elif kl == 'id': + d['id'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter linked_resources. All possible keys are: ' + 'unique-name, id'.format(k)) + return d From 883c7a77d3e53677c7394a8ed644c8a586d91bfa Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Thu, 17 Jun 2021 17:52:46 +0800 Subject: [PATCH 05/18] update --- .../azure/cli/command_modules/maps/_params.py | 15 ++------ .../azure/cli/command_modules/maps/custom.py | 34 +++++++++++++++++-- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/_params.py b/src/azure-cli/azure/cli/command_modules/maps/_params.py index f0e0b4859f9..c6adabf9509 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_params.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_params.py @@ -37,18 +37,12 @@ def load_arguments(self, _): id_part='name', arg_type=maps_name_type) with self.argument_context('maps account') as c: - c.argument('sku_name', - options_list=['--sku', '-s'], - help='The name of the SKU.', - arg_type=get_enum_type(['S0', 'S1', 'G2'])) + c.argument('name', options_list=['--sku', '-s'],arg_type=get_enum_type(['S0', 'S1', 'G2']), + help='The name of the SKU, in standard format ' + '(such as S0).', arg_group='Sku') c.argument('tags', arg_type=tags_type) with self.argument_context('maps account create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' - 'Maps Account.',id_part='name') - c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - validator=get_default_location_from_resource_group) c.argument('kind', options_list=['--kind'], arg_type=get_enum_type(['Gen1', 'Gen2']), help='Get or Set Kind property.') c.argument('disable_local_auth', options_list=['--disable_local_auth'], arg_type=get_three_state_flag(), @@ -67,9 +61,6 @@ def load_arguments(self, _): 'in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microso' 'ft.ManagedIdentity/userAssignedIdentities/{identityName}\'. Expected value: ' 'json-string/@json-file.', arg_group='Identity') - c.argument('name', options_list=['--sku', '-s'],arg_type=get_enum_type(['S0', 'S1', 'G2']), - help='The name of the SKU, in standard format ' - '(such as S0).', arg_group='Sku') c.argument('force',options_list=['--accept-tos'],action='store_true') # Prevent --ids argument in keys with id_part=None diff --git a/src/azure-cli/azure/cli/command_modules/maps/custom.py b/src/azure-cli/azure/cli/command_modules/maps/custom.py index 72528481e2b..3b8610a778f 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/custom.py +++ b/src/azure-cli/azure/cli/command_modules/maps/custom.py @@ -3,6 +3,13 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +from knack.log import get_logger +from knack.prompting import prompt_y_n + +ACCOUNT_LOCATION = 'global' + +logger = get_logger(__name__) + def maps_account_create(client, resource_group_name, @@ -14,14 +21,37 @@ def maps_account_create(client, disable_local_auth=None, linked_resources=None, type_=None, - user_assigned_identities=None): + user_assigned_identities=None, + force=None): + terms = 'By creating an Azure Maps account, you agree that you have read and agree to the ' \ + '\nLicense (https://azure.microsoft.com/support/legal/) and ' \ + '\nPrivacy Statement (https://privacy.microsoft.com/privacystatement).' \ + '\nNote - Azure Maps shares customer-provided address/location queries (“Queries”) ' \ + 'with third party TomTom for mapping functionality purposes.' \ + '\nQueries are not linked to any customer or end-user when shared with TomTom ' \ + 'and cannot be used to identify individuals.' \ + '\nMicrosoft is currently in the process of adding TomTom to the Online Services Subcontractor List. ' \ + '\nNote that the Mobility and Weather Services which include integration with ' \ + 'Moovit and AccuWeather are currently in PREVIEW ' \ + '(see https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/). ' + hint = 'Please select.' + client_denied_terms = 'You must agree to the License and Privacy Statement to create an account.' + + # Show ToS message to the user + logger.warning(terms) + + # Prompt yes/no for the user, if --force parameter is not passed in. + if not force: + option = prompt_y_n(hint) + if not option: + raise CLIError(client_denied_terms) if kind is None: kind = "Gen1" if disable_local_auth is None: disable_local_auth = False maps_account = {} maps_account['tags'] = tags - maps_account['location'] = location + maps_account['location'] = ACCOUNT_LOCATION maps_account['kind'] = "Gen1" if kind is None else kind maps_account['properties'] = {} maps_account['properties']['disable_local_auth'] = False if disable_local_auth is None else disable_local_auth From 58d604175d8b34b977b2b28e95cf26402aa44e2a Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Fri, 18 Jun 2021 15:46:07 +0800 Subject: [PATCH 06/18] update --- .../azure/cli/command_modules/maps/_params.py | 24 +++++++++++++++---- .../cli/command_modules/maps/commands.py | 4 +--- .../azure/cli/command_modules/maps/custom.py | 1 - 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/_params.py b/src/azure-cli/azure/cli/command_modules/maps/_params.py index c6adabf9509..6afeb6de657 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_params.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_params.py @@ -23,7 +23,7 @@ def load_arguments(self, _): # Argument Definition - maps_name_type = CLIArgumentType(options_list=['--name', '-n'], + maps_name_type = CLIArgumentType(options_list=['--name', '--account-name', '-n'], completer=get_resource_name_completion_list('Microsoft.Maps/accounts'), help='The name of the maps account') @@ -63,6 +63,23 @@ def load_arguments(self, _): 'json-string/@json-file.', arg_group='Identity') c.argument('force',options_list=['--accept-tos'],action='store_true') + with self.argument_context('maps account update') as c: + c.argument('kind', options_list=['--kind'], arg_type=get_enum_type(['Gen1', 'Gen2']), help='Get or Set Kind property.') + c.argument('disable_local_auth', options_list=['--disable_local_auth'], arg_type=get_three_state_flag(), help='Allows toggle functionality on Azure ' + 'Policy to disable Azure Maps local authentication support. This will disable Shared Keys ' + 'authentication from any usage.') + c.argument('linked_resources', options_list=['--linked-resources'], action=AddLinkedResources, nargs='+', help='Sets the resources to be used for ' + 'Managed Identities based operations for the Map account resource.') + c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', + 'SystemAssigned, UserAssigned', 'None']), + help='The identity type.', arg_group='Identity') + c.argument('user_assigned_identities', options_list=['--user-assigned-identites'], type=validate_file_or_dict, + help='The list of user identities associated with the resource. ' + 'The user identity dictionary key references will be ARM resource ids ' + 'in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microso' + 'ft.ManagedIdentity/userAssignedIdentities/{identityName}\'. Expected value: ' + 'json-string/@json-file.', arg_group='Identity') + # Prevent --ids argument in keys with id_part=None with self.argument_context('maps account keys') as c: c.argument('account_name', @@ -74,7 +91,4 @@ def load_arguments(self, _): options_list=['--key'], arg_type=get_enum_type(KeyType)) - with self.argument_context('maps account show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' - 'Maps Account.', id_part='name') + diff --git a/src/azure-cli/azure/cli/command_modules/maps/commands.py b/src/azure-cli/azure/cli/command_modules/maps/commands.py index 65efeed5aca..6bef0c42bed 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/commands.py +++ b/src/azure-cli/azure/cli/command_modules/maps/commands.py @@ -17,9 +17,7 @@ def load_command_table(self, _): g.custom_command('list', 'list_accounts') g.custom_command('create', 'maps_account_create') g.command('delete', 'delete') - g.generic_update_command('update', - getter_name='get', - custom_func_name='maps_account_update') + g.custom_command('update', 'maps_account_update') g.custom_command('list-key', 'maps_account_list_key') g.custom_command('regenerate-key', 'maps_account_regenerate_key') diff --git a/src/azure-cli/azure/cli/command_modules/maps/custom.py b/src/azure-cli/azure/cli/command_modules/maps/custom.py index 3b8610a778f..08dbaf914d8 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/custom.py +++ b/src/azure-cli/azure/cli/command_modules/maps/custom.py @@ -14,7 +14,6 @@ def maps_account_create(client, resource_group_name, account_name, - location, name, tags=None, kind=None, From 4ca23bbf4cd99ab3bb69f94d5d7953684752e864 Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Fri, 18 Jun 2021 16:53:24 +0800 Subject: [PATCH 07/18] Compatible with old commands --- .../cli/command_modules/maps/commands.py | 8 +- .../recordings/test_create_maps_account.yaml | 596 +++++++----------- .../maps/tests/latest/test_maps_commands.py | 16 +- 3 files changed, 236 insertions(+), 384 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/commands.py b/src/azure-cli/azure/cli/command_modules/maps/commands.py index 6bef0c42bed..5116c050910 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/commands.py +++ b/src/azure-cli/azure/cli/command_modules/maps/commands.py @@ -18,12 +18,12 @@ def load_command_table(self, _): g.custom_command('create', 'maps_account_create') g.command('delete', 'delete') g.custom_command('update', 'maps_account_update') - g.custom_command('list-key', 'maps_account_list_key') - g.custom_command('regenerate-key', 'maps_account_regenerate_key') + # g.custom_command('list-key', 'maps_account_list_key') + # g.custom_command('regenerate-key', 'maps_account_regenerate_key') with self.command_group('maps account keys', mgmt_type) as g: - g.command('renew', 'regenerate_keys') - g.command('list', 'list_keys') + g.custom_command('renew', 'maps_account_regenerate_key') + g.custom_command('list', 'maps_account_list_key') maps_map = CliCommandType( operations_tmpl='azure.mgmt.maps.operations._maps_operations#MapsOperations.{}', diff --git a/src/azure-cli/azure/cli/command_modules/maps/tests/latest/recordings/test_create_maps_account.yaml b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/recordings/test_create_maps_account.yaml index 9650ac154e4..d91c60ce536 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/tests/latest/recordings/test_create_maps_account.yaml +++ b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/recordings/test_create_maps_account.yaml @@ -1,6 +1,7 @@ interactions: - request: - body: '{"location": "global", "sku": {"name": "S0"}}' + body: '{"location": "global", "sku": {"name": "S0"}, "kind": "Gen1", "properties": + {"disableLocalAuth": false}}' headers: Accept: - application/json @@ -11,35 +12,33 @@ interactions: Connection: - keep-alive Content-Length: - - '45' + - '104' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -n -g --sku --accept-tos User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2021-02-01 response: body: - string: "{\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \ - \ \"name\": \"S0\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"properties\"\ - : {\r\n \"x-ms-client-id\": \"f2bc9d5c-9aa5-4095-ad10-1afea0ca6e9b\"\r\n\ - \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\"\ - : {}\r\n}" + string: "{\r\n \"kind\": \"Gen1\",\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n + \ \"sku\": {\r\n \"name\": \"S0\",\r\n \"tier\": \"Standard\"\r\n },\r\n + \ \"properties\": {\r\n \"uniqueId\": \"864ba8f7-4cf6-42dd-86d0-416430bffd4f\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\",\r\n + \ \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\": + {}\r\n}" headers: cache-control: - no-cache content-length: - - '474' + - '558' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:11 GMT + - Fri, 18 Jun 2021 08:50:52 GMT expires: - '-1' pragma: @@ -51,12 +50,13 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 201 message: Created - request: - body: '{"location": "global", "sku": {"name": "S0"}}' + body: '{"location": "global", "sku": {"name": "S0"}, "kind": "Gen1", "properties": + {"disableLocalAuth": false}}' headers: Accept: - application/json @@ -67,35 +67,33 @@ interactions: Connection: - keep-alive Content-Length: - - '45' + - '104' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -n -g --sku --accept-tos User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2021-02-01 response: body: - string: "{\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \ - \ \"name\": \"S0\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"properties\"\ - : {\r\n \"x-ms-client-id\": \"f2bc9d5c-9aa5-4095-ad10-1afea0ca6e9b\"\r\n\ - \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\"\ - : {}\r\n}" + string: "{\r\n \"kind\": \"Gen1\",\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n + \ \"sku\": {\r\n \"name\": \"S0\",\r\n \"tier\": \"Standard\"\r\n },\r\n + \ \"properties\": {\r\n \"uniqueId\": \"864ba8f7-4cf6-42dd-86d0-416430bffd4f\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\",\r\n + \ \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\": + {}\r\n}" headers: cache-control: - no-cache content-length: - - '474' + - '558' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:15 GMT + - Fri, 18 Jun 2021 08:50:57 GMT expires: - '-1' pragma: @@ -116,7 +114,8 @@ interactions: code: 200 message: OK - request: - body: '{"location": "global", "sku": {"name": "S1"}}' + body: '{"location": "global", "sku": {"name": "S1"}, "kind": "Gen1", "properties": + {"disableLocalAuth": false}}' headers: Accept: - application/json @@ -127,35 +126,33 @@ interactions: Connection: - keep-alive Content-Length: - - '45' + - '104' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -n -g --sku --accept-tos User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/clis1-000008?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/clis1-000008?api-version=2021-02-01 response: body: - string: "{\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \ - \ \"name\": \"S1\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"properties\"\ - : {\r\n \"x-ms-client-id\": \"13c70d64-bcc3-4053-96eb-d913ad9f58a0\"\r\n\ - \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/clis1-000008\"\ - ,\r\n \"name\": \"clis1-000008\",\r\n \"location\": \"global\",\r\n \"\ - tags\": {}\r\n}" + string: "{\r\n \"kind\": \"Gen1\",\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n + \ \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\"\r\n },\r\n + \ \"properties\": {\r\n \"uniqueId\": \"d75d22d6-4e8e-46ae-9ac8-93bc3ab805a9\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/clis1-000008\",\r\n + \ \"name\": \"clis1-000008\",\r\n \"location\": \"global\",\r\n \"tags\": + {}\r\n}" headers: cache-control: - no-cache content-length: - - '474' + - '558' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:24 GMT + - Fri, 18 Jun 2021 08:51:02 GMT expires: - '-1' pragma: @@ -167,69 +164,13 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 201 message: Created - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - maps account update - Connection: - - keep-alive - Content-Type: - - application/json; charset=utf-8 - ParameterSetName: - - -n -g --sku --tags - User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2018-05-01 - response: - body: - string: "{\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \ - \ \"name\": \"S0\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"properties\"\ - : {\r\n \"x-ms-client-id\": \"f2bc9d5c-9aa5-4095-ad10-1afea0ca6e9b\"\r\n\ - \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\"\ - : {}\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '474' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Aug 2020 07:12:25 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"location": "global", "tags": {"key-000003": "val-000004"}, "sku": {"name": - "S1"}}' + body: '{"tags": {"key-000003": "val-000004"}, "kind": "Gen1", "sku": {"name": + "S1"}, "properties": {"disableLocalAuth": false}}' headers: Accept: - application/json @@ -240,35 +181,33 @@ interactions: Connection: - keep-alive Content-Length: - - '83' + - '120' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -n -g --sku --tags User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2018-05-01 + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2021-02-01 response: body: - string: "{\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \ - \ \"name\": \"S1\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"properties\"\ - : {\r\n \"x-ms-client-id\": \"f2bc9d5c-9aa5-4095-ad10-1afea0ca6e9b\"\r\n\ - \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\"\ - : {\r\n \"key-000003\": \"val-000004\"\r\n }\r\n}" + string: "{\r\n \"kind\": \"Gen1\",\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n + \ \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\"\r\n },\r\n + \ \"properties\": {\r\n \"uniqueId\": \"864ba8f7-4cf6-42dd-86d0-416430bffd4f\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\",\r\n + \ \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\": + {\r\n \"key-000003\": \"val-000004\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '510' + - '594' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:29 GMT + - Fri, 18 Jun 2021 08:51:07 GMT expires: - '-1' pragma: @@ -299,34 +238,30 @@ interactions: - maps account show Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -n -g User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2021-02-01 response: body: - string: "{\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \ - \ \"name\": \"S1\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"properties\"\ - : {\r\n \"x-ms-client-id\": \"f2bc9d5c-9aa5-4095-ad10-1afea0ca6e9b\"\r\n\ - \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\"\ - : {\r\n \"key-000003\": \"val-000004\"\r\n }\r\n}" + string: "{\r\n \"kind\": \"Gen1\",\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n + \ \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\"\r\n },\r\n + \ \"properties\": {\r\n \"uniqueId\": \"864ba8f7-4cf6-42dd-86d0-416430bffd4f\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\",\r\n + \ \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\": + {\r\n \"key-000003\": \"val-000004\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '510' + - '594' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:31 GMT + - Fri, 18 Jun 2021 08:51:08 GMT expires: - '-1' pragma: @@ -355,34 +290,30 @@ interactions: - maps account show Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - --ids User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2021-02-01 response: body: - string: "{\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \ - \ \"name\": \"S1\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"properties\"\ - : {\r\n \"x-ms-client-id\": \"f2bc9d5c-9aa5-4095-ad10-1afea0ca6e9b\"\r\n\ - \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\"\ - : {\r\n \"key-000003\": \"val-000004\"\r\n }\r\n}" + string: "{\r\n \"kind\": \"Gen1\",\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n + \ \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\"\r\n },\r\n + \ \"properties\": {\r\n \"uniqueId\": \"864ba8f7-4cf6-42dd-86d0-416430bffd4f\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\",\r\n + \ \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\": + {\r\n \"key-000003\": \"val-000004\"\r\n }\r\n}" headers: cache-control: - no-cache content-length: - - '510' + - '594' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:33 GMT + - Fri, 18 Jun 2021 08:51:09 GMT expires: - '-1' pragma: @@ -411,36 +342,31 @@ interactions: - maps account list Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -g User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts?api-version=2021-02-01 response: body: - string: "{\r\n \"value\": [\r\n {\r\n \"type\": \"Microsoft.Maps/accounts\"\ - ,\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"\ - Standard\"\r\n },\r\n \"properties\": {\r\n \"x-ms-client-id\"\ - : \"f2bc9d5c-9aa5-4095-ad10-1afea0ca6e9b\"\r\n },\r\n \"id\": \"\ - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n\ - \ \"tags\": {\r\n \"key-000003\": \"val-000004\"\r\n }\r\n\ - \ }\r\n ]\r\n}" + string: "{\r\n \"value\": [\r\n {\r\n \"kind\": \"Gen1\",\r\n \"type\": + \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n + \ \"tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n + \ \"uniqueId\": \"864ba8f7-4cf6-42dd-86d0-416430bffd4f\",\r\n \"provisioningState\": + \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\",\r\n + \ \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\": + {\r\n \"key-000003\": \"val-000004\"\r\n }\r\n }\r\n ]\r\n}" headers: cache-control: - no-cache content-length: - - '599' + - '695' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:35 GMT + - Fri, 18 Jun 2021 08:51:10 GMT expires: - '-1' pragma: @@ -459,7 +385,8 @@ interactions: code: 200 message: OK - request: - body: '{"location": "global", "sku": {"name": "S0"}}' + body: '{"location": "global", "sku": {"name": "S0"}, "kind": "Gen1", "properties": + {"disableLocalAuth": false}}' headers: Accept: - application/json @@ -470,35 +397,33 @@ interactions: Connection: - keep-alive Content-Length: - - '45' + - '104' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -n -g --sku --accept-tos User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/cli-000006?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/cli-000006?api-version=2021-02-01 response: body: - string: "{\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \ - \ \"name\": \"S0\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"properties\"\ - : {\r\n \"x-ms-client-id\": \"abe77ba5-fde8-4d32-b9df-9be7f783d0ad\"\r\n\ - \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/cli-000006\"\ - ,\r\n \"name\": \"cli-000006\",\r\n \"location\": \"global\",\r\n \"tags\"\ - : {}\r\n}" + string: "{\r\n \"kind\": \"Gen1\",\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n + \ \"sku\": {\r\n \"name\": \"S0\",\r\n \"tier\": \"Standard\"\r\n },\r\n + \ \"properties\": {\r\n \"uniqueId\": \"bb99b7b4-726a-4433-bfab-8c35a5410a61\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/cli-000006\",\r\n + \ \"name\": \"cli-000006\",\r\n \"location\": \"global\",\r\n \"tags\": + {}\r\n}" headers: cache-control: - no-cache content-length: - - '474' + - '558' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:38 GMT + - Fri, 18 Jun 2021 08:51:17 GMT expires: - '-1' pragma: @@ -510,12 +435,13 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' status: code: 201 message: Created - request: - body: '{"location": "global", "sku": {"name": "S0"}}' + body: '{"location": "global", "sku": {"name": "S0"}, "kind": "Gen1", "properties": + {"disableLocalAuth": false}}' headers: Accept: - application/json @@ -526,35 +452,33 @@ interactions: Connection: - keep-alive Content-Length: - - '45' + - '104' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -n -g --sku --accept-tos User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000007?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000007?api-version=2021-02-01 response: body: - string: "{\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \ - \ \"name\": \"S0\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"properties\"\ - : {\r\n \"x-ms-client-id\": \"a73d2e16-580a-4d79-8e6b-5c6c7ae59d33\"\r\n\ - \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000007\"\ - ,\r\n \"name\": \"cli-000007\",\r\n \"location\": \"global\",\r\n \"tags\"\ - : {}\r\n}" + string: "{\r\n \"kind\": \"Gen1\",\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n + \ \"sku\": {\r\n \"name\": \"S0\",\r\n \"tier\": \"Standard\"\r\n },\r\n + \ \"properties\": {\r\n \"uniqueId\": \"13b4276e-6992-48e6-b0b9-96342aea23b0\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000007\",\r\n + \ \"name\": \"cli-000007\",\r\n \"location\": \"global\",\r\n \"tags\": + {}\r\n}" headers: cache-control: - no-cache content-length: - - '474' + - '558' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:42 GMT + - Fri, 18 Jun 2021 08:51:23 GMT expires: - '-1' pragma: @@ -566,7 +490,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 201 message: Created @@ -581,41 +505,38 @@ interactions: - maps account list Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -g User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts?api-version=2021-02-01 response: body: - string: "{\r\n \"value\": [\r\n {\r\n \"type\": \"Microsoft.Maps/accounts\"\ - ,\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"\ - Standard\"\r\n },\r\n \"properties\": {\r\n \"x-ms-client-id\"\ - : \"f2bc9d5c-9aa5-4095-ad10-1afea0ca6e9b\"\r\n },\r\n \"id\": \"\ - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n\ - \ \"tags\": {\r\n \"key-000003\": \"val-000004\"\r\n }\r\n\ - \ },\r\n {\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n \ - \ \"sku\": {\r\n \"name\": \"S0\",\r\n \"tier\": \"Standard\"\ - \r\n },\r\n \"properties\": {\r\n \"x-ms-client-id\": \"\ - a73d2e16-580a-4d79-8e6b-5c6c7ae59d33\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000007\"\ - ,\r\n \"name\": \"cli-000007\",\r\n \"location\": \"global\",\r\n\ - \ \"tags\": {}\r\n }\r\n ]\r\n}" + string: "{\r\n \"value\": [\r\n {\r\n \"kind\": \"Gen1\",\r\n \"type\": + \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n + \ \"tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n + \ \"uniqueId\": \"864ba8f7-4cf6-42dd-86d0-416430bffd4f\",\r\n \"provisioningState\": + \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\",\r\n + \ \"name\": \"cli-000005\",\r\n \"location\": \"global\",\r\n \"tags\": + {\r\n \"key-000003\": \"val-000004\"\r\n }\r\n },\r\n {\r\n + \ \"kind\": \"Gen1\",\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n + \ \"sku\": {\r\n \"name\": \"S0\",\r\n \"tier\": \"Standard\"\r\n + \ },\r\n \"properties\": {\r\n \"uniqueId\": \"13b4276e-6992-48e6-b0b9-96342aea23b0\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"disableLocalAuth\": + false\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000007\",\r\n + \ \"name\": \"cli-000007\",\r\n \"location\": \"global\",\r\n \"tags\": + {}\r\n }\r\n ]\r\n}" headers: cache-control: - no-cache content-length: - - '1132' + - '1324' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:43 GMT + - Fri, 18 Jun 2021 08:51:25 GMT expires: - '-1' pragma: @@ -644,41 +565,37 @@ interactions: - maps account list Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -g User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts?api-version=2021-02-01 response: body: - string: "{\r\n \"value\": [\r\n {\r\n \"type\": \"Microsoft.Maps/accounts\"\ - ,\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"\ - Standard\"\r\n },\r\n \"properties\": {\r\n \"x-ms-client-id\"\ - : \"13c70d64-bcc3-4053-96eb-d913ad9f58a0\"\r\n },\r\n \"id\": \"\ - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/clis1-000008\"\ - ,\r\n \"name\": \"clis1-000008\",\r\n \"location\": \"global\",\r\ - \n \"tags\": {}\r\n },\r\n {\r\n \"type\": \"Microsoft.Maps/accounts\"\ - ,\r\n \"sku\": {\r\n \"name\": \"S0\",\r\n \"tier\": \"\ - Standard\"\r\n },\r\n \"properties\": {\r\n \"x-ms-client-id\"\ - : \"abe77ba5-fde8-4d32-b9df-9be7f783d0ad\"\r\n },\r\n \"id\": \"\ - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/cli-000006\"\ - ,\r\n \"name\": \"cli-000006\",\r\n \"location\": \"global\",\r\n\ - \ \"tags\": {}\r\n }\r\n ]\r\n}" + string: "{\r\n \"value\": [\r\n {\r\n \"kind\": \"Gen1\",\r\n \"type\": + \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n + \ \"tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n + \ \"uniqueId\": \"d75d22d6-4e8e-46ae-9ac8-93bc3ab805a9\",\r\n \"provisioningState\": + \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/clis1-000008\",\r\n + \ \"name\": \"clis1-000008\",\r\n \"location\": \"global\",\r\n \"tags\": + {}\r\n },\r\n {\r\n \"kind\": \"Gen1\",\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n + \ \"sku\": {\r\n \"name\": \"S0\",\r\n \"tier\": \"Standard\"\r\n + \ },\r\n \"properties\": {\r\n \"uniqueId\": \"bb99b7b4-726a-4433-bfab-8c35a5410a61\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"disableLocalAuth\": + false\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/cli-000006\",\r\n + \ \"name\": \"cli-000006\",\r\n \"location\": \"global\",\r\n \"tags\": + {}\r\n }\r\n ]\r\n}" headers: cache-control: - no-cache content-length: - - '1088' + - '1280' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:44 GMT + - Fri, 18 Jun 2021 08:51:25 GMT expires: - '-1' pragma: @@ -709,33 +626,26 @@ interactions: - keep-alive Content-Length: - '0' - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -n -g User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005/listKeys?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005/listKeys?api-version=2021-02-01 response: body: - string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"MQlixfEVyO3QPC0x8EGxwIC5ezqd3hQ3yXG0x8Li2Ys\",\r\n\ - \ \"secondaryKey\": \"d83hzDHGfTCvDlANIM6bc3c3Hbz0vVVUQoON2BMWgMo\",\r\n\ - \ \"primaryKeyLastUpdated\": \"2020-08-27T07:12:10.4520366Z\",\r\n \"secondaryKeyLastUpdated\"\ - : \"2020-08-27T07:12:10.4520366Z\"\r\n}" + string: "{\r\n \"primaryKey\": \"5fGwdHtQQrCy6PsamtRlk8E3wEW3f9_cUVmRVdXG4-w\",\r\n + \ \"secondaryKey\": \"7DKg0q2oVYvzzouZbU2InTg8YwaX_juuDSmVidjVVV8\",\r\n \"primaryKeyLastUpdated\": + \"2021-06-18T08:50:51.5110656Z\",\r\n \"secondaryKeyLastUpdated\": \"2021-06-18T08:50:51.5110656Z\"\r\n}" headers: cache-control: - no-cache content-length: - - '465' + - '255' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:44 GMT + - Fri, 18 Jun 2021 08:51:27 GMT expires: - '-1' pragma: @@ -769,32 +679,27 @@ interactions: Content-Length: - '22' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -n -g --key User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005/regenerateKey?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005/regenerateKey?api-version=2021-02-01 response: body: - string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"TYpawLnU4XNyvRP3Bkwy6n9HrMUz-8rBGJQ9oNSP3d4\",\r\n\ - \ \"secondaryKey\": \"d83hzDHGfTCvDlANIM6bc3c3Hbz0vVVUQoON2BMWgMo\",\r\n\ - \ \"primaryKeyLastUpdated\": \"2020-08-27T07:12:46.931624Z\",\r\n \"secondaryKeyLastUpdated\"\ - : \"2020-08-27T07:12:10.4520366Z\"\r\n}" + string: "{\r\n \"primaryKey\": \"lZIHpt5vbGlPumeLVHy_cUl3V1sIiKoMJ2PWAS3KBj8\",\r\n + \ \"secondaryKey\": \"7DKg0q2oVYvzzouZbU2InTg8YwaX_juuDSmVidjVVV8\",\r\n \"primaryKeyLastUpdated\": + \"2021-06-18T08:51:28.5243488Z\",\r\n \"secondaryKeyLastUpdated\": \"2021-06-18T08:50:51.5110656Z\"\r\n}" headers: cache-control: - no-cache content-length: - - '464' + - '255' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:46 GMT + - Fri, 18 Jun 2021 08:51:28 GMT expires: - '-1' pragma: @@ -828,32 +733,27 @@ interactions: Content-Length: - '24' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -n -g --key User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005/regenerateKey?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005/regenerateKey?api-version=2021-02-01 response: body: - string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"TYpawLnU4XNyvRP3Bkwy6n9HrMUz-8rBGJQ9oNSP3d4\",\r\n\ - \ \"secondaryKey\": \"PAynfSL4AB6TEnkDemhBNx5AsBWc-jxS6Pv2nOYnnQ4\",\r\n\ - \ \"primaryKeyLastUpdated\": \"2020-08-27T07:12:46.931624Z\",\r\n \"secondaryKeyLastUpdated\"\ - : \"2020-08-27T07:12:48.3708189Z\"\r\n}" + string: "{\r\n \"primaryKey\": \"lZIHpt5vbGlPumeLVHy_cUl3V1sIiKoMJ2PWAS3KBj8\",\r\n + \ \"secondaryKey\": \"iHoGDak-ok-y2qQtlGTSRu0D_84CaCjURKkFo_t8TjY\",\r\n \"primaryKeyLastUpdated\": + \"2021-06-18T08:51:28.5243488Z\",\r\n \"secondaryKeyLastUpdated\": \"2021-06-18T08:51:29.3376722Z\"\r\n}" headers: cache-control: - no-cache content-length: - - '464' + - '255' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:48 GMT + - Fri, 18 Jun 2021 08:51:28 GMT expires: - '-1' pragma: @@ -869,7 +769,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -886,17 +786,12 @@ interactions: - keep-alive Content-Length: - '0' - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -n -g User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005?api-version=2021-02-01 response: body: string: '' @@ -906,7 +801,7 @@ interactions: content-length: - '0' date: - - Thu, 27 Aug 2020 07:12:56 GMT + - Fri, 18 Jun 2021 08:51:37 GMT expires: - '-1' pragma: @@ -918,7 +813,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' status: code: 200 message: OK @@ -933,35 +828,31 @@ interactions: - maps account list Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -g User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts?api-version=2021-02-01 response: body: - string: "{\r\n \"value\": [\r\n {\r\n \"type\": \"Microsoft.Maps/accounts\"\ - ,\r\n \"sku\": {\r\n \"name\": \"S0\",\r\n \"tier\": \"\ - Standard\"\r\n },\r\n \"properties\": {\r\n \"x-ms-client-id\"\ - : \"a73d2e16-580a-4d79-8e6b-5c6c7ae59d33\"\r\n },\r\n \"id\": \"\ - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000007\"\ - ,\r\n \"name\": \"cli-000007\",\r\n \"location\": \"global\",\r\n\ - \ \"tags\": {}\r\n }\r\n ]\r\n}" + string: "{\r\n \"value\": [\r\n {\r\n \"kind\": \"Gen1\",\r\n \"type\": + \"Microsoft.Maps/accounts\",\r\n \"sku\": {\r\n \"name\": \"S0\",\r\n + \ \"tier\": \"Standard\"\r\n },\r\n \"properties\": {\r\n + \ \"uniqueId\": \"13b4276e-6992-48e6-b0b9-96342aea23b0\",\r\n \"provisioningState\": + \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000007\",\r\n + \ \"name\": \"cli-000007\",\r\n \"location\": \"global\",\r\n \"tags\": + {}\r\n }\r\n ]\r\n}" headers: cache-control: - no-cache content-length: - - '555' + - '651' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:12:56 GMT + - Fri, 18 Jun 2021 08:51:37 GMT expires: - '-1' pragma: @@ -992,17 +883,12 @@ interactions: - keep-alive Content-Length: - '0' - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -n -g User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/cli-000006?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/cli-000006?api-version=2021-02-01 response: body: string: '' @@ -1012,7 +898,7 @@ interactions: content-length: - '0' date: - - Thu, 27 Aug 2020 07:13:04 GMT + - Fri, 18 Jun 2021 08:51:45 GMT expires: - '-1' pragma: @@ -1024,7 +910,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14999' status: code: 200 message: OK @@ -1041,17 +927,12 @@ interactions: - keep-alive Content-Length: - '0' - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -n -g User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000007?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000007?api-version=2021-02-01 response: body: string: '' @@ -1061,7 +942,7 @@ interactions: content-length: - '0' date: - - Thu, 27 Aug 2020 07:13:09 GMT + - Fri, 18 Jun 2021 08:51:53 GMT expires: - '-1' pragma: @@ -1073,7 +954,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14996' + - '14999' status: code: 200 message: OK @@ -1090,17 +971,12 @@ interactions: - keep-alive Content-Length: - '0' - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -n -g User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/clis1-000008?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts/clis1-000008?api-version=2021-02-01 response: body: string: '' @@ -1110,7 +986,7 @@ interactions: content-length: - '0' date: - - Thu, 27 Aug 2020 07:13:15 GMT + - Fri, 18 Jun 2021 08:51:58 GMT expires: - '-1' pragma: @@ -1137,39 +1013,30 @@ interactions: - maps account list Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -g User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts?api-version=2021-02-01 response: body: - string: "{\r\n \"value\": []\r\n}" + string: '{"value":[]}' headers: cache-control: - no-cache content-length: - - '19' + - '12' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:13:16 GMT + - Fri, 18 Jun 2021 08:51:59 GMT expires: - '-1' pragma: - no-cache - server: - - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked vary: - Accept-Encoding x-content-type-options: @@ -1188,39 +1055,30 @@ interactions: - maps account list Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -g User-Agent: - - python/3.8.0 (macOS-10.15-x86_64-i386-64bit) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.11.0 - accept-language: - - en-US + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts?api-version=2018-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.Maps/accounts?api-version=2021-02-01 response: body: - string: "{\r\n \"value\": []\r\n}" + string: '{"value":[]}' headers: cache-control: - no-cache content-length: - - '19' + - '12' content-type: - application/json; charset=utf-8 date: - - Thu, 27 Aug 2020 07:13:18 GMT + - Fri, 18 Jun 2021 08:51:59 GMT expires: - '-1' pragma: - no-cache - server: - - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked vary: - Accept-Encoding x-content-type-options: diff --git a/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py index 402cae5bb7a..ccb449163c1 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py +++ b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py @@ -6,7 +6,7 @@ import re from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from azure.mgmt.maps.models import KeyType +from azure.mgmt.maps.models import KeyType, MapsKeySpecification class MapsScenarioTests(ScenarioTest): @@ -25,8 +25,8 @@ def test_create_maps_account(self, resource_group): 'sku': 's0', 'skus1': 's1', 'tags': tag_key + '=' + tag_value, - 'key_type_primary': KeyType.primary.value, - 'key_type_secondary': KeyType.secondary.value + 'key_type_primary': 'primary', + 'key_type_secondary': 'secondary' }) # Test 'az maps account create'. @@ -121,10 +121,7 @@ def test_create_maps_account(self, resource_group): # Test 'az maps account key list'. # Test to list keys for a Maps account. - account_key_list = self.cmd('az maps account keys list -n {name} -g {rg}', checks=[ - self.check('id', account['id']), - self.check('resourceGroup', '{rg}') - ]).get_output_in_json() + account_key_list = self.cmd('az maps account keys list -n {name} -g {rg}').get_output_in_json() # Retrieve primary and secondary keys. primary_key_old = account_key_list['primaryKey'] @@ -135,10 +132,7 @@ def test_create_maps_account(self, resource_group): # Test 'az maps account key regenerate'. # Test to change primary and secondary keys for a Maps account. key_regenerated = self.cmd( - 'az maps account keys renew -n {name} -g {rg} --key {key_type_primary}', checks=[ - self.check('id', account['id']), - self.check('resourceGroup', '{rg}') - ]).get_output_in_json() + 'az maps account keys renew -n {name} -g {rg} --key {key_type_primary}').get_output_in_json() # Only primary key was regenerated. Secondary key should remain same. self.assertNotEqual(primary_key_old, key_regenerated['primaryKey']) From 48974ccfa55f30afbe51e4ae5139e496c4559b6f Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Mon, 21 Jun 2021 18:02:47 +0800 Subject: [PATCH 08/18] update --- .../command_modules/maps/_client_factory.py | 2 +- .../azure/cli/command_modules/maps/_params.py | 24 ++++++++++- .../cli/command_modules/maps/commands.py | 2 - .../maps/tests/latest/test_maps_commands.py | 1 - .../maps/tests/latest/test_maps_creator.py | 41 +++++++++++++++++++ 5 files changed, 64 insertions(+), 6 deletions(-) create mode 100644 src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_creator.py diff --git a/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py b/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py index a43d682878b..fb5dd7a9b51 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py @@ -19,5 +19,5 @@ def cf_map(cli_ctx, *_): def cf_creator(cli_ctx, *_): - return cf_maps_cl(cli_ctx).creators + return cf_maps(cli_ctx).creators diff --git a/src/azure-cli/azure/cli/command_modules/maps/_params.py b/src/azure-cli/azure/cli/command_modules/maps/_params.py index 6afeb6de657..a8fed652351 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_params.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_params.py @@ -40,8 +40,7 @@ def load_arguments(self, _): c.argument('name', options_list=['--sku', '-s'],arg_type=get_enum_type(['S0', 'S1', 'G2']), help='The name of the SKU, in standard format ' '(such as S0).', arg_group='Sku') - c.argument('tags', - arg_type=tags_type) + c.argument('tags',arg_type=tags_type) with self.argument_context('maps account create') as c: c.argument('kind', options_list=['--kind'], arg_type=get_enum_type(['Gen1', 'Gen2']), help='Get or Set Kind property.') @@ -91,4 +90,25 @@ def load_arguments(self, _): options_list=['--key'], arg_type=get_enum_type(KeyType)) + with self.argument_context('maps creator create') as c: + c.argument('creator_name', options_list=['--creator-name'], type=str, help='The name of the ' + 'Maps Creator instance.') + c.argument('location', options_list=['--location', '-l'], arg_type=get_location_type(self.cli_ctx), + required=False,validator=get_default_location_from_resource_group) + c.argument('storage_units', options_list=['--storage-units'], type=int, + help='The storage units to be allocated. Integer values from 1 to 100, inclusive.') + + with self.argument_context('maps creator update') as c: + c.argument('creator_name', options_list=['--creator-name'], type=str, help='The name of the ' + 'Maps Creator instance.', id_part='child_name_1') + c.argument('storage_units', options_list=['--storage-units'], type=int, + help='The storage units to be allocated. Integer values from 1 to 100, inclusive.') + + with self.argument_context('maps creator delete') as c: + c.argument('creator_name', options_list=['--creator-name'], type=str, help='The name of the ' + 'Maps Creator instance.', id_part='child_name_1') + + with self.argument_context('maps creator show') as c: + c.argument('creator_name', options_list=['--creator-name'], type=str, help='The name of the ' + 'Maps Creator instance.', id_part='child_name_1') diff --git a/src/azure-cli/azure/cli/command_modules/maps/commands.py b/src/azure-cli/azure/cli/command_modules/maps/commands.py index 5116c050910..ba86e9cf80c 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/commands.py +++ b/src/azure-cli/azure/cli/command_modules/maps/commands.py @@ -18,8 +18,6 @@ def load_command_table(self, _): g.custom_command('create', 'maps_account_create') g.command('delete', 'delete') g.custom_command('update', 'maps_account_update') - # g.custom_command('list-key', 'maps_account_list_key') - # g.custom_command('regenerate-key', 'maps_account_regenerate_key') with self.command_group('maps account keys', mgmt_type) as g: g.custom_command('renew', 'maps_account_regenerate_key') diff --git a/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py index ccb449163c1..1edeb869577 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py +++ b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py @@ -6,7 +6,6 @@ import re from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from azure.mgmt.maps.models import KeyType, MapsKeySpecification class MapsScenarioTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_creator.py b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_creator.py new file mode 100644 index 00000000000..11017461faf --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_creator.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer + + +class MapsTest(ScenarioTest): + + @ResourceGroupPreparer(key='rg') + def test_maps_creator(self, resource_group): + self.kwargs.update({ + 'name': self.create_random_name(prefix='cli-', length=20), + 'creator_name': self.create_random_name(prefix='cli-', length=10), + 'sku': 's0', + 'skus1': 's1', + 'storage_units': 5, + 'tags': tag_key + '=' + tag_value, + 'key_type_primary': 'primary', + 'key_type_secondary': 'secondary' + }) + self.cmd('az maps account create -n {name} -g {rg} --sku {skus1} --accept-tos') + self.cmd('az maps creator create -n {name} --creator-name {creator_name}' + ' -g {rg} --storage-units {storage_units} -l westus2', + checks=[ + self.check('name', '{creator_name}'), + self.check('resourceGroup', '{rg}'), + self.check('properties.provisioningState', 'Created'), + self.check('properties.storageUnits', 'storage_units'), + self.not_exists('tags') + ]) + self.cmd('az maps creator update -n {name} --creator-name {creator_name} -g {rg} --storage-units 10', + checks=[ + self.check('properties.provisioningState', 'Succeeded'), + self.check('properties.storageUnits', 10) + ]) + @ResourceGroupPreparer(key='rg') + def test_maps_map(self, resource_group): + self.cmd('maps maps list-operation') From c7ee3f811aed3d4917bb49ded65d82acd3f2124e Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Tue, 22 Jun 2021 13:09:30 +0800 Subject: [PATCH 09/18] creator --- .../command_modules/maps/_client_factory.py | 1 - .../azure/cli/command_modules/maps/_help.py | 8 +- .../azure/cli/command_modules/maps/_params.py | 23 +- .../cli/command_modules/maps/commands.py | 2 +- .../azure/cli/command_modules/maps/custom.py | 3 +- .../latest/recordings/test_maps_creator.yaml | 406 ++++++++++++++++++ .../latest/recordings/test_maps_map.yaml | 254 +++++++++++ .../maps/tests/latest/test_maps_creator.py | 53 ++- 8 files changed, 725 insertions(+), 25 deletions(-) create mode 100644 src/azure-cli/azure/cli/command_modules/maps/tests/latest/recordings/test_maps_creator.yaml create mode 100644 src/azure-cli/azure/cli/command_modules/maps/tests/latest/recordings/test_maps_map.yaml diff --git a/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py b/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py index fb5dd7a9b51..4a7c44d357b 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_client_factory.py @@ -20,4 +20,3 @@ def cf_map(cli_ctx, *_): def cf_creator(cli_ctx, *_): return cf_maps(cli_ctx).creators - diff --git a/src/azure-cli/azure/cli/command_modules/maps/_help.py b/src/azure-cli/azure/cli/command_modules/maps/_help.py index 8be01e64b08..097498b5e54 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_help.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_help.py @@ -192,7 +192,7 @@ examples: - name: Get Creator Resource text: |- - az maps creator show --account-name "myMapsAccount" --name "myCreator" --resource-group \ + az maps creator show --account-name "myMapsAccount" --creator-name "myCreator" --resource-group \ "myResourceGroup" """ @@ -204,7 +204,7 @@ - name: Create Creator Resource text: |- az maps creator create --location "eastus2" --storage-units 5 --tags test="true" --account-name \ -"myMapsAccount" --name "myCreator" --resource-group "myResourceGroup" +"myMapsAccount" --creator-name "myCreator" --resource-group "myResourceGroup" """ helps['maps creator update'] = """ @@ -215,7 +215,7 @@ - name: Update Creator Resource text: |- az maps creator update --storage-units 10 --tags specialTag="true" --account-name "myMapsAccount" \ ---name "myCreator" --resource-group "myResourceGroup" +--creator-name "myCreator" --resource-group "myResourceGroup" """ helps['maps creator delete'] = """ @@ -224,6 +224,6 @@ examples: - name: Delete Creator Resource text: |- - az maps creator delete --account-name "myMapsAccount" --name "myCreator" --resource-group \ + az maps creator delete --account-name "myMapsAccount" --creator-name "myCreator" --resource-group \ "myResourceGroup" """ diff --git a/src/azure-cli/azure/cli/command_modules/maps/_params.py b/src/azure-cli/azure/cli/command_modules/maps/_params.py index a8fed652351..3c189b055b0 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_params.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_params.py @@ -36,11 +36,13 @@ def load_arguments(self, _): c.argument('account_name', id_part='name', arg_type=maps_name_type) + with self.argument_context('maps account') as c: - c.argument('name', options_list=['--sku', '-s'],arg_type=get_enum_type(['S0', 'S1', 'G2']), + c.argument('name', options_list=['--sku', '-s'], arg_type=get_enum_type(['S0', 'S1', 'G2']), help='The name of the SKU, in standard format ' '(such as S0).', arg_group='Sku') - c.argument('tags',arg_type=tags_type) + c.argument('tags', arg_type=tags_type) + with self.argument_context('maps account create') as c: c.argument('kind', options_list=['--kind'], arg_type=get_enum_type(['Gen1', 'Gen2']), help='Get or Set Kind property.') @@ -60,14 +62,17 @@ def load_arguments(self, _): 'in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microso' 'ft.ManagedIdentity/userAssignedIdentities/{identityName}\'. Expected value: ' 'json-string/@json-file.', arg_group='Identity') - c.argument('force',options_list=['--accept-tos'],action='store_true') + c.argument('force', options_list=['--accept-tos'], action='store_true') with self.argument_context('maps account update') as c: - c.argument('kind', options_list=['--kind'], arg_type=get_enum_type(['Gen1', 'Gen2']), help='Get or Set Kind property.') - c.argument('disable_local_auth', options_list=['--disable_local_auth'], arg_type=get_three_state_flag(), help='Allows toggle functionality on Azure ' + c.argument('kind', options_list=['--kind'], arg_type=get_enum_type(['Gen1', 'Gen2']), + help='Get or Set Kind property.') + c.argument('disable_local_auth', options_list=['--disable_local_auth'], arg_type=get_three_state_flag(), + help='Allows toggle functionality on Azure ' 'Policy to disable Azure Maps local authentication support. This will disable Shared Keys ' 'authentication from any usage.') - c.argument('linked_resources', options_list=['--linked-resources'], action=AddLinkedResources, nargs='+', help='Sets the resources to be used for ' + c.argument('linked_resources', options_list=['--linked-resources'], action=AddLinkedResources, nargs='+', + help='Sets the resources to be used for ' 'Managed Identities based operations for the Map account resource.') c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None']), @@ -90,11 +95,14 @@ def load_arguments(self, _): options_list=['--key'], arg_type=get_enum_type(KeyType)) + with self.argument_context('maps creator') as c: + c.argument('tags', arg_type=tags_type) + with self.argument_context('maps creator create') as c: c.argument('creator_name', options_list=['--creator-name'], type=str, help='The name of the ' 'Maps Creator instance.') c.argument('location', options_list=['--location', '-l'], arg_type=get_location_type(self.cli_ctx), - required=False,validator=get_default_location_from_resource_group) + required=False, validator=get_default_location_from_resource_group) c.argument('storage_units', options_list=['--storage-units'], type=int, help='The storage units to be allocated. Integer values from 1 to 100, inclusive.') @@ -111,4 +119,3 @@ def load_arguments(self, _): with self.argument_context('maps creator show') as c: c.argument('creator_name', options_list=['--creator-name'], type=str, help='The name of the ' 'Maps Creator instance.', id_part='child_name_1') - diff --git a/src/azure-cli/azure/cli/command_modules/maps/commands.py b/src/azure-cli/azure/cli/command_modules/maps/commands.py index ba86e9cf80c..f9da3805ac3 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/commands.py +++ b/src/azure-cli/azure/cli/command_modules/maps/commands.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType -from azure.cli.command_modules.maps._client_factory import cf_accounts,cf_map,cf_creator +from azure.cli.command_modules.maps._client_factory import cf_accounts, cf_map, cf_creator def load_command_table(self, _): diff --git a/src/azure-cli/azure/cli/command_modules/maps/custom.py b/src/azure-cli/azure/cli/command_modules/maps/custom.py index 08dbaf914d8..93ea5664f86 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/custom.py +++ b/src/azure-cli/azure/cli/command_modules/maps/custom.py @@ -5,6 +5,7 @@ from knack.log import get_logger from knack.prompting import prompt_y_n +from knack.util import CLIError ACCOUNT_LOCATION = 'global' @@ -193,4 +194,4 @@ def maps_creator_delete(client, creator_name): return client.delete(resource_group_name=resource_group_name, account_name=account_name, - creator_name=creator_name) \ No newline at end of file + creator_name=creator_name) diff --git a/src/azure-cli/azure/cli/command_modules/maps/tests/latest/recordings/test_maps_creator.yaml b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/recordings/test_maps_creator.yaml new file mode 100644 index 00000000000..0960fbca8bd --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/recordings/test_maps_creator.yaml @@ -0,0 +1,406 @@ +interactions: +- request: + body: '{"location": "global", "sku": {"name": "S1"}, "kind": "Gen1", "properties": + {"disableLocalAuth": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - maps account create + Connection: + - keep-alive + Content-Length: + - '104' + Content-Type: + - application/json + ParameterSetName: + - -n -g --sku --accept-tos + User-Agent: + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004?api-version=2021-02-01 + response: + body: + string: "{\r\n \"kind\": \"Gen1\",\r\n \"type\": \"Microsoft.Maps/accounts\",\r\n + \ \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\"\r\n },\r\n + \ \"properties\": {\r\n \"uniqueId\": \"6b7b00cb-8e1b-4539-97c8-249252a59e5b\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"disableLocalAuth\": false\r\n + \ },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004\",\r\n + \ \"name\": \"cli-000004\",\r\n \"location\": \"global\",\r\n \"tags\": + {}\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '558' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Jun 2021 05:02:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: '{"location": "westus2", "properties": {"storageUnits": 5}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - maps creator create + Connection: + - keep-alive + Content-Length: + - '58' + Content-Type: + - application/json + ParameterSetName: + - -n --creator-name -g --storage-units -l + User-Agent: + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004/creators/cli-000005?api-version=2021-02-01 + response: + body: + string: '{"type":"Microsoft.Maps/accounts/creators","properties":{"provisioningState":"Created","storageUnits":5},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004/creators/cli-000005","name":"cli-000005","location":"westus2","tags":{}}' + headers: + cache-control: + - no-cache + content-length: + - '401' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Jun 2021 05:02:29 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-correlation-id: + - d23fb157-023d-44e9-8fab-e7629e27f802 + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: '{"tags": {"key-000002": "val-000003"}, "properties": {"storageUnits": 10}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - maps creator update + Connection: + - keep-alive + Content-Length: + - '74' + Content-Type: + - application/json + ParameterSetName: + - -n --creator-name -g --storage-units --tags + User-Agent: + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004/creators/cli-000005?api-version=2021-02-01 + response: + body: + string: '{"error":{"code":"500 InternalServerError","message":"Unknown error + - Unable to update consumption tracking item at this time."}}' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '129' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Jun 2021 05:02:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-correlation-id: + - 27fe8f0e-1dbe-4db1-8c6a-6dd8291e5b0c + x-ms-failure-cause: + - service + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"tags": {"key-000002": "val-000003"}, "properties": {"storageUnits": 10}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - maps creator update + Connection: + - keep-alive + Content-Length: + - '74' + Content-Type: + - application/json + ParameterSetName: + - -n --creator-name -g --storage-units --tags + User-Agent: + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004/creators/cli-000005?api-version=2021-02-01 + response: + body: + string: '{"type":"Microsoft.Maps/accounts/creators","properties":{"provisioningState":"Succeeded","storageUnits":10},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004/creators/cli-000005","name":"cli-000005","location":"westus2","tags":{"key-000002":"val-000003"}}' + headers: + cache-control: + - no-cache + content-length: + - '429' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Jun 2021 05:02:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-correlation-id: + - 2e7e81a8-5a1e-4ba0-87c7-a9588564a61b + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - maps creator show + Connection: + - keep-alive + ParameterSetName: + - -n -g --creator-name + User-Agent: + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004/creators/cli-000005?api-version=2021-02-01 + response: + body: + string: '{"type":"Microsoft.Maps/accounts/creators","properties":{"provisioningState":"Succeeded","storageUnits":10},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004/creators/cli-000005","name":"cli-000005","location":"westus2","tags":{"key-000002":"val-000003"}}' + headers: + cache-control: + - no-cache + content-length: + - '429' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Jun 2021 05:02:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-correlation-id: + - 5a267714-9936-449f-9b15-b358c5ab6846 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - maps creator list + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004/creators?api-version=2021-02-01 + response: + body: + string: '{"value":[{"type":"Microsoft.Maps/accounts/creators","properties":{"provisioningState":"Succeeded","storageUnits":10},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004/creators/cli-000005","name":"cli-000005","location":"westus2","tags":{"key-000002":"val-000003"}}],"nextLink":null}' + headers: + cache-control: + - no-cache + content-length: + - '457' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Jun 2021 05:02:39 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-correlation-id: + - 194f3e49-974e-4921-92a0-b580c6439694 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - maps creator delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n --creator-name -g -y + User-Agent: + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004/creators/cli-000005?api-version=2021-02-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 22 Jun 2021 05:02:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-correlation-id: + - b610e8c0-d47d-4a68-bcd2-234909342672 + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - maps creator list + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000004/creators?api-version=2021-02-01 + response: + body: + string: '{"value":[],"nextLink":null}' + headers: + cache-control: + - no-cache + content-length: + - '28' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Jun 2021 05:03:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-correlation-id: + - 650ce908-89c8-467f-8ef7-c66bed0a1666 + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/maps/tests/latest/recordings/test_maps_map.yaml b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/recordings/test_maps_map.yaml new file mode 100644 index 00000000000..b2ffb16b19d --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/recordings/test_maps_map.yaml @@ -0,0 +1,254 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - maps map list-operation + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.24.0 azsdk-python-mgmt-maps/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Maps/operations?api-version=2021-02-01 + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"Microsoft.Maps/resourceTypes/read\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"resourceTypes\",\r\n \"operation\": \"Read the provider resourceTypes\",\r\n + \ \"description\": \"Read the provider resourceTypes\"\r\n }\r\n + \ },\r\n {\r\n \"name\": \"Microsoft.Maps/unregister/action\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"unregister\",\r\n \"operation\": \"Unregister provider\",\r\n \"description\": + \"Unregister the Maps provider\"\r\n }\r\n },\r\n {\r\n \"name\": + \"Microsoft.Maps/operations/read\",\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"operations\",\r\n \"operation\": + \"Read the provider operations\",\r\n \"description\": \"Read the provider + operations\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/register/action\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"Maps Account\",\r\n \"operation\": \"Register the provider\",\r\n + \ \"description\": \"Register the provider\"\r\n }\r\n },\r\n + \ {\r\n \"name\": \"Microsoft.Maps/accounts/write\",\r\n \"display\": + {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": \"Maps + Account\",\r\n \"operation\": \"Create or update a Maps Account.\",\r\n + \ \"description\": \"Create or update a Maps Account.\"\r\n }\r\n + \ },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/read\",\r\n \"display\": + {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": \"Maps + Account\",\r\n \"operation\": \"Get a Maps Account.\",\r\n \"description\": + \"Get a Maps Account.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/delete\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"Maps Account\",\r\n \"operation\": \"Delete a Maps Account.\",\r\n + \ \"description\": \"Delete a Maps Account.\"\r\n }\r\n },\r\n + \ {\r\n \"name\": \"Microsoft.Maps/accounts/listKeys/action\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"Maps Account\",\r\n \"operation\": \"List keys\",\r\n \"description\": + \"List Maps Account keys.\"\r\n }\r\n },\r\n {\r\n \"name\": + \"Microsoft.Maps/accounts/regenerateKey/action\",\r\n \"display\": {\r\n + \ \"provider\": \"Microsoft.Maps\",\r\n \"resource\": \"Maps + Account\",\r\n \"operation\": \"Generate new primary or secondary key\",\r\n + \ \"description\": \"Generate new Maps Account primary or secondary + key.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/eventGridFilters/delete\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"Maps Account\",\r\n \"operation\": \"Delete an Event Grid filter\",\r\n + \ \"description\": \"Delete an Event Grid filter.\"\r\n }\r\n },\r\n + \ {\r\n \"name\": \"Microsoft.Maps/accounts/eventGridFilters/read\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"Maps Account\",\r\n \"operation\": \"Get an Event Grid filter\",\r\n + \ \"description\": \"Get an Event Grid filter\"\r\n }\r\n },\r\n + \ {\r\n \"name\": \"Microsoft.Maps/accounts/eventGridFilters/write\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"Maps Account\",\r\n \"operation\": \"Create or update an Event Grid + filter\",\r\n \"description\": \"Create or update an Event Grid filter.\"\r\n + \ }\r\n },\r\n {\r\n \"origin\": \"system\",\r\n \"properties\": + {\r\n \"serviceSpecification\": {\r\n \"metricSpecifications\": + [\r\n {\r\n \"name\": \"Usage\",\r\n \"displayName\": + \"Usage\",\r\n \"displayDescription\": \"Count of API calls\",\r\n + \ \"internalMetricName\": \"Latency\",\r\n \"unit\": + \"Count\",\r\n \"aggregationType\": \"Count\",\r\n \"supportedAggregationTypes\": + [\r\n \"Count\"\r\n ],\r\n \"sourceMdmAccount\": + \"MicrosoftLocationBasedServicesShoebox\",\r\n \"sourceMdmNamespace\": + \"ServiceOperations\",\r\n \"fillGapWithZero\": false,\r\n \"dimensions\": + [\r\n {\r\n \"name\": \"ApiCategory\",\r\n + \ \"displayName\": \"API Category\",\r\n \"internalName\": + \"Service Category\",\r\n \"toBeExportedToShoebox\": true\r\n + \ },\r\n {\r\n \"name\": \"ApiName\",\r\n + \ \"displayName\": \"API Name\",\r\n \"internalName\": + \"OperationName\",\r\n \"toBeExportedToShoebox\": true\r\n + \ },\r\n {\r\n \"name\": \"ResultType\",\r\n + \ \"displayName\": \"Result Type\",\r\n \"internalName\": + \"OperationResult\",\r\n \"toBeExportedToShoebox\": true\r\n + \ },\r\n {\r\n \"name\": \"ResponseCode\",\r\n + \ \"displayName\": \"Response Code\",\r\n \"internalName\": + \"OperationResultCode\",\r\n \"toBeExportedToShoebox\": true\r\n + \ }\r\n ]\r\n },\r\n {\r\n + \ \"name\": \"Availability\",\r\n \"displayName\": + \"Availability\",\r\n \"displayDescription\": \"Availability + of the APIs\",\r\n \"internalMetricName\": \"Availability\",\r\n + \ \"unit\": \"Percent\",\r\n \"aggregationType\": + \"Average\",\r\n \"supportedAggregationTypes\": [\r\n \"Average\"\r\n + \ ],\r\n \"sourceMdmAccount\": \"MicrosoftLocationBasedServicesShoebox\",\r\n + \ \"sourceMdmNamespace\": \"ServiceOperations\",\r\n \"fillGapWithZero\": + false,\r\n \"dimensions\": [\r\n {\r\n \"name\": + \"ApiCategory\",\r\n \"displayName\": \"API Category\",\r\n + \ \"internalName\": \"Service Category\",\r\n \"toBeExportedToShoebox\": + true\r\n },\r\n {\r\n \"name\": + \"ApiName\",\r\n \"displayName\": \"API Name\",\r\n \"internalName\": + \"OperationName\",\r\n \"toBeExportedToShoebox\": true\r\n + \ }\r\n ]\r\n },\r\n {\r\n + \ \"name\": \"CreatorUsage\",\r\n \"displayName\": + \"Creator Usage\",\r\n \"displayDescription\": \"Azure Maps Creator + usage statistics\",\r\n \"internalMetricName\": \"BytesConsumed\",\r\n + \ \"unit\": \"Bytes\",\r\n \"aggregationType\": \"Average\",\r\n + \ \"lockAggregationType\": \"Total\",\r\n \"supportedAggregationTypes\": + [\r\n \"Average\"\r\n ],\r\n \"sourceMdmAccount\": + \"MicrosoftLocationBasedServicesShoebox\",\r\n \"sourceMdmNamespace\": + \"ServiceOperations\",\r\n \"fillGapWithZero\": false,\r\n \"dimensions\": + [\r\n {\r\n \"name\": \"ServiceName\",\r\n + \ \"displayName\": \"Service Name\",\r\n \"internalName\": + \"CreatorServiceName\",\r\n \"toBeExportedToShoebox\": true\r\n + \ }\r\n ]\r\n }\r\n ]\r\n }\r\n + \ },\r\n \"name\": \"Microsoft.Maps/accounts/providers/Microsoft.Insights/metricDefinitions/read\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"The metric definition of Maps Account\",\r\n \"operation\": \"Read + Maps Account metric definitions\",\r\n \"description\": \"Gets the + available metrics for Maps Accounts\"\r\n }\r\n },\r\n {\r\n \"origin\": + \"system\",\r\n \"name\": \"Microsoft.Maps/accounts/providers/Microsoft.Insights/diagnosticSettings/read\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"Maps Account\",\r\n \"operation\": \"Read diagnostic setting\",\r\n + \ \"description\": \"Gets the diagnostic setting for the resource\"\r\n + \ }\r\n },\r\n {\r\n \"origin\": \"system\",\r\n \"name\": + \"Microsoft.Maps/accounts/providers/Microsoft.Insights/diagnosticSettings/write\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"Maps Account\",\r\n \"operation\": \"Write diagnostic setting\",\r\n + \ \"description\": \"Creates or updates the diagnostic setting for the + resource\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/services/render/read\",\r\n + \ \"isDataAction\": true,\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"Render\",\r\n \"operation\": + \"Render Service Read\",\r\n \"description\": \"Allows reading of data + for Render services.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/services/geolocation/read\",\r\n + \ \"isDataAction\": true,\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"Geolocation\",\r\n \"operation\": + \"Geolocation Service Read\",\r\n \"description\": \"Allows reading + of data for Geolocation services.\"\r\n }\r\n },\r\n {\r\n \"name\": + \"Microsoft.Maps/accounts/services/mobility/read\",\r\n \"isDataAction\": + true,\r\n \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n + \ \"resource\": \"Mobility\",\r\n \"operation\": \"Mobility Service + Read\",\r\n \"description\": \"Allows reading of data for Mobility + services.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/services/route/read\",\r\n + \ \"isDataAction\": true,\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"Route\",\r\n \"operation\": + \"Route Service Read\",\r\n \"description\": \"Allows reading of data + for Route services.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/services/search/read\",\r\n + \ \"isDataAction\": true,\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"Search\",\r\n \"operation\": + \"Search Service Read\",\r\n \"description\": \"Allows reading of data + for Search services.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/services/timezone/read\",\r\n + \ \"isDataAction\": true,\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"Timezone\",\r\n \"operation\": + \"Timezone Service Read\",\r\n \"description\": \"Allows reading of + data for Timezone services.\"\r\n }\r\n },\r\n {\r\n \"name\": + \"Microsoft.Maps/accounts/services/traffic/read\",\r\n \"isDataAction\": + true,\r\n \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n + \ \"resource\": \"Traffic\",\r\n \"operation\": \"Traffic Service + Read\",\r\n \"description\": \"Allows reading of data for Traffic services.\"\r\n + \ }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/services/weather/read\",\r\n + \ \"isDataAction\": true,\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"Weather\",\r\n \"operation\": + \"Weather Service Read\",\r\n \"description\": \"Allows reading of + data for Weather services.\"\r\n }\r\n },\r\n {\r\n \"name\": + \"Microsoft.Maps/accounts/services/data/read\",\r\n \"isDataAction\": + true,\r\n \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n + \ \"resource\": \"Data\",\r\n \"operation\": \"Data Service Read\",\r\n + \ \"description\": \"Allows reading of data for data upload services + and Private Atlas.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/services/data/delete\",\r\n + \ \"isDataAction\": true,\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"Data\",\r\n \"operation\": + \"Data Service Delete\",\r\n \"description\": \"Allows deleting of + data for data upload services and Private Atlas\"\r\n }\r\n },\r\n + \ {\r\n \"name\": \"Microsoft.Maps/accounts/services/data/write\",\r\n + \ \"isDataAction\": true,\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"Data\",\r\n \"operation\": + \"Data Service Write\",\r\n \"description\": \"Allows writing or updating + of data for data upload services and Private Atlas.\"\r\n }\r\n },\r\n + \ {\r\n \"name\": \"Microsoft.Maps/accounts/services/spatial/read\",\r\n + \ \"isDataAction\": true,\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"Spatial\",\r\n \"operation\": + \"Spatial Service Read\",\r\n \"description\": \"Allows reading of + data for Spatial services.\"\r\n }\r\n },\r\n {\r\n \"name\": + \"Microsoft.Maps/accounts/services/spatial/write\",\r\n \"isDataAction\": + true,\r\n \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n + \ \"resource\": \"Spatial\",\r\n \"operation\": \"Spatial Service + Write\",\r\n \"description\": \"Allows writing of data for Spatial + services, such as event publishing.\"\r\n }\r\n },\r\n {\r\n \"name\": + \"Microsoft.Maps/accounts/services/turnbyturn/read\",\r\n \"isDataAction\": + true,\r\n \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n + \ \"resource\": \"TurnByTurn\",\r\n \"operation\": \"TurnByTurn + Service Read\",\r\n \"description\": \"Allows reading of data for TurnByTurn + services.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/services/elevation/read\",\r\n + \ \"isDataAction\": true,\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"Elevation\",\r\n \"operation\": + \"Elevation Service Read\",\r\n \"description\": \"Allows reading of + data for Elevation services.\"\r\n }\r\n },\r\n {\r\n \"name\": + \"Microsoft.Maps/accounts/services/dataordering/read\",\r\n \"isDataAction\": + true,\r\n \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n + \ \"resource\": \"DataOrdering\",\r\n \"operation\": \"DataOrdering + Service Read\",\r\n \"description\": \"Allows reading of data for DataOrdering + services.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/services/dataordering/write\",\r\n + \ \"isDataAction\": true,\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"DataOrdering\",\r\n \"operation\": + \"DataOrdering Service Write\",\r\n \"description\": \"Allows writing + of data for Data Ordering services.\"\r\n }\r\n },\r\n {\r\n \"name\": + \"Microsoft.Maps/accounts/services/analytics/read\",\r\n \"isDataAction\": + true,\r\n \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n + \ \"resource\": \"Analytics\",\r\n \"operation\": \"Analytics + Service Read\",\r\n \"description\": \"Allows reading of data for Analytics + services.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/services/analytics/delete\",\r\n + \ \"isDataAction\": true,\r\n \"display\": {\r\n \"provider\": + \"Microsoft.Maps\",\r\n \"resource\": \"Analytics\",\r\n \"operation\": + \"Analytics Service Delete\",\r\n \"description\": \"Allows deleting + of data for Analytic services.\"\r\n }\r\n },\r\n {\r\n \"name\": + \"Microsoft.Maps/accounts/services/analytics/write\",\r\n \"isDataAction\": + true,\r\n \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n + \ \"resource\": \"Analytics\",\r\n \"operation\": \"Analytics + Service Write\",\r\n \"description\": \"Allows writing of data for + Analytic services.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/creators/write\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"Creator\",\r\n \"operation\": \"Create or update a Creator.\",\r\n + \ \"description\": \"Create or update a Creator.\"\r\n }\r\n },\r\n + \ {\r\n \"name\": \"Microsoft.Maps/accounts/creators/read\",\r\n \"display\": + {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": \"Creator\",\r\n + \ \"operation\": \"Get a Creator.\",\r\n \"description\": \"Get + a Creator.\"\r\n }\r\n },\r\n {\r\n \"name\": \"Microsoft.Maps/accounts/creators/delete\",\r\n + \ \"display\": {\r\n \"provider\": \"Microsoft.Maps\",\r\n \"resource\": + \"Creator\",\r\n \"operation\": \"Delete a Creator.\",\r\n \"description\": + \"Delete a Creator.\"\r\n }\r\n }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '15682' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Jun 2021 04:43:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_creator.py b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_creator.py index 11017461faf..b617114b8e8 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_creator.py +++ b/src/azure-cli/azure/cli/command_modules/maps/tests/latest/test_maps_creator.py @@ -5,37 +5,70 @@ from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +import time -class MapsTest(ScenarioTest): +class MapsCreatorTest(ScenarioTest): @ResourceGroupPreparer(key='rg') def test_maps_creator(self, resource_group): + tag_key = self.create_random_name(prefix='key-', length=10) + tag_value = self.create_random_name(prefix='val-', length=10) + self.kwargs.update({ 'name': self.create_random_name(prefix='cli-', length=20), - 'creator_name': self.create_random_name(prefix='cli-', length=10), + 'creator_name': self.create_random_name(prefix='cli-', length=20), 'sku': 's0', 'skus1': 's1', 'storage_units': 5, 'tags': tag_key + '=' + tag_value, - 'key_type_primary': 'primary', - 'key_type_secondary': 'secondary' }) + self.cmd('az maps account create -n {name} -g {rg} --sku {skus1} --accept-tos') - self.cmd('az maps creator create -n {name} --creator-name {creator_name}' + + creator = self.cmd('az maps creator create -n {name} --creator-name {creator_name}' ' -g {rg} --storage-units {storage_units} -l westus2', checks=[ self.check('name', '{creator_name}'), self.check('resourceGroup', '{rg}'), self.check('properties.provisioningState', 'Created'), - self.check('properties.storageUnits', 'storage_units'), + self.check('properties.storageUnits', '{storage_units}'), self.not_exists('tags') - ]) - self.cmd('az maps creator update -n {name} --creator-name {creator_name} -g {rg} --storage-units 10', + ]).get_output_in_json() + + self.cmd('az maps creator update -n {name} --creator-name {creator_name} -g {rg} --storage-units 10 --tags {tags}', checks=[ self.check('properties.provisioningState', 'Succeeded'), - self.check('properties.storageUnits', 10) + self.check('properties.storageUnits', 10), + self.check('tags', {tag_key: tag_value}) ]) + + af = self.cmd('az maps creator show -n {name} -g {rg} --creator-name {creator_name}', checks=[ + self.check('id', creator['id']), + self.check('name', '{creator_name}'), + self.check('properties.provisioningState', 'Succeeded'), + self.check('properties.storageUnits', 10), + self.check('resourceGroup', '{rg}'), + self.check('tags', {tag_key: tag_value}) + ]).get_output_in_json() + + self.cmd('az maps creator list -g {rg} -n {name}', checks=[ + self.check('length(@)', 1), + self.check('type(@)', 'array'), + self.check('[0].id', creator['id']), + self.check('[0].name', '{creator_name}'), + self.check('[0].properties.provisioningState', 'Succeeded'), + self.check('[0].properties.storageUnits', 10), + self.check('[0].resourceGroup', '{rg}'), + self.check('[0].tags', {tag_key: tag_value}) + ]).get_output_in_json() + + self.cmd('az maps creator delete -n {name} --creator-name {creator_name} -g {rg} -y') + time.sleep(20) + self.cmd('az maps creator list -n {name} -g {rg}', checks=self.is_empty()) + @ResourceGroupPreparer(key='rg') def test_maps_map(self, resource_group): - self.cmd('maps maps list-operation') + self.cmd('maps map list-operation', checks=[ + self.check('length(@)!="0"', True) + ]) From 138559bb3615900726cfdd3d7c94ebe6fe44e4f1 Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Tue, 22 Jun 2021 13:47:00 +0800 Subject: [PATCH 10/18] Update _params.py --- src/azure-cli/azure/cli/command_modules/maps/_params.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/_params.py b/src/azure-cli/azure/cli/command_modules/maps/_params.py index 3c189b055b0..ad399839f3e 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_params.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_params.py @@ -46,7 +46,7 @@ def load_arguments(self, _): with self.argument_context('maps account create') as c: c.argument('kind', options_list=['--kind'], arg_type=get_enum_type(['Gen1', 'Gen2']), help='Get or Set Kind property.') - c.argument('disable_local_auth', options_list=['--disable_local_auth'], arg_type=get_three_state_flag(), + c.argument('disable_local_auth', options_list=['--disable-local-auth'], arg_type=get_three_state_flag(), help='Allows toggle functionality on Azure ' 'Policy to disable Azure Maps local authentication support. This will disable Shared Keys ' 'authentication from any usage.') @@ -67,7 +67,7 @@ def load_arguments(self, _): with self.argument_context('maps account update') as c: c.argument('kind', options_list=['--kind'], arg_type=get_enum_type(['Gen1', 'Gen2']), help='Get or Set Kind property.') - c.argument('disable_local_auth', options_list=['--disable_local_auth'], arg_type=get_three_state_flag(), + c.argument('disable_local_auth', options_list=['--disable-local-auth'], arg_type=get_three_state_flag(), help='Allows toggle functionality on Azure ' 'Policy to disable Azure Maps local authentication support. This will disable Shared Keys ' 'authentication from any usage.') From bd88011aea9cf793fd073b6e2eacf9209082573d Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Tue, 22 Jun 2021 17:11:26 +0800 Subject: [PATCH 11/18] Update _params.py --- src/azure-cli/azure/cli/command_modules/maps/_params.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/_params.py b/src/azure-cli/azure/cli/command_modules/maps/_params.py index ad399839f3e..681716935fe 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_params.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_params.py @@ -56,7 +56,7 @@ def load_arguments(self, _): c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None']), help='The identity type.', arg_group='Identity') - c.argument('user_assigned_identities', options_list=['--user-assigned-identites'], type=validate_file_or_dict, + c.argument('user_assigned_identities', options_list=['--user-identites'], type=validate_file_or_dict, help='The list of user identities associated with the resource. ' 'The user identity dictionary key references will be ARM resource ids ' 'in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microso' @@ -77,7 +77,7 @@ def load_arguments(self, _): c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None']), help='The identity type.', arg_group='Identity') - c.argument('user_assigned_identities', options_list=['--user-assigned-identites'], type=validate_file_or_dict, + c.argument('user_assigned_identities', options_list=['--user-identites'], type=validate_file_or_dict, help='The list of user identities associated with the resource. ' 'The user identity dictionary key references will be ARM resource ids ' 'in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microso' From 8526c9ffcd15b2f78f414ebddcc1389ed91b4b3a Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Tue, 22 Jun 2021 17:43:25 +0800 Subject: [PATCH 12/18] Linter --- .../azure/cli/command_modules/maps/_help.py | 12 ++++++------ .../azure/cli/command_modules/maps/_params.py | 10 ++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/_help.py b/src/azure-cli/azure/cli/command_modules/maps/_help.py index 097498b5e54..0aad9b7a1c8 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_help.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_help.py @@ -137,24 +137,24 @@ "myResourceGroup" """ -helps['maps account list-key'] = """ +helps['maps account keys list'] = """ type: command short-summary: "Get the keys to use with the Maps APIs. A key is used to authenticate and authorize access to the \ Maps REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration." examples: - - name: List Keys + - name: Keys List text: |- - az maps account list-key --name "myMapsAccount" --resource-group "myResourceGroup" + az maps account keys list --name "myMapsAccount" --resource-group "myResourceGroup" """ -helps['maps account regenerate-key'] = """ +helps['maps account keys renew'] = """ type: command short-summary: "Regenerate either the primary or secondary key for use with the Maps APIs. The old key will stop \ working immediately." examples: - - name: Regenerate Key + - name: Keys Renew text: |- - az maps account regenerate-key --name "myMapsAccount" --key-type "primary" --resource-group \ + az maps account keys renew --name "myMapsAccount" --key-type "primary" --resource-group \ "myResourceGroup" """ diff --git a/src/azure-cli/azure/cli/command_modules/maps/_params.py b/src/azure-cli/azure/cli/command_modules/maps/_params.py index 681716935fe..50289d42876 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_params.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_params.py @@ -39,8 +39,8 @@ def load_arguments(self, _): with self.argument_context('maps account') as c: c.argument('name', options_list=['--sku', '-s'], arg_type=get_enum_type(['S0', 'S1', 'G2']), - help='The name of the SKU, in standard format ' - '(such as S0).', arg_group='Sku') + help='The name of the SKU, in standard format (such as S0).', arg_group='Sku', + required=True) c.argument('tags', arg_type=tags_type) with self.argument_context('maps account create') as c: @@ -62,7 +62,8 @@ def load_arguments(self, _): 'in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microso' 'ft.ManagedIdentity/userAssignedIdentities/{identityName}\'. Expected value: ' 'json-string/@json-file.', arg_group='Identity') - c.argument('force', options_list=['--accept-tos'], action='store_true') + c.argument('force', options_list=['--accept-tos'], action='store_true', + help='You must agree to the License and Privacy Statement to create an account.') with self.argument_context('maps account update') as c: c.argument('kind', options_list=['--kind'], arg_type=get_enum_type(['Gen1', 'Gen2']), @@ -93,7 +94,8 @@ def load_arguments(self, _): with self.argument_context('maps account keys renew') as c: c.argument('key_type', options_list=['--key'], - arg_type=get_enum_type(KeyType)) + arg_type=get_enum_type(KeyType), + help='Whether the operation refers to the primary or secondary key') with self.argument_context('maps creator') as c: c.argument('tags', arg_type=tags_type) From 54f3a43f321ebd6c0fa965903316e4fb6ae419a3 Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Tue, 22 Jun 2021 17:59:55 +0800 Subject: [PATCH 13/18] Update _help.py --- .../azure/cli/command_modules/maps/_help.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/_help.py b/src/azure-cli/azure/cli/command_modules/maps/_help.py index 0aad9b7a1c8..4c9d897f792 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_help.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_help.py @@ -45,11 +45,11 @@ --resource-group "myResourceGroup" - name: Create Gen1 Account text: |- - az maps account create --kind "Gen1" --location "global" --disable-local-auth false --name "S0" --tags \ + az maps account create --kind "Gen1" --location "global" --disable-local-auth false --sku "S0" --tags \ test="true" --account-name "myMapsAccount" --resource-group "myResourceGroup" - name: Create Gen2 Account text: |- - az maps account create --kind "Gen2" --location "global" --disable-local-auth true --name "G2" --tags \ + az maps account create --kind "Gen2" --location "global" --disable-local-auth true --sku "G2" --tags \ test="true" --account-name "myMapsAccount" --resource-group "myResourceGroup" """ @@ -59,7 +59,7 @@ examples: - name: DeleteAccount text: |- - az maps account delete --name "myMapsAccount" --resource-group "myResourceGroup" + az maps account delete --account-name "myMapsAccount" --resource-group "myResourceGroup" """ helps['maps account keys'] = """ @@ -74,7 +74,7 @@ A key is used to authenticate and authorize access to the Maps REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. examples: - name: List the keys to use with the Maps APIs (autogenerated) - text: az maps account keys list --name MyMapsAccount --resource-group MyResourceGroup + text: az maps account keys list --account-name MyMapsAccount --resource-group MyResourceGroup crafted: true """ @@ -95,7 +95,7 @@ short-summary: Show the details of a maps account. examples: - name: Show the details of a maps account. (autogenerated) - text: az maps account show --name MyMapsAccount --resource-group MyResourceGroup + text: az maps account show --account-name MyMapsAccount --resource-group MyResourceGroup crafted: true """ @@ -129,11 +129,11 @@ "myResourceGroup" - name: Update to Gen1 Account text: |- - az maps account update --kind "Gen1" --name "S1" --account-name "myMapsAccount" --resource-group \ + az maps account update --kind "Gen1" --sku "S1" --account-name "myMapsAccount" --resource-group \ "myResourceGroup" - name: Update to Gen2 Account text: |- - az maps account update --kind "Gen2" --name "G2" --account-name "myMapsAccount" --resource-group \ + az maps account update --kind "Gen2" --sku "G2" --account-name "myMapsAccount" --resource-group \ "myResourceGroup" """ @@ -144,7 +144,7 @@ examples: - name: Keys List text: |- - az maps account keys list --name "myMapsAccount" --resource-group "myResourceGroup" + az maps account keys list --account-name "myMapsAccount" --resource-group "myResourceGroup" """ helps['maps account keys renew'] = """ @@ -154,7 +154,7 @@ examples: - name: Keys Renew text: |- - az maps account keys renew --name "myMapsAccount" --key-type "primary" --resource-group \ + az maps account keys renew --account-name "myMapsAccount" --key "primary" --resource-group \ "myResourceGroup" """ From 340a80ed7a0b0b8b86f5fa764cec694cb90a1d56 Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Wed, 23 Jun 2021 10:50:43 +0800 Subject: [PATCH 14/18] linter --- .../azure/cli/command_modules/maps/_help.py | 42 +++++++++---------- .../azure/cli/command_modules/maps/_params.py | 4 +- .../cli/command_modules/maps/commands.py | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/_help.py b/src/azure-cli/azure/cli/command_modules/maps/_help.py index 4c9d897f792..9c66d06ecf0 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_help.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_help.py @@ -35,22 +35,22 @@ examples: - name: Create Account with Managed Identities text: |- - az maps account create --type "SystemAssigned, UserAssigned" --user-assigned-identities \ + az maps account create --type "SystemAssigned, UserAssigned" --user-identities \ "{\\"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIden\ -tity/userAssignedIdentities/identityName\\":{}}" --kind "Gen2" --location "eastus" --disable-local-auth false \ +tity/userAssignedIdentities/identityName\\":{}}" --kind "Gen2" --disable-local-auth false \ --linked-resources id="/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Mic\ rosoft.Storage/accounts/mystorageacc" unique-name="myBatchStorageAccount" --linked-resources \ id="/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/acco\ unts/mystorageacc" unique-name="myBlobDataSource" --name "G2" --tags test="true" --account-name "myMapsAccount" \ ---resource-group "myResourceGroup" +--resource-group "myResourceGroup" --sku "S0" - name: Create Gen1 Account text: |- - az maps account create --kind "Gen1" --location "global" --disable-local-auth false --sku "S0" --tags \ -test="true" --account-name "myMapsAccount" --resource-group "myResourceGroup" + az maps account create --kind "Gen1" --disable-local-auth false --name "S0" --tags \ +test="true" --account-name "myMapsAccount" --resource-group "myResourceGroup" --sku "S0" - name: Create Gen2 Account text: |- - az maps account create --kind "Gen2" --location "global" --disable-local-auth true --sku "G2" --tags \ -test="true" --account-name "myMapsAccount" --resource-group "myResourceGroup" + az maps account create --kind "Gen2" --disable-local-auth true --name "G2" --tags \ +test="true" --account-name "myMapsAccount" --resource-group "myResourceGroup" --sku "S0" """ helps['maps account delete'] = """ @@ -59,7 +59,7 @@ examples: - name: DeleteAccount text: |- - az maps account delete --account-name "myMapsAccount" --resource-group "myResourceGroup" + az maps account delete --name "myMapsAccount" --resource-group "myResourceGroup" """ helps['maps account keys'] = """ @@ -74,7 +74,7 @@ A key is used to authenticate and authorize access to the Maps REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. examples: - name: List the keys to use with the Maps APIs (autogenerated) - text: az maps account keys list --account-name MyMapsAccount --resource-group MyResourceGroup + text: az maps account keys list --name MyMapsAccount --resource-group MyResourceGroup crafted: true """ @@ -95,7 +95,7 @@ short-summary: Show the details of a maps account. examples: - name: Show the details of a maps account. (autogenerated) - text: az maps account show --account-name MyMapsAccount --resource-group MyResourceGroup + text: az maps account show --name MyMapsAccount --resource-group MyResourceGroup crafted: true """ @@ -118,23 +118,23 @@ examples: - name: Update Account Managed Identities text: |- - az maps account update --type "SystemAssigned, UserAssigned" --user-assigned-identities \ + az maps account update --type "SystemAssigned, UserAssigned" --user-identities \ "{\\"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIden\ tity/userAssignedIdentities/identityName\\":{}}" --kind "Gen2" --linked-resources id="/subscriptions/{subscriptionId}/r\ esourceGroups/{resourceGroupName}/providers/Microsoft.Storage/accounts/{storageName}" unique-name="myBatchStorageAccoun\ -t" --name "G2" --account-name "myMapsAccount" --resource-group "myResourceGroup" +t" --name "G2" --account-name "myMapsAccount" --resource-group "myResourceGroup" --sku "S1" - name: Update Account Tags text: |- az maps account update --tags specialTag="true" --account-name "myMapsAccount" --resource-group \ -"myResourceGroup" +"myResourceGroup" --sku "S0" - name: Update to Gen1 Account text: |- - az maps account update --kind "Gen1" --sku "S1" --account-name "myMapsAccount" --resource-group \ -"myResourceGroup" + az maps account update --kind "Gen1" --name "S1" --account-name "myMapsAccount" --resource-group \ +"myResourceGroup" --sku "S0" - name: Update to Gen2 Account text: |- - az maps account update --kind "Gen2" --sku "G2" --account-name "myMapsAccount" --resource-group \ -"myResourceGroup" + az maps account update --kind "Gen2" --name "G2" --account-name "myMapsAccount" --resource-group \ +"myResourceGroup" --sku "S0" """ helps['maps account keys list'] = """ @@ -142,9 +142,9 @@ short-summary: "Get the keys to use with the Maps APIs. A key is used to authenticate and authorize access to the \ Maps REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration." examples: - - name: Keys List + - name: List Keys text: |- - az maps account keys list --account-name "myMapsAccount" --resource-group "myResourceGroup" + az maps account keys list --name "myMapsAccount" --resource-group "myResourceGroup" """ helps['maps account keys renew'] = """ @@ -152,9 +152,9 @@ short-summary: "Regenerate either the primary or secondary key for use with the Maps APIs. The old key will stop \ working immediately." examples: - - name: Keys Renew + - name: Renew text: |- - az maps account keys renew --account-name "myMapsAccount" --key "primary" --resource-group \ + az maps account keys renew --name "myMapsAccount" --key "primary" --resource-group \ "myResourceGroup" """ diff --git a/src/azure-cli/azure/cli/command_modules/maps/_params.py b/src/azure-cli/azure/cli/command_modules/maps/_params.py index 50289d42876..b49b370cafa 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_params.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_params.py @@ -56,7 +56,7 @@ def load_arguments(self, _): c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None']), help='The identity type.', arg_group='Identity') - c.argument('user_assigned_identities', options_list=['--user-identites'], type=validate_file_or_dict, + c.argument('user_assigned_identities', options_list=['--user-identities'], type=validate_file_or_dict, help='The list of user identities associated with the resource. ' 'The user identity dictionary key references will be ARM resource ids ' 'in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microso' @@ -78,7 +78,7 @@ def load_arguments(self, _): c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None']), help='The identity type.', arg_group='Identity') - c.argument('user_assigned_identities', options_list=['--user-identites'], type=validate_file_or_dict, + c.argument('user_assigned_identities', options_list=['--user-identities'], type=validate_file_or_dict, help='The list of user identities associated with the resource. ' 'The user identity dictionary key references will be ARM resource ids ' 'in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microso' diff --git a/src/azure-cli/azure/cli/command_modules/maps/commands.py b/src/azure-cli/azure/cli/command_modules/maps/commands.py index f9da3805ac3..6a96ecb1241 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/commands.py +++ b/src/azure-cli/azure/cli/command_modules/maps/commands.py @@ -31,7 +31,7 @@ def load_command_table(self, _): g.custom_command('list-operation', 'maps_map_list_operation') maps_creator = CliCommandType( - operations_tmpl='azext_maps.vendored_sdks.maps.operations._creators_operations#CreatorsOperations.{}', + operations_tmpl='azure.mgmt.maps.operations._creators_operations#CreatorsOperations.{}', client_factory=cf_creator) with self.command_group('maps creator', maps_creator, client_factory=cf_creator) as g: g.custom_command('list', 'maps_creator_list') From 659ebcbcf6c9781390af6634b27510eb176a58ff Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Wed, 23 Jun 2021 11:34:23 +0800 Subject: [PATCH 15/18] Update _params.py --- src/azure-cli/azure/cli/command_modules/maps/_params.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/azure-cli/azure/cli/command_modules/maps/_params.py b/src/azure-cli/azure/cli/command_modules/maps/_params.py index b49b370cafa..d15a1c29790 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_params.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_params.py @@ -121,3 +121,12 @@ def load_arguments(self, _): with self.argument_context('maps creator show') as c: c.argument('creator_name', options_list=['--creator-name'], type=str, help='The name of the ' 'Maps Creator instance.', id_part='child_name_1') + + with self.argument_context('maps creator list') as c: + c.argument('resource_group_name', + arg_type=resource_group_name_type, + id_part=None, + help='Resource group name') + c.argument('account_name', + id_part=None, + arg_type=maps_name_type) From 3a1e82b792cfc758f774b4f33facf91587884568 Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Wed, 30 Jun 2021 17:22:37 +0800 Subject: [PATCH 16/18] update If property is None, they should not be in maps_account_update_parameters. Modify the error of help. --- .../azure/cli/command_modules/maps/_help.py | 12 ++++---- .../azure/cli/command_modules/maps/custom.py | 30 ++++++++++++------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/_help.py b/src/azure-cli/azure/cli/command_modules/maps/_help.py index 9c66d06ecf0..60c997093cf 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/_help.py +++ b/src/azure-cli/azure/cli/command_modules/maps/_help.py @@ -41,15 +41,15 @@ --linked-resources id="/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Mic\ rosoft.Storage/accounts/mystorageacc" unique-name="myBatchStorageAccount" --linked-resources \ id="/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/acco\ -unts/mystorageacc" unique-name="myBlobDataSource" --name "G2" --tags test="true" --account-name "myMapsAccount" \ +unts/mystorageacc" unique-name="myBlobDataSource" --tags test="true" --account-name "myMapsAccount" \ --resource-group "myResourceGroup" --sku "S0" - name: Create Gen1 Account text: |- - az maps account create --kind "Gen1" --disable-local-auth false --name "S0" --tags \ + az maps account create --kind "Gen1" --disable-local-auth false --tags \ test="true" --account-name "myMapsAccount" --resource-group "myResourceGroup" --sku "S0" - name: Create Gen2 Account text: |- - az maps account create --kind "Gen2" --disable-local-auth true --name "G2" --tags \ + az maps account create --kind "Gen2" --disable-local-auth true --tags \ test="true" --account-name "myMapsAccount" --resource-group "myResourceGroup" --sku "S0" """ @@ -122,18 +122,18 @@ "{\\"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIden\ tity/userAssignedIdentities/identityName\\":{}}" --kind "Gen2" --linked-resources id="/subscriptions/{subscriptionId}/r\ esourceGroups/{resourceGroupName}/providers/Microsoft.Storage/accounts/{storageName}" unique-name="myBatchStorageAccoun\ -t" --name "G2" --account-name "myMapsAccount" --resource-group "myResourceGroup" --sku "S1" +t" --account-name "myMapsAccount" --resource-group "myResourceGroup" --sku "S1" - name: Update Account Tags text: |- az maps account update --tags specialTag="true" --account-name "myMapsAccount" --resource-group \ "myResourceGroup" --sku "S0" - name: Update to Gen1 Account text: |- - az maps account update --kind "Gen1" --name "S1" --account-name "myMapsAccount" --resource-group \ + az maps account update --kind "Gen1" --account-name "myMapsAccount" --resource-group \ "myResourceGroup" --sku "S0" - name: Update to Gen2 Account text: |- - az maps account update --kind "Gen2" --name "G2" --account-name "myMapsAccount" --resource-group \ + az maps account update --kind "Gen2" --account-name "myMapsAccount" --resource-group \ "myResourceGroup" --sku "S0" """ diff --git a/src/azure-cli/azure/cli/command_modules/maps/custom.py b/src/azure-cli/azure/cli/command_modules/maps/custom.py index 93ea5664f86..0dde44edc7a 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/custom.py +++ b/src/azure-cli/azure/cli/command_modules/maps/custom.py @@ -50,15 +50,19 @@ def maps_account_create(client, if disable_local_auth is None: disable_local_auth = False maps_account = {} - maps_account['tags'] = tags + if tags is not None: + maps_account['tags'] = tags maps_account['location'] = ACCOUNT_LOCATION maps_account['kind'] = "Gen1" if kind is None else kind maps_account['properties'] = {} maps_account['properties']['disable_local_auth'] = False if disable_local_auth is None else disable_local_auth - maps_account['properties']['linked_resources'] = linked_resources + if linked_resources is not None: + maps_account['properties']['linked_resources'] = linked_resources maps_account['identity'] = {} - maps_account['identity']['type'] = type_ - maps_account['identity']['user_assigned_identities'] = user_assigned_identities + if type_ is not None: + maps_account['identity']['type'] = type_ + if user_assigned_identities is not None: + maps_account['identity']['user_assigned_identities'] = user_assigned_identities maps_account['sku'] = {} maps_account['sku']['name'] = name return client.create_or_update(resource_group_name=resource_group_name, @@ -96,13 +100,17 @@ def maps_account_update(client, if disable_local_auth is None: disable_local_auth = False maps_account_update_parameters = {} - maps_account_update_parameters['tags'] = tags + if tags is not None: + maps_account_update_parameters['tags'] = tags maps_account_update_parameters['kind'] = "Gen1" if kind is None else kind maps_account_update_parameters['disable_local_auth'] = False if disable_local_auth is None else disable_local_auth - maps_account_update_parameters['linked_resources'] = linked_resources + if linked_resources is not None: + maps_account_update_parameters['linked_resources'] = linked_resources maps_account_update_parameters['identity'] = {} - maps_account_update_parameters['identity']['type'] = type_ - maps_account_update_parameters['identity']['user_assigned_identities'] = user_assigned_identities + if type_ is not None: + maps_account_update_parameters['identity']['type'] = type_ + if user_assigned_identities is not None: + maps_account_update_parameters['identity']['user_assigned_identities'] = user_assigned_identities maps_account_update_parameters['sku'] = {} maps_account_update_parameters['sku']['name'] = name return client.update(resource_group_name=resource_group_name, @@ -163,7 +171,8 @@ def maps_creator_create(client, storage_units, tags=None): creator_resource = {} - creator_resource['tags'] = tags + if tags is not None: + creator_resource['tags'] = tags creator_resource['location'] = location creator_resource['properties'] = {} creator_resource['properties']['storage_units'] = storage_units @@ -180,7 +189,8 @@ def maps_creator_update(client, tags=None, storage_units=None): creator_update_parameters = {} - creator_update_parameters['tags'] = tags + if tags is not None: + creator_update_parameters['tags'] = tags creator_update_parameters['storage_units'] = storage_units return client.update(resource_group_name=resource_group_name, account_name=account_name, From d34c8adf12674fc69a3f75127e61f887221d1c50 Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Thu, 1 Jul 2021 15:44:37 +0800 Subject: [PATCH 17/18] Update custom.py --- .../azure/cli/command_modules/maps/custom.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/custom.py b/src/azure-cli/azure/cli/command_modules/maps/custom.py index 0dde44edc7a..9b9f3888a1e 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/custom.py +++ b/src/azure-cli/azure/cli/command_modules/maps/custom.py @@ -95,24 +95,24 @@ def maps_account_update(client, type_=None, user_assigned_identities=None, name=None): - if kind is None: - kind = "Gen1" if disable_local_auth is None: disable_local_auth = False maps_account_update_parameters = {} if tags is not None: maps_account_update_parameters['tags'] = tags - maps_account_update_parameters['kind'] = "Gen1" if kind is None else kind + if kind is not None: + maps_account_update_parameters['kind'] = kind maps_account_update_parameters['disable_local_auth'] = False if disable_local_auth is None else disable_local_auth if linked_resources is not None: maps_account_update_parameters['linked_resources'] = linked_resources - maps_account_update_parameters['identity'] = {} + if type_ is not None or user_assigned_identities is not None: + maps_account_update_parameters['identity'] = {} if type_ is not None: maps_account_update_parameters['identity']['type'] = type_ if user_assigned_identities is not None: maps_account_update_parameters['identity']['user_assigned_identities'] = user_assigned_identities - maps_account_update_parameters['sku'] = {} - maps_account_update_parameters['sku']['name'] = name + if name is not None: + maps_account_update_parameters['sku'] = {'name': name} return client.update(resource_group_name=resource_group_name, account_name=account_name, maps_account_update_parameters=maps_account_update_parameters) @@ -191,7 +191,8 @@ def maps_creator_update(client, creator_update_parameters = {} if tags is not None: creator_update_parameters['tags'] = tags - creator_update_parameters['storage_units'] = storage_units + if storage_units is not None: + creator_update_parameters['storage_units'] = storage_units return client.update(resource_group_name=resource_group_name, account_name=account_name, creator_name=creator_name, From 1724b7b8b424a626f70c1000b5092d616dce6af9 Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Fri, 2 Jul 2021 13:45:32 +0800 Subject: [PATCH 18/18] Update custom.py --- src/azure-cli/azure/cli/command_modules/maps/custom.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/maps/custom.py b/src/azure-cli/azure/cli/command_modules/maps/custom.py index 9b9f3888a1e..2a7cb6ddb6a 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/custom.py +++ b/src/azure-cli/azure/cli/command_modules/maps/custom.py @@ -95,14 +95,13 @@ def maps_account_update(client, type_=None, user_assigned_identities=None, name=None): - if disable_local_auth is None: - disable_local_auth = False maps_account_update_parameters = {} if tags is not None: maps_account_update_parameters['tags'] = tags if kind is not None: maps_account_update_parameters['kind'] = kind - maps_account_update_parameters['disable_local_auth'] = False if disable_local_auth is None else disable_local_auth + if disable_local_auth is not None: + maps_account_update_parameters['disable_local_auth'] = disable_local_auth if linked_resources is not None: maps_account_update_parameters['linked_resources'] = linked_resources if type_ is not None or user_assigned_identities is not None: