diff --git a/doc/sphinx/azhelpgen/doc_source_map.json b/doc/sphinx/azhelpgen/doc_source_map.json index 79f6744fcdc..ab7ed8d763b 100644 --- a/doc/sphinx/azhelpgen/doc_source_map.json +++ b/doc/sphinx/azhelpgen/doc_source_map.json @@ -32,6 +32,7 @@ "iot": "src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/_help.py", "keyvault": "src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/_help.py", "lab": "src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/_help.py", + "maps": "src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_help.py", "monitor": "src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/_help.py", "network": "src/command_modules/azure-cli-network/azure/cli/command_modules/network/_help.py", "policy": "src/command_modules/azure-cli-resource/azure/cli/command_modules/resource/_help.py", diff --git a/src/command_modules/azure-cli-maps/HISTORY.rst b/src/command_modules/azure-cli-maps/HISTORY.rst new file mode 100644 index 00000000000..97793440e77 --- /dev/null +++ b/src/command_modules/azure-cli-maps/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 ++++++ +* Initial release \ No newline at end of file diff --git a/src/command_modules/azure-cli-maps/MANIFEST.in b/src/command_modules/azure-cli-maps/MANIFEST.in new file mode 100644 index 00000000000..bb37a2723da --- /dev/null +++ b/src/command_modules/azure-cli-maps/MANIFEST.in @@ -0,0 +1 @@ +include *.rst diff --git a/src/command_modules/azure-cli-maps/README.rst b/src/command_modules/azure-cli-maps/README.rst new file mode 100644 index 00000000000..9707ba24605 --- /dev/null +++ b/src/command_modules/azure-cli-maps/README.rst @@ -0,0 +1,7 @@ +Microsoft Azure CLI 'maps' Command Module +==================================================== + +This package is for the 'maps' module. +i.e. 'az maps' + + diff --git a/src/command_modules/azure-cli-maps/__init__.py b/src/command_modules/azure-cli-maps/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/command_modules/azure-cli-maps/__init__.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/src/command_modules/azure-cli-maps/azure/__init__.py b/src/command_modules/azure-cli-maps/azure/__init__.py new file mode 100644 index 00000000000..73baee1e640 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +import pkg_resources +pkg_resources.declare_namespace(__name__) diff --git a/src/command_modules/azure-cli-maps/azure/cli/__init__.py b/src/command_modules/azure-cli-maps/azure/cli/__init__.py new file mode 100644 index 00000000000..73baee1e640 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +import pkg_resources +pkg_resources.declare_namespace(__name__) diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/__init__.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/__init__.py new file mode 100644 index 00000000000..73baee1e640 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +import pkg_resources +pkg_resources.declare_namespace(__name__) diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/__init__.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/__init__.py new file mode 100644 index 00000000000..5bdd63ff517 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/__init__.py @@ -0,0 +1,32 @@ +# -------------------------------------------------------------------------------------------- +# 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.core import AzCommandsLoader + +import azure.cli.command_modules.maps._help # pylint: disable=unused-import +from azure.cli.command_modules.maps._client_factory import cf_accounts + + +class MapsCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + custom_type = CliCommandType( + operations_tmpl='azure.cli.command_modules.maps.custom#{}', + client_factory=cf_accounts) + super(MapsCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=custom_type) + + def load_command_table(self, args): + from azure.cli.command_modules.maps.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azure.cli.command_modules.maps._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = MapsCommandsLoader diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_client_factory.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_client_factory.py new file mode 100644 index 00000000000..96c1a3ca3b7 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_client_factory.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +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) + + +def cf_accounts(cli_ctx, *_): + return cf_maps(cli_ctx).accounts diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_help.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_help.py new file mode 100644 index 00000000000..a8f6401adaf --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_help.py @@ -0,0 +1,60 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.help_files import helps + +helps['maps'] = """ + type: group + short-summary: Manage Azure Maps. +""" + +helps['maps account'] = """ + type: group + short-summary: Manage Azure Maps accounts. +""" + +helps['maps account keys'] = """ + type: group + short-summary: Manage Azure Maps account keys. +""" + +helps['maps account show'] = """ + type: command + short-summary: Show the details of a maps account. +""" + +helps['maps account list'] = """ + type: command + short-summary: Show all maps accounts in a subscription or in a resource group. +""" + +helps['maps account create'] = """ + type: command + short-summary: Create a maps account. +""" + +helps['maps account update'] = """ + type: command + short-summary: Update the properties of a maps account. +""" + +helps['maps account delete'] = """ + type: command + short-summary: Delete a maps account. +""" + +helps['maps account keys list'] = """ + type: command + short-summary: List the keys to use with the Maps APIs. + long-summary: | + 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. +""" + +helps['maps account keys renew'] = """ + type: command + short-summary: Renew either the primary or secondary key for use with the Maps APIs. + long-summary: | + This command immediately invalidates old API keys. Only the renewed keys can be used to connect to maps. +""" diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_params.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_params.py new file mode 100644 index 00000000000..d4bd4ca8774 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_params.py @@ -0,0 +1,50 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.arguments import CLIArgumentType + +from azure.cli.core.commands.parameters import ( + get_enum_type, + get_resource_name_completion_list, + resource_group_name_type, + tags_type) + +from azure.mgmt.maps.models.maps_management_client_enums import KeyType + + +def load_arguments(self, _): + # Argument Definition + maps_name_type = CLIArgumentType(options_list=['--name', '-n'], + completer=get_resource_name_completion_list('Microsoft.Maps/accounts'), + help='The name of the maps account') + + # Parameter Registration + with self.argument_context('maps') as c: + c.argument('resource_group_name', + arg_type=resource_group_name_type, + id_part='resource_group', + help='Resource group name') + 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'])) + c.argument('tags', + arg_type=tags_type) + + # Prevent --ids argument in keys with id_part=None + with self.argument_context('maps account keys') as c: + c.argument('account_name', + id_part=None, + arg_type=maps_name_type) + + with self.argument_context('maps account keys renew') as c: + c.argument('key_type', + options_list=['--key'], + arg_type=get_enum_type(KeyType)) diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/commands.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/commands.py new file mode 100644 index 00000000000..2d74cb6c5b1 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/commands.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# 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.core.commands import CliCommandType +from azure.cli.core.util import empty_on_404 +from azure.cli.command_modules.maps._client_factory import cf_accounts + + +def load_command_table(self, _): + mgmt_type = CliCommandType( + operations_tmpl='azure.mgmt.maps.operations.accounts_operations#AccountsOperations.{}', + client_factory=cf_accounts) + + with self.command_group('maps account', mgmt_type) as g: + g.command('show', 'get', exception_handler=empty_on_404) + g.custom_command('list', 'list_accounts') + g.custom_command('create', 'create_account') + 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') + + with self.command_group('maps account keys', mgmt_type) as g: + g.command('renew', 'regenerate_keys') + g.command('list', 'list_keys') diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/custom.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/custom.py new file mode 100644 index 00000000000..ddcfc5aebef --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/custom.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.log import get_logger + +from azure.mgmt.maps.models import ( + MapsAccountCreateParameters, + Sku) + +ACCOUNT_LOCATION = 'global' + +logger = get_logger(__name__) + + +def create_account(client, resource_group_name, account_name, sku_name='S0', tags=None): + 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 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 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 diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/__init__.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/__init__.py new file mode 100644 index 00000000000..73baee1e640 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +import pkg_resources +pkg_resources.declare_namespace(__name__) diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/__init__.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/__init__.py new file mode 100644 index 00000000000..73baee1e640 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +import pkg_resources +pkg_resources.declare_namespace(__name__) diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/recordings/test_create_maps_account.yaml b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/recordings/test_create_maps_account.yaml new file mode 100644 index 00000000000..9cc1ab71f27 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/recordings/test_create_maps_account.yaml @@ -0,0 +1,741 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.30] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:39:53 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.30] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002","name":"clitest.rg000002","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:39:54 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: '{"location": "global", "sku": {"name": "S0"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account create] + Connection: [keep-alive] + Content-Length: ['45'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + 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 + response: + body: {string: "{\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 \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"sku\": {\r\n \"name\": \"S0\",\r\ + \n \"tier\": \"Standard\"\r\n }\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['372'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:39:57 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: '{"location": "global", "sku": {"name": "S0"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account create] + Connection: [keep-alive] + Content-Length: ['45'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + 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 + response: + body: {string: "{\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 \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"sku\": {\r\n \"name\": \"S0\",\r\ + \n \"tier\": \"Standard\"\r\n }\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['372'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:39:59 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-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- 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] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + 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 \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"sku\": {\r\n \"name\": \"S0\",\r\ + \n \"tier\": \"Standard\"\r\n }\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['372'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:00 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] + status: {code: 200, message: OK} +- request: + body: 'b''b\''{"location": "global", "tags": {"key-000003": "val-000004"}, "sku": + {"name": "S0"}}\''''' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account update] + Connection: [keep-alive] + Content-Length: ['83'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + 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 + response: + body: {string: "{\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 \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"tags\": {\r\n \"key-000003\": \"\ + val-000004\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S0\",\r\n \"tier\"\ + : \"Standard\"\r\n }\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['423'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:02 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-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + 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 \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"tags\": {\r\n \"key-000003\": \"\ + val-000004\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S0\",\r\n \"tier\"\ + : \"Standard\"\r\n }\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['423'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:03 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] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + 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 \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"tags\": {\r\n \"key-000003\": \"\ + val-000004\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S0\",\r\n \"tier\"\ + : \"Standard\"\r\n }\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['423'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:03 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] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: "{\r\n \"value\": [\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 \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"tags\": {\r\n \"key-000003\"\ + : \"val-000004\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S0\"\ + ,\r\n \"tier\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['500'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:04 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] + status: {code: 200, message: OK} +- request: + body: '{"location": "global", "sku": {"name": "S0"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account create] + Connection: [keep-alive] + Content-Length: ['45'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: "{\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 \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"sku\": {\r\n \"name\": \"S0\",\r\ + \n \"tier\": \"Standard\"\r\n }\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['372'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:06 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: '{"location": "global", "sku": {"name": "S0"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account create] + Connection: [keep-alive] + Content-Length: ['45'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + 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-000007?api-version=2018-05-01 + response: + body: {string: "{\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 \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"sku\": {\r\n \"name\": \"S0\",\r\ + \n \"tier\": \"Standard\"\r\n }\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['372'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:09 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: "{\r\n \"value\": [\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 \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"sku\": {\r\n \"name\"\ + : \"S0\",\r\n \"tier\": \"Standard\"\r\n }\r\n },\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 \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"tags\": {\r\n \"key-000003\"\ + : \"val-000004\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S0\"\ + ,\r\n \"tier\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['915'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:10 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] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: "{\r\n \"value\": [\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 \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"sku\": {\r\n \"name\"\ + : \"S0\",\r\n \"tier\": \"Standard\"\r\n }\r\n }\r\n ]\r\n\ + }"} + headers: + cache-control: [no-cache] + content-length: ['437'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:11 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] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account keys list] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ + ,\r\n \"primaryKey\": \"l50MqmR18AskhfSwZCa_8ftIrvPfa0fcIil3-0ZpJ2I\",\r\n\ + \ \"secondaryKey\": \"thely3nUQ5TnvuL2vAlIomEi_-22KYyLxUGdKbVAJ1k\",\r\n\ + \ \"primaryKeyLastUpdated\": \"2018-05-07T22:39:56.4200915Z\",\r\n \"secondaryKeyLastUpdated\"\ + : \"2018-05-07T22:39:56.4200915Z\"\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['465'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:11 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-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: '{"keyType": "primary"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account keys renew] + Connection: [keep-alive] + Content-Length: ['22'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ + ,\r\n \"primaryKey\": \"a38PW4JcKSEg5aKCsdyKkN4rzLSIWXtRvApQ0mFsmKo\",\r\n\ + \ \"secondaryKey\": \"thely3nUQ5TnvuL2vAlIomEi_-22KYyLxUGdKbVAJ1k\",\r\n\ + \ \"primaryKeyLastUpdated\": \"2018-05-07T22:40:13.3403541Z\",\r\n \"secondaryKeyLastUpdated\"\ + : \"2018-05-07T22:39:56.4200915Z\"\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['465'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:13 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-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: '{"keyType": "secondary"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account keys renew] + Connection: [keep-alive] + Content-Length: ['24'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ + ,\r\n \"primaryKey\": \"a38PW4JcKSEg5aKCsdyKkN4rzLSIWXtRvApQ0mFsmKo\",\r\n\ + \ \"secondaryKey\": \"f0zU3xMioo-AP31kt4ovc5DqQaeXIm60uBhXhmhrQDs\",\r\n\ + \ \"primaryKeyLastUpdated\": \"2018-05-07T22:40:13.3403541Z\",\r\n \"secondaryKeyLastUpdated\"\ + : \"2018-05-07T22:40:13.9034864Z\"\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['465'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:14 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-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Mon, 07 May 2018 22:40:17 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + 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 account list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: "{\r\n \"value\": [\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 \"type\": \"Microsoft.Maps/accounts\"\ + ,\r\n \"location\": \"global\",\r\n \"sku\": {\r\n \"name\"\ + : \"S0\",\r\n \"tier\": \"Standard\"\r\n }\r\n }\r\n ]\r\n\ + }"} + headers: + cache-control: [no-cache] + content-length: ['437'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:40:18 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] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Mon, 07 May 2018 22:41:02 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + 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 account delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Mon, 07 May 2018 22:41:04 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + 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 account list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: "{\r\n \"value\": []\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['19'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:41: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] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [maps account list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 azure-mgmt-maps/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.30] + accept-language: [en-US] + 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 + response: + body: {string: "{\r\n \"value\": []\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['19'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 07 May 2018 22:41: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] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.30] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Mon, 07 May 2018 22:41:07 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdERFNVTlJZWTZOTFhTRFNMT1lFTTVLTkFGQ0RTUktMVjM1WXw4MjhBNzcxOTk4NkRENjVELVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-deletes: ['14999'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.29 + msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.30] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Mon, 07 May 2018 22:41:08 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdGVkhBTFJTNTVZWkxOTjZQUVZOVElQSERBNlBJTFFGV1hERXw4Nzc3MDUwRjVERDBEMTFELVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-deletes: ['14999'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py new file mode 100644 index 00000000000..edba266d7c8 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py @@ -0,0 +1,154 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import re + +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.mgmt.maps.models.maps_management_client_enums import KeyType + + +class MapsScenarioTests(ScenarioTest): + + @ResourceGroupPreparer(key='rg') + @ResourceGroupPreparer(key='rg1') + def test_create_maps_account(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), + 'name1': self.create_random_name(prefix='cli-', length=20), + 'name2': self.create_random_name(prefix='cli-', length=20), + 'sku': 'S0', + 'tags': tag_key + '=' + tag_value, + 'key_type_primary': KeyType.primary.value, + 'key_type_secondary': KeyType.secondary.value + }) + + # Test 'az maps account create'. + # Test to create a Maps account. + account = self.cmd('az maps account create -n {name} -g {rg} --sku {sku}', + checks=[ + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('sku.name', '{sku}'), + self.check('tags', None) + ]).get_output_in_json() + + # Call create again, expect to get the same account. + account_duplicated = self.cmd( + 'az maps account create -n {name} -g {rg} --sku {sku}').get_output_in_json() + self.assertEqual(account, account_duplicated) + + # Test 'az maps account update' + # Test to add a new tag to an existing account. + self.cmd('az maps account update -n {name} -g {rg} --sku {sku} --tags {tags}', + checks=[ + self.check('id', account['id']), + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('sku.name', '{sku}'), + self.check('tags', {tag_key: tag_value}) + ]) + + # Test 'az maps account show'. + # Test to get information on Maps account. + self.cmd('az maps account show -n {name} -g {rg}', checks=[ + self.check('id', account['id']), + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('sku.name', '{sku}') + ]) + # Search by id + self.cmd('az maps account show --ids ' + account['id'], checks=[ + self.check('id', account['id']), + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('sku.name', '{sku}'), + self.check('tags', {tag_key: tag_value}) + ]) + + # Test 'az maps account list'. + # Test to list all Maps accounts under a resource group. + self.cmd('az maps account list -g {rg}', checks=[ + self.check('length(@)', 1), + self.check('type(@)', 'array'), + self.check('[0].id', account['id']), + self.check('[0].name', '{name}'), + self.check('[0].resourceGroup', '{rg}'), + self.check('[0].sku.name', '{sku}'), + self.check('[0].tags', {tag_key: tag_value}) + ]) + + # Create two new accounts (One in separate resource group). + self.cmd('az maps account create -n {name1} -g {rg1} --sku {sku}') + self.cmd('az maps account create -n {name2} -g {rg} --sku {sku}') + # Check that list command now shows two accounts in one resource group, and one in another. + self.cmd('az maps account list -g {rg}', checks=[ + self.check('length(@)', 2), + self.check('type(@)', 'array'), + self.check("length([?name == '{name}'])", 1), + self.check("length([?name == '{name1}'])", 0), + self.check("length([?name == '{name2}'])", 1), + self.check("length([?resourceGroup == '{rg}'])", 2), + self.check("length([?resourceGroup == '{rg1}'])", 0) + ]) + self.cmd('az maps account list -g {rg1}', checks=[ + self.check('length(@)', 1), + self.check('type(@)', 'array'), + self.check("length([?name == '{name}'])", 0), + self.check("length([?name == '{name1}'])", 1), + self.check("length([?name == '{name2}'])", 0), + self.check("length([?resourceGroup == '{rg}'])", 0), + self.check("length([?resourceGroup == '{rg1}'])", 1) + ]) + + # 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() + + # Retrieve primary and secondary keys. + primary_key_old = account_key_list['primaryKey'] + secondary_key_old = account_key_list['secondaryKey'] + self.assertTrue(re.match('^[a-zA-Z0-9_-]+$', primary_key_old)) + self.assertTrue(re.match('^[a-zA-Z0-9_-]+$', secondary_key_old)) + + # 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() + + # Only primary key was regenerated. Secondary key should remain same. + self.assertNotEqual(primary_key_old, key_regenerated['primaryKey']) + self.assertEqual(secondary_key_old, key_regenerated['secondaryKey']) + + # Save the new primary key, and regenerate the secondary key. + primary_key_old = key_regenerated['primaryKey'] + key_regenerated = self.cmd( + 'az maps account keys renew -n {name} -g {rg} --key {key_type_secondary}') \ + .get_output_in_json() + self.assertEqual(primary_key_old, key_regenerated['primaryKey']) + self.assertNotEqual(secondary_key_old, key_regenerated['secondaryKey']) + + # Test 'az maps account delete'. + # Test to remove a Maps account. + self.cmd('az maps account delete -n {name} -g {rg}', checks=self.is_empty()) + self.cmd('az maps account list -g {rg}', checks=[ + self.check('length(@)', 1), + self.check("length([?name == '{name}'])", 0) + ]) + + # Remove the rest of Maps accounts. + exit_code = self.cmd('az maps account delete -n {name1} -g {rg1}').exit_code + self.assertEqual(exit_code, 0) + self.cmd('az maps account delete -n {name2} -g {rg}') + self.cmd('az maps account list -g {rg}', checks=self.is_empty()) + self.cmd('az maps account list -g {rg1}', checks=self.is_empty()) diff --git a/src/command_modules/azure-cli-maps/azure_bdist_wheel.py b/src/command_modules/azure-cli-maps/azure_bdist_wheel.py new file mode 100644 index 00000000000..8a81d1b6177 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure_bdist_wheel.py @@ -0,0 +1,54 @@ +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +from distutils import log as logger +import os.path + +from wheel.bdist_wheel import bdist_wheel +class azure_bdist_wheel(bdist_wheel): + """The purpose of this class is to build wheel a little differently than the sdist, + without requiring to build the wheel from the sdist (i.e. you can build the wheel + directly from source). + """ + + description = "Create an Azure wheel distribution" + + user_options = bdist_wheel.user_options + \ + [('azure-namespace-package=', None, + "Name of the deepest nspkg used")] + + def initialize_options(self): + bdist_wheel.initialize_options(self) + self.azure_namespace_package = None + + def finalize_options(self): + bdist_wheel.finalize_options(self) + if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"): + raise ValueError("azure_namespace_package must finish by -nspkg") + + def run(self): + if not self.distribution.install_requires: + self.distribution.install_requires = [] + self.distribution.install_requires.append( + "{}>=2.0.0".format(self.azure_namespace_package)) + bdist_wheel.run(self) + + def write_record(self, bdist_dir, distinfo_dir): + if self.azure_namespace_package: + # Split and remove last part, assuming it's "nspkg" + subparts = self.azure_namespace_package.split('-')[0:-1] + folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))] + for azure_sub_package in folder_with_init: + init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py') + if os.path.isfile(init_file): + logger.info("manually remove {} while building the wheel".format(init_file)) + os.remove(init_file) + else: + raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file)) + bdist_wheel.write_record(self, bdist_dir, distinfo_dir) +cmdclass = { + 'bdist_wheel': azure_bdist_wheel, +} diff --git a/src/command_modules/azure-cli-maps/setup.cfg b/src/command_modules/azure-cli-maps/setup.cfg new file mode 100644 index 00000000000..3326c62a76e --- /dev/null +++ b/src/command_modules/azure-cli-maps/setup.cfg @@ -0,0 +1,3 @@ +[bdist_wheel] +universal=1 +azure-namespace-package=azure-cli-command_modules-nspkg diff --git a/src/command_modules/azure-cli-maps/setup.py b/src/command_modules/azure-cli-maps/setup.py new file mode 100644 index 00000000000..a843d67d00f --- /dev/null +++ b/src/command_modules/azure-cli-maps/setup.py @@ -0,0 +1,61 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from codecs import open +from setuptools import setup + +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") + cmdclass = {} + +VERSION = "0.1.0" + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', +] + +DEPENDENCIES = [ + 'azure-cli-core', + 'azure-mgmt-maps==0.1.0' +] + +with open('README.rst', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='azure-cli-maps', + version=VERSION, + description='Microsoft Azure Command-Line Tools Maps Command Module', + long_description=README + '\n\n' + HISTORY, + license='MIT', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli', + classifiers=CLASSIFIERS, + packages=[ + 'azure', + 'azure.cli', + 'azure.cli.command_modules', + 'azure.cli.command_modules.maps' + ], + install_requires=DEPENDENCIES, + cmdclass=cmdclass +) diff --git a/tools/automation/verify/verify_module_load_times.py b/tools/automation/verify/verify_module_load_times.py index 24bad7c1381..719ee4630c1 100644 --- a/tools/automation/verify/verify_module_load_times.py +++ b/tools/automation/verify/verify_module_load_times.py @@ -20,7 +20,7 @@ 'vm': 25, 'batch': 25, 'storage': 50, - 'sql': 30, + 'servicefabric': 30, TOTAL: 300 }