From 418b2a188a156df8eaed4a0133ce7e56d4131507 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Fri, 23 Feb 2018 15:12:49 -0800 Subject: [PATCH 01/28] Introduce LocationBasedServices command_module --- src/command_modules/azure-cli-lbs/HISTORY.rst | 8 + src/command_modules/azure-cli-lbs/MANIFEST.in | 1 + src/command_modules/azure-cli-lbs/README.rst | 7 + src/command_modules/azure-cli-lbs/__init__.py | 4 + .../azure-cli-lbs/azure/__init__.py | 6 + .../azure-cli-lbs/azure/cli/__init__.py | 6 + .../azure/cli/command_modules/__init__.py | 6 + .../azure/cli/command_modules/lbs/__init__.py | 32 ++ .../command_modules/lbs/_client_factory.py | 14 + .../azure/cli/command_modules/lbs/_help.py | 57 ++ .../azure/cli/command_modules/lbs/_params.py | 46 ++ .../azure/cli/command_modules/lbs/commands.py | 23 + .../azure/cli/command_modules/lbs/custom.py | 62 ++ .../cli/command_modules/lbs/tests/__init__.py | 6 + .../lbs/tests/latest/__init__.py | 6 + .../cli/command_modules/lbs/validators.py | 26 + .../azure-cli-lbs/azure_bdist_wheel.py | 533 ++++++++++++++++++ src/command_modules/azure-cli-lbs/setup.cfg | 3 + src/command_modules/azure-cli-lbs/setup.py | 61 ++ 19 files changed, 907 insertions(+) create mode 100644 src/command_modules/azure-cli-lbs/HISTORY.rst create mode 100644 src/command_modules/azure-cli-lbs/MANIFEST.in create mode 100644 src/command_modules/azure-cli-lbs/README.rst create mode 100644 src/command_modules/azure-cli-lbs/__init__.py create mode 100644 src/command_modules/azure-cli-lbs/azure/__init__.py create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/__init__.py create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/command_modules/__init__.py create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/__init__.py create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_client_factory.py create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_help.py create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_params.py create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/commands.py create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/custom.py create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/__init__.py create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/__init__.py create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/validators.py create mode 100644 src/command_modules/azure-cli-lbs/azure_bdist_wheel.py create mode 100644 src/command_modules/azure-cli-lbs/setup.cfg create mode 100644 src/command_modules/azure-cli-lbs/setup.py diff --git a/src/command_modules/azure-cli-lbs/HISTORY.rst b/src/command_modules/azure-cli-lbs/HISTORY.rst new file mode 100644 index 00000000000..97793440e77 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/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-lbs/MANIFEST.in b/src/command_modules/azure-cli-lbs/MANIFEST.in new file mode 100644 index 00000000000..bb37a2723da --- /dev/null +++ b/src/command_modules/azure-cli-lbs/MANIFEST.in @@ -0,0 +1 @@ +include *.rst diff --git a/src/command_modules/azure-cli-lbs/README.rst b/src/command_modules/azure-cli-lbs/README.rst new file mode 100644 index 00000000000..1f07fc6577a --- /dev/null +++ b/src/command_modules/azure-cli-lbs/README.rst @@ -0,0 +1,7 @@ +Microsoft Azure CLI 'location based services' Command Module +==================================================== + +This package is for the 'location based services' module. +i.e. 'az lbs' + + diff --git a/src/command_modules/azure-cli-lbs/__init__.py b/src/command_modules/azure-cli-lbs/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/command_modules/azure-cli-lbs/__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-lbs/azure/__init__.py b/src/command_modules/azure-cli-lbs/azure/__init__.py new file mode 100644 index 00000000000..73baee1e640 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/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-lbs/azure/cli/__init__.py b/src/command_modules/azure-cli-lbs/azure/cli/__init__.py new file mode 100644 index 00000000000..73baee1e640 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/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-lbs/azure/cli/command_modules/__init__.py b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/__init__.py new file mode 100644 index 00000000000..73baee1e640 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/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-lbs/azure/cli/command_modules/lbs/__init__.py b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/__init__.py new file mode 100644 index 00000000000..18bdef16ec6 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/__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.lbs._help # pylint: disable=unused-import +from azure.cli.command_modules.lbs._client_factory import cf_accounts + + +class LocationBasedServicesCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + custom_type = CliCommandType( + operations_tmpl='azure.cli.command_modules.lbs.custom#{}', + client_factory=cf_accounts) + super(LocationBasedServicesCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=custom_type) + + def load_command_table(self, args): + from azure.cli.command_modules.lbs.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azure.cli.command_modules.lbs._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = LocationBasedServicesCommandsLoader diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_client_factory.py b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_client_factory.py new file mode 100644 index 00000000000..e803ddb6a8f --- /dev/null +++ b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_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_lbs(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azure.mgmt.locationbasedservices import Client + return get_mgmt_service_client(cli_ctx, Client) + + +def cf_accounts(cli_ctx, *_): + return cf_lbs(cli_ctx).accounts diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_help.py b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_help.py new file mode 100644 index 00000000000..a3452a482af --- /dev/null +++ b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_help.py @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------------------------- +# 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['lbs'] = """ + type: group + short-summary: Manage Azure Location Based Services accounts. +""" + +helps['lbs account'] = """ + type: group + short-summary: Commands to manage Azure Location Based Services accounts. +""" + +helps['lbs account key'] = """ + type: group + short-summary: Commands to manage Azure Location Based Services account keys. +""" + +helps['lbs account show'] = """ + type: command + short-summary: Show a Location Based Services account. +""" + +helps['lbs account list'] = """ + type: command + short-summary: Show all Location Based Services accounts in a Subscription or in a Resource Group. +""" + +helps['lbs account create'] = """ + type: command + short-summary: Create a Location Based Services account. + long-summary: | + Create a Location Based Services account. A Location Based Services account holds the keys which allow access to the Location Based Services REST APIs. +""" + +helps['lbs account delete'] = """ + type: command + short-summary: Delete a Location Based Services account. +""" + +helps['lbs account key list'] = """ + type: command + short-summary: List the keys to use with the Location Based Services APIs. + long-summary: | + List the keys to use with the Location Based Services APIs. A key is used to authenticate and authorize access to the Location Based Services REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. +""" + +helps['lbs account key regenerate'] = """ + type: command + short-summary: Regenerate either the primary or secondary key for use with the Location Based Services APIs. + long-summary: | + Regenerate either the primary or secondary key for use with the Location Based Services APIs. The old key will stop working immediately. +""" diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_params.py b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_params.py new file mode 100644 index 00000000000..53b2d787c77 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_params.py @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------------------------- +# 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.cli.command_modules.lbs.validators import validate_account_name +from azure.mgmt.locationbasedservices.models.client_enums import KeyType + + +def load_arguments(self, _): + # Argument Definition + lbs_name_type = CLIArgumentType(options_list=['--account-name', '-n'], + completer=get_resource_name_completion_list( + 'Microsoft.LocationBasedServices/accounts'), + help='The name of the Location Based Services Account', + validator=validate_account_name) + + # Parameter Registration + with self.argument_context('lbs') as c: + c.argument('resource_group_name', + arg_type=resource_group_name_type, + help='Resource group name') + c.argument('account_name', + arg_type=lbs_name_type) + + with self.argument_context('lbs account create') as c: + c.argument('sku_name', + options_list=['--sku', '-s'], + help='The name of the SKU, in standard format (such as S0).', + arg_type=get_enum_type(['S0']), + required=False) + c.argument('tags', + arg_type=tags_type) + + with self.argument_context('lbs account key regenerate') as c: + c.argument('key_type', + options_list=['--type', '-t'], + arg_type=get_enum_type(KeyType)) diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/commands.py b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/commands.py new file mode 100644 index 00000000000..2dee99ce1f3 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/commands.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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.command_modules.lbs._client_factory import cf_accounts + + +def load_command_table(self, _): + mgmt_type = CliCommandType( + operations_tmpl='azure.mgmt.locationbasedservices.operations.accounts_operations#AccountsOperations.{}', + client_factory=cf_accounts) + + with self.command_group('lbs account', mgmt_type) as g: + g.command('show', 'get') + g.custom_command('list', 'list_accounts') + g.custom_command('create', 'create') + g.command('delete', 'delete') + + with self.command_group('lbs account key', mgmt_type) as g: + g.command('regenerate', 'regenerate_keys') + g.command('list', 'list_keys') diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/custom.py b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/custom.py new file mode 100644 index 00000000000..aec2e349556 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/custom.py @@ -0,0 +1,62 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.mgmt.locationbasedservices.models import LocationBasedServicesAccountCreateParameters, Sku + + +# pylint: disable=line-too-long +def create(client, resource_group_name, account_name, sku_name='S0', tags=None, custom_headers=None, + raw=False): + """Create a Location Based Services Account. A Location Based + Services Account holds the keys which allow access to the Location + Based Services REST APIs. + + :param resource_group_name: The name of the Azure Resource Group. + :type resource_group_name: str + :param account_name: The name of the Location Based Services Account. + :type account_name: str + :param sku_name: The name of the SKU, in standard format (such as S0). + :type sku_name: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: LocationBasedServicesAccount or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.locationbasedservices.models.LocationBasedServicesAccount + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + + sku = Sku(sku_name) + lbs_account_create_params = LocationBasedServicesAccountCreateParameters('global', sku, tags) + return client.create_or_update(resource_group_name, account_name, lbs_account_create_params, custom_headers, raw) + + +def list_accounts(client, resource_group_name=None, custom_headers=None, raw=False): + """Get all Location Based Services Accounts in a Resource Group OR in a Subscription. + + :param resource_group_name: The name of the Azure Resource Group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LocationBasedServicesAccount + :rtype: + ~azure.mgmt.locationbasedservices.models.LocationBasedServicesAccountPaged[~azure.mgmt.locationbasedservices.models.LocationBasedServicesAccount] + :raises: + :class:`ErrorException` + """ + if resource_group_name is None: + return client.list_by_subscription(custom_headers, raw) + return client.list_by_resource_group(resource_group_name, custom_headers, raw) diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/__init__.py b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/__init__.py new file mode 100644 index 00000000000..73baee1e640 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/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-lbs/azure/cli/command_modules/lbs/tests/latest/__init__.py b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/__init__.py new file mode 100644 index 00000000000..73baee1e640 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/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-lbs/azure/cli/command_modules/lbs/validators.py b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/validators.py new file mode 100644 index 00000000000..b856452c4f5 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/validators.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# 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 knack.util import CLIError + +ACCOUNT_NAME_MIN_LENGTH = 2 +ACCOUNT_NAME_MAX_LENGTH = 64 +ACCOUNT_NAME_REGEX = re.compile("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$") + + +def validate_account_name(namespace): + """ Validates account name.""" + account_name = namespace.account_name + char_len = len(account_name) + + if not ACCOUNT_NAME_MIN_LENGTH <= char_len <= ACCOUNT_NAME_MAX_LENGTH: + raise CLIError("Input account-name is invalid. Account name character length must be between 2 and 64.") + if not re.match(ACCOUNT_NAME_REGEX, account_name): + raise CLIError("Input account-name is invalid. Allowed regex: " + ACCOUNT_NAME_REGEX.pattern + + "\nFirst character must be alphanumeric." + + "\nSubsequent character(s) must be any combination of alphanumeric, underscore (_), " + + "period (.), or hyphen (-).") diff --git a/src/command_modules/azure-cli-lbs/azure_bdist_wheel.py b/src/command_modules/azure-cli-lbs/azure_bdist_wheel.py new file mode 100644 index 00000000000..3ffa5ea50a9 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/azure_bdist_wheel.py @@ -0,0 +1,533 @@ +""" +"wheel" copyright (c) 2012-2017 Daniel Holth and +contributors. + +The MIT License + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Create a Azure wheel (.whl) distribution (a wheel is a built archive format). + +This file is a copy of the official bdist_wheel file from wheel 0.30.0a0, enhanced +of the bottom with some Microsoft extension for Azure SDK for Python + +""" + +import csv +import hashlib +import os +import subprocess +import warnings +import shutil +import json +import sys + +try: + import sysconfig +except ImportError: # pragma nocover + # Python < 2.7 + import distutils.sysconfig as sysconfig + +import pkg_resources + +safe_name = pkg_resources.safe_name +safe_version = pkg_resources.safe_version + +from shutil import rmtree +from email.generator import Generator + +from distutils.core import Command +from distutils.sysconfig import get_python_version + +from distutils import log as logger + +from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag, get_platform +from wheel.util import native, open_for_csv +from wheel.archive import archive_wheelfile +from wheel.pkginfo import read_pkg_info, write_pkg_info +from wheel.metadata import pkginfo_to_dict +from wheel import pep425tags, metadata +from wheel import __version__ as wheel_version + +def safer_name(name): + return safe_name(name).replace('-', '_') + +def safer_version(version): + return safe_version(version).replace('-', '_') + +class bdist_wheel(Command): + + description = 'create a wheel distribution' + + user_options = [('bdist-dir=', 'b', + "temporary directory for creating the distribution"), + ('plat-name=', 'p', + "platform name to embed in generated filenames " + "(default: %s)" % get_platform()), + ('keep-temp', 'k', + "keep the pseudo-installation tree around after " + + "creating the distribution archive"), + ('dist-dir=', 'd', + "directory to put final built distributions in"), + ('skip-build', None, + "skip rebuilding everything (for testing/debugging)"), + ('relative', None, + "build the archive using relative paths" + "(default: false)"), + ('owner=', 'u', + "Owner name used when creating a tar file" + " [default: current user]"), + ('group=', 'g', + "Group name used when creating a tar file" + " [default: current group]"), + ('universal', None, + "make a universal wheel" + " (default: false)"), + ('python-tag=', None, + "Python implementation compatibility tag" + " (default: py%s)" % get_impl_ver()[0]), + ] + + boolean_options = ['keep-temp', 'skip-build', 'relative', 'universal'] + + def initialize_options(self): + self.bdist_dir = None + self.data_dir = None + self.plat_name = None + self.plat_tag = None + self.format = 'zip' + self.keep_temp = False + self.dist_dir = None + self.distinfo_dir = None + self.egginfo_dir = None + self.root_is_pure = None + self.skip_build = None + self.relative = False + self.owner = None + self.group = None + self.universal = False + self.python_tag = 'py' + get_impl_ver()[0] + self.plat_name_supplied = False + + def finalize_options(self): + if self.bdist_dir is None: + bdist_base = self.get_finalized_command('bdist').bdist_base + self.bdist_dir = os.path.join(bdist_base, 'wheel') + + self.data_dir = self.wheel_dist_name + '.data' + self.plat_name_supplied = self.plat_name is not None + + need_options = ('dist_dir', 'plat_name', 'skip_build') + + self.set_undefined_options('bdist', + *zip(need_options, need_options)) + + self.root_is_pure = not (self.distribution.has_ext_modules() + or self.distribution.has_c_libraries()) + + # Support legacy [wheel] section for setting universal + wheel = self.distribution.get_option_dict('wheel') + if 'universal' in wheel: + # please don't define this in your global configs + val = wheel['universal'][1].strip() + if val.lower() in ('1', 'true', 'yes'): + self.universal = True + + @property + def wheel_dist_name(self): + """Return distribution full name with - replaced with _""" + return '-'.join((safer_name(self.distribution.get_name()), + safer_version(self.distribution.get_version()))) + + def get_tag(self): + # bdist sets self.plat_name if unset, we should only use it for purepy + # wheels if the user supplied it. + if self.plat_name_supplied: + plat_name = self.plat_name + elif self.root_is_pure: + plat_name = 'any' + else: + plat_name = self.plat_name or get_platform() + if plat_name in ('linux-x86_64', 'linux_x86_64') and sys.maxsize == 2147483647: + plat_name = 'linux_i686' + plat_name = plat_name.replace('-', '_').replace('.', '_') + + + if self.root_is_pure: + if self.universal: + impl = 'py2.py3' + else: + impl = self.python_tag + tag = (impl, 'none', plat_name) + else: + impl_name = get_abbr_impl() + impl_ver = get_impl_ver() + # PEP 3149 + abi_tag = str(get_abi_tag()).lower() + tag = (impl_name + impl_ver, abi_tag, plat_name) + supported_tags = pep425tags.get_supported( + supplied_platform=plat_name if self.plat_name_supplied else None) + # XXX switch to this alternate implementation for non-pure: + assert tag == supported_tags[0], "%s != %s" % (tag, supported_tags[0]) + return tag + + def get_archive_basename(self): + """Return archive name without extension""" + + impl_tag, abi_tag, plat_tag = self.get_tag() + + archive_basename = "%s-%s-%s-%s" % ( + self.wheel_dist_name, + impl_tag, + abi_tag, + plat_tag) + return archive_basename + + def run(self): + build_scripts = self.reinitialize_command('build_scripts') + build_scripts.executable = 'python' + + if not self.skip_build: + self.run_command('build') + + install = self.reinitialize_command('install', + reinit_subcommands=True) + install.root = self.bdist_dir + install.compile = False + install.skip_build = self.skip_build + install.warn_dir = False + + # A wheel without setuptools scripts is more cross-platform. + # Use the (undocumented) `no_ep` option to setuptools' + # install_scripts command to avoid creating entry point scripts. + install_scripts = self.reinitialize_command('install_scripts') + install_scripts.no_ep = True + + # Use a custom scheme for the archive, because we have to decide + # at installation time which scheme to use. + for key in ('headers', 'scripts', 'data', 'purelib', 'platlib'): + setattr(install, + 'install_' + key, + os.path.join(self.data_dir, key)) + + basedir_observed = '' + + if os.name == 'nt': + # win32 barfs if any of these are ''; could be '.'? + # (distutils.command.install:change_roots bug) + basedir_observed = os.path.normpath(os.path.join(self.data_dir, '..')) + self.install_libbase = self.install_lib = basedir_observed + + setattr(install, + 'install_purelib' if self.root_is_pure else 'install_platlib', + basedir_observed) + + logger.info("installing to %s", self.bdist_dir) + + self.run_command('install') + + archive_basename = self.get_archive_basename() + + pseudoinstall_root = os.path.join(self.dist_dir, archive_basename) + if not self.relative: + archive_root = self.bdist_dir + else: + archive_root = os.path.join( + self.bdist_dir, + self._ensure_relative(install.install_base)) + + self.set_undefined_options( + 'install_egg_info', ('target', 'egginfo_dir')) + self.distinfo_dir = os.path.join(self.bdist_dir, + '%s.dist-info' % self.wheel_dist_name) + self.egg2dist(self.egginfo_dir, + self.distinfo_dir) + + self.write_wheelfile(self.distinfo_dir) + + self.write_record(self.bdist_dir, self.distinfo_dir) + + # Make the archive + if not os.path.exists(self.dist_dir): + os.makedirs(self.dist_dir) + wheel_name = archive_wheelfile(pseudoinstall_root, archive_root) + + # Sign the archive + if 'WHEEL_TOOL' in os.environ: + subprocess.call([os.environ['WHEEL_TOOL'], 'sign', wheel_name]) + + # Add to 'Distribution.dist_files' so that the "upload" command works + getattr(self.distribution, 'dist_files', []).append( + ('bdist_wheel', get_python_version(), wheel_name)) + + if not self.keep_temp: + if self.dry_run: + logger.info('removing %s', self.bdist_dir) + else: + rmtree(self.bdist_dir) + + def write_wheelfile(self, wheelfile_base, generator='bdist_wheel (' + wheel_version + ')'): + from email.message import Message + msg = Message() + msg['Wheel-Version'] = '1.0' # of the spec + msg['Generator'] = generator + msg['Root-Is-Purelib'] = str(self.root_is_pure).lower() + + # Doesn't work for bdist_wininst + impl_tag, abi_tag, plat_tag = self.get_tag() + for impl in impl_tag.split('.'): + for abi in abi_tag.split('.'): + for plat in plat_tag.split('.'): + msg['Tag'] = '-'.join((impl, abi, plat)) + + wheelfile_path = os.path.join(wheelfile_base, 'WHEEL') + logger.info('creating %s', wheelfile_path) + with open(wheelfile_path, 'w') as f: + Generator(f, maxheaderlen=0).flatten(msg) + + def _ensure_relative(self, path): + # copied from dir_util, deleted + drive, path = os.path.splitdrive(path) + if path[0:1] == os.sep: + path = drive + path[1:] + return path + + def _pkginfo_to_metadata(self, egg_info_path, pkginfo_path): + return metadata.pkginfo_to_metadata(egg_info_path, pkginfo_path) + + def license_file(self): + """Return license filename from a license-file key in setup.cfg, or None.""" + metadata = self.distribution.get_option_dict('metadata') + if not 'license_file' in metadata: + return None + return metadata['license_file'][1] + + def setupcfg_requirements(self): + """Generate requirements from setup.cfg as + ('Requires-Dist', 'requirement; qualifier') tuples. From a metadata + section in setup.cfg: + + [metadata] + provides-extra = extra1 + extra2 + requires-dist = requirement; qualifier + another; qualifier2 + unqualified + + Yields + + ('Provides-Extra', 'extra1'), + ('Provides-Extra', 'extra2'), + ('Requires-Dist', 'requirement; qualifier'), + ('Requires-Dist', 'another; qualifier2'), + ('Requires-Dist', 'unqualified') + """ + metadata = self.distribution.get_option_dict('metadata') + + # our .ini parser folds - to _ in key names: + for key, title in (('provides_extra', 'Provides-Extra'), + ('requires_dist', 'Requires-Dist')): + if not key in metadata: + continue + field = metadata[key] + for line in field[1].splitlines(): + line = line.strip() + if not line: + continue + yield (title, line) + + def add_requirements(self, metadata_path): + """Add additional requirements from setup.cfg to file metadata_path""" + additional = list(self.setupcfg_requirements()) + if not additional: return + pkg_info = read_pkg_info(metadata_path) + if 'Provides-Extra' in pkg_info or 'Requires-Dist' in pkg_info: + warnings.warn('setup.cfg requirements overwrite values from setup.py') + del pkg_info['Provides-Extra'] + del pkg_info['Requires-Dist'] + for k, v in additional: + pkg_info[k] = v + write_pkg_info(metadata_path, pkg_info) + + def egg2dist(self, egginfo_path, distinfo_path): + """Convert an .egg-info directory into a .dist-info directory""" + def adios(p): + """Appropriately delete directory, file or link.""" + if os.path.exists(p) and not os.path.islink(p) and os.path.isdir(p): + shutil.rmtree(p) + elif os.path.exists(p): + os.unlink(p) + + adios(distinfo_path) + + if not os.path.exists(egginfo_path): + # There is no egg-info. This is probably because the egg-info + # file/directory is not named matching the distribution name used + # to name the archive file. Check for this case and report + # accordingly. + import glob + pat = os.path.join(os.path.dirname(egginfo_path), '*.egg-info') + possible = glob.glob(pat) + err = "Egg metadata expected at %s but not found" % (egginfo_path,) + if possible: + alt = os.path.basename(possible[0]) + err += " (%s found - possible misnamed archive file?)" % (alt,) + + raise ValueError(err) + + if os.path.isfile(egginfo_path): + # .egg-info is a single file + pkginfo_path = egginfo_path + pkg_info = self._pkginfo_to_metadata(egginfo_path, egginfo_path) + os.mkdir(distinfo_path) + else: + # .egg-info is a directory + pkginfo_path = os.path.join(egginfo_path, 'PKG-INFO') + pkg_info = self._pkginfo_to_metadata(egginfo_path, pkginfo_path) + + # ignore common egg metadata that is useless to wheel + shutil.copytree(egginfo_path, distinfo_path, + ignore=lambda x, y: set(('PKG-INFO', + 'requires.txt', + 'SOURCES.txt', + 'not-zip-safe',))) + + # delete dependency_links if it is only whitespace + dependency_links_path = os.path.join(distinfo_path, 'dependency_links.txt') + with open(dependency_links_path, 'r') as dependency_links_file: + dependency_links = dependency_links_file.read().strip() + if not dependency_links: + adios(dependency_links_path) + + write_pkg_info(os.path.join(distinfo_path, 'METADATA'), pkg_info) + + # XXX deprecated. Still useful for current distribute/setuptools. + metadata_path = os.path.join(distinfo_path, 'METADATA') + self.add_requirements(metadata_path) + + # XXX intentionally a different path than the PEP. + metadata_json_path = os.path.join(distinfo_path, 'metadata.json') + pymeta = pkginfo_to_dict(metadata_path, + distribution=self.distribution) + + if 'description' in pymeta: + description_filename = 'DESCRIPTION.rst' + description_text = pymeta.pop('description') + description_path = os.path.join(distinfo_path, + description_filename) + with open(description_path, "wb") as description_file: + description_file.write(description_text.encode('utf-8')) + pymeta['extensions']['python.details']['document_names']['description'] = description_filename + + # XXX heuristically copy any LICENSE/LICENSE.txt? + license = self.license_file() + if license: + license_filename = 'LICENSE.txt' + shutil.copy(license, os.path.join(self.distinfo_dir, license_filename)) + pymeta['extensions']['python.details']['document_names']['license'] = license_filename + + with open(metadata_json_path, "w") as metadata_json: + json.dump(pymeta, metadata_json, sort_keys=True) + + adios(egginfo_path) + + def write_record(self, bdist_dir, distinfo_dir): + from wheel.util import urlsafe_b64encode + + record_path = os.path.join(distinfo_dir, 'RECORD') + record_relpath = os.path.relpath(record_path, bdist_dir) + + def walk(): + for dir, dirs, files in os.walk(bdist_dir): + dirs.sort() + for f in sorted(files): + yield os.path.join(dir, f) + + def skip(path): + """Wheel hashes every possible file.""" + return (path == record_relpath) + + with open_for_csv(record_path, 'w+') as record_file: + writer = csv.writer(record_file) + for path in walk(): + relpath = os.path.relpath(path, bdist_dir) + if skip(relpath): + hash = '' + size = '' + else: + with open(path, 'rb') as f: + data = f.read() + digest = hashlib.sha256(data).digest() + hash = 'sha256=' + native(urlsafe_b64encode(digest)) + size = len(data) + record_path = os.path.relpath( + path, bdist_dir).replace(os.path.sep, '/') + writer.writerow((record_path, hash, size)) + + +#------------------------------------------------------------------------- +# 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): + + 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.replace('_', '-'))) + 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-lbs/setup.cfg b/src/command_modules/azure-cli-lbs/setup.cfg new file mode 100644 index 00000000000..3326c62a76e --- /dev/null +++ b/src/command_modules/azure-cli-lbs/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-lbs/setup.py b/src/command_modules/azure-cli-lbs/setup.py new file mode 100644 index 00000000000..f0a8cc73c16 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/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-locationbasedservices==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-lbs', + version=VERSION, + description='Microsoft Azure Command-Line Tools Location Based Services 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.lbs' + ], + install_requires=DEPENDENCIES, + cmdclass=cmdclass +) From 8bbcd511252ce84d0182dae9ab5c438b65a58c30 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Fri, 23 Feb 2018 15:13:13 -0800 Subject: [PATCH 02/28] Introduce test cases for LocationBasedServices command_module --- .../lbs/tests/latest/test_lbs_commands.py | 118 ++++++++++++++++++ .../lbs/tests/latest/test_lbs_validators.py | 46 +++++++ 2 files changed, 164 insertions(+) create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/test_lbs_commands.py create mode 100644 src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/test_lbs_validators.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/test_lbs_commands.py new file mode 100644 index 00000000000..3587024fa67 --- /dev/null +++ b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/test_lbs_commands.py @@ -0,0 +1,118 @@ +# -------------------------------------------------------------------------------------------- +# 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 +from azure.mgmt.locationbasedservices.models.client_enums import KeyType + + +class LocationBasedServicesScenarioTests(ScenarioTest): + + @ResourceGroupPreparer() + def test_create_lbs_account(self, resource_group): + self.kwargs.update({ + 'name': self.create_random_name(prefix='cli-lbs', length=20), + 'name1': self.create_random_name(prefix='cli-lbs', length=20), + 'name2': self.create_random_name(prefix='cli-lbs', length=20), + 'sku': 'S0', + 'loc': 'global', + 'key_type_primary': KeyType.primary.value, + 'key_type_secondary': KeyType.secondary.value + }) + + # Test 'az lbs account create' + # Test to create an LocationBasedServices account + account = self.cmd('az lbs account create -n {name} -g {rg} --sku {sku} -l {loc}', checks=[ + self.check('location', '{loc}'), + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('sku.name', '{sku}') + ]).get_output_in_json() + + # Call create again, expect to get the same account + account_duplicated = self.cmd( + 'az lbs account create -n {name} -g {rg} --sku {sku} -l {loc}').get_output_in_json() + self.assertEqual(account, account_duplicated) + + # Test 'az lbs account show' + # Test to get information on LocationBasedServices account + self.cmd('az lbs account show -n {name} -g {rg}', checks=[ + self.check('id', account['id']), + self.check('location', '{loc}'), + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('sku.name', '{sku}') + ]) + + # Test 'az lbs account list' + # Test to list all LocationBasedServices accounts under a resource group + self.cmd('az lbs account list -g {rg}', checks=[ + self.check('length(@)', 1), + self.check('type(@)', 'array'), + self.check('[0].id', account['id']), + self.check('[0].location', '{loc}'), + self.check('[0].name', '{name}'), + self.check('[0].resourceGroup', '{rg}'), + self.check('[0].sku.name', '{sku}'), + self.check('[0].tags', None) + ]) + + # Create two new accounts + self.cmd('az lbs account create -n {name1} -g {rg} --sku {sku} -l {loc}') + self.cmd('az lbs account create -n {name2} -g {rg} --sku {sku} -l {loc}') + # Check that list command now shows three accounts. + self.cmd('az lbs account list -g {rg}', checks=[ + self.check('length(@)', 3), + self.check('type(@)', 'array'), + self.check("length([?name == '{name}'])", 1), + self.check("length([?name == '{name1}'])", 1), + self.check("length([?name == '{name2}'])", 1), + self.check("length([?resourceGroup == '{rg}'])", 3) + ]) + + # Test 'az lbs account key list' + # Test to list keys for an LocationBasedServices account + account_key_list = self.cmd('az lbs account key 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.assertIsNotNone(primary_key_old) + self.assertIsNotNone(secondary_key_old) + + # Test 'az lbs account key regenerate' + # Test to change primary and secondary keys for an LocationBasedServices account + key_regenerated = self.cmd('az lbs account key regenerate -n {name} -g {rg} -t {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 lbs account key regenerate -n {name} -g {rg} -t {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 lbs account delete' + # Test to remove an LocationBasedServices account + self.cmd('az lbs account delete -n {name} -g {rg}', checks=self.is_empty()) + self.cmd('az lbs account show -n {name} -g {rg}', checks=self.is_empty()) + self.cmd('az lbs account list -g {rg}', checks=[ + self.check('length(@)', 2), + self.check("length([?name == '{name}'])", 0) + ]) + + # Remove the rest of LocationBasedServices accounts + exit_code = self.cmd('az lbs account delete -n {name1} -g {rg}').exit_code + self.assertEqual(exit_code, 0) + self.cmd('az lbs account delete -n {name2} -g {rg}') + self.cmd('az lbs account list -g {rg}', checks=self.is_empty()) diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/test_lbs_validators.py b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/test_lbs_validators.py new file mode 100644 index 00000000000..ae1c79f1b1c --- /dev/null +++ b/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/test_lbs_validators.py @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import unittest + +from argparse import Namespace +from knack.util import CLIError +from azure.cli.command_modules.lbs.validators import validate_account_name, ACCOUNT_NAME_MAX_LENGTH + + +class TestValidators(unittest.TestCase): + def setUp(self): + self.namespace = Namespace() + + def _assert_invalid_account_names(self, invalid_names): + for invalid_name in invalid_names: + self.namespace.account_name = invalid_name + self.assertRaises(CLIError, lambda: validate_account_name(self.namespace)) + + def _assert_valid_account_names(self, valid_names): + for valid_name in valid_names: + self.namespace.account_name = valid_name + try: + validate_account_name(self.namespace) + except CLIError: + self.fail("validate_account_name() raised CLIError unexpectedly!") + + def test_validate_account_name_length(self): + invalid_names = ["", "a", "a" * (ACCOUNT_NAME_MAX_LENGTH + 1)] + valid_names = ["Valid-Account-Name", "aa", "a" * ACCOUNT_NAME_MAX_LENGTH] + + self._assert_invalid_account_names(invalid_names) + self._assert_valid_account_names(valid_names) + + def test_validate_account_name_regex(self): + invalid_names = ["_A", "úñícódé", "ΞΞ", "resumé", "American cheese"] + valid_names = ["Bergenost", "Cheddar_cheese", "Colby-Jack", "Cottage.cheese", "Cr34MCh3353", "montereyjack"] + + self._assert_invalid_account_names(invalid_names) + self._assert_valid_account_names(valid_names) + + +if __name__ == '__main__': + unittest.main() From 18d9384dcb78cb55e6bcd9919ab000b0b8ebdeec Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Fri, 23 Feb 2018 16:15:16 -0800 Subject: [PATCH 03/28] [Refactor] Renamed lbs to locationbasedservices --- .../HISTORY.rst | 0 .../MANIFEST.in | 0 .../README.rst | 2 +- .../__init__.py | 0 .../azure/__init__.py | 0 .../azure/cli/__init__.py | 0 .../azure/cli/command_modules/__init__.py | 0 .../cli/command_modules/locationbasedservices}/__init__.py | 0 .../command_modules/locationbasedservices}/_client_factory.py | 0 .../azure/cli/command_modules/locationbasedservices}/_help.py | 0 .../cli/command_modules/locationbasedservices}/_params.py | 0 .../cli/command_modules/locationbasedservices}/commands.py | 0 .../cli/command_modules/locationbasedservices}/custom.py | 0 .../command_modules/locationbasedservices}/tests/__init__.py | 0 .../locationbasedservices}/tests/latest/__init__.py | 0 .../locationbasedservices}/tests/latest/test_lbs_commands.py | 0 .../tests/latest/test_lbs_validators.py | 0 .../cli/command_modules/locationbasedservices}/validators.py | 0 .../azure_bdist_wheel.py | 0 .../setup.cfg | 0 .../setup.py | 4 ++-- 21 files changed, 3 insertions(+), 3 deletions(-) rename src/command_modules/{azure-cli-lbs => azure-cli-locationbasedservices}/HISTORY.rst (100%) rename src/command_modules/{azure-cli-lbs => azure-cli-locationbasedservices}/MANIFEST.in (100%) rename src/command_modules/{azure-cli-lbs => azure-cli-locationbasedservices}/README.rst (84%) rename src/command_modules/{azure-cli-lbs => azure-cli-locationbasedservices}/__init__.py (100%) rename src/command_modules/{azure-cli-lbs => azure-cli-locationbasedservices}/azure/__init__.py (100%) rename src/command_modules/{azure-cli-lbs => azure-cli-locationbasedservices}/azure/cli/__init__.py (100%) rename src/command_modules/{azure-cli-lbs => azure-cli-locationbasedservices}/azure/cli/command_modules/__init__.py (100%) rename src/command_modules/{azure-cli-lbs/azure/cli/command_modules/lbs => azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices}/__init__.py (100%) rename src/command_modules/{azure-cli-lbs/azure/cli/command_modules/lbs => azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices}/_client_factory.py (100%) rename src/command_modules/{azure-cli-lbs/azure/cli/command_modules/lbs => azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices}/_help.py (100%) rename src/command_modules/{azure-cli-lbs/azure/cli/command_modules/lbs => azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices}/_params.py (100%) rename src/command_modules/{azure-cli-lbs/azure/cli/command_modules/lbs => azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices}/commands.py (100%) rename src/command_modules/{azure-cli-lbs/azure/cli/command_modules/lbs => azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices}/custom.py (100%) rename src/command_modules/{azure-cli-lbs/azure/cli/command_modules/lbs => azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices}/tests/__init__.py (100%) rename src/command_modules/{azure-cli-lbs/azure/cli/command_modules/lbs => azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices}/tests/latest/__init__.py (100%) rename src/command_modules/{azure-cli-lbs/azure/cli/command_modules/lbs => azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices}/tests/latest/test_lbs_commands.py (100%) rename src/command_modules/{azure-cli-lbs/azure/cli/command_modules/lbs => azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices}/tests/latest/test_lbs_validators.py (100%) rename src/command_modules/{azure-cli-lbs/azure/cli/command_modules/lbs => azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices}/validators.py (100%) rename src/command_modules/{azure-cli-lbs => azure-cli-locationbasedservices}/azure_bdist_wheel.py (100%) rename src/command_modules/{azure-cli-lbs => azure-cli-locationbasedservices}/setup.cfg (100%) rename src/command_modules/{azure-cli-lbs => azure-cli-locationbasedservices}/setup.py (94%) diff --git a/src/command_modules/azure-cli-lbs/HISTORY.rst b/src/command_modules/azure-cli-locationbasedservices/HISTORY.rst similarity index 100% rename from src/command_modules/azure-cli-lbs/HISTORY.rst rename to src/command_modules/azure-cli-locationbasedservices/HISTORY.rst diff --git a/src/command_modules/azure-cli-lbs/MANIFEST.in b/src/command_modules/azure-cli-locationbasedservices/MANIFEST.in similarity index 100% rename from src/command_modules/azure-cli-lbs/MANIFEST.in rename to src/command_modules/azure-cli-locationbasedservices/MANIFEST.in diff --git a/src/command_modules/azure-cli-lbs/README.rst b/src/command_modules/azure-cli-locationbasedservices/README.rst similarity index 84% rename from src/command_modules/azure-cli-lbs/README.rst rename to src/command_modules/azure-cli-locationbasedservices/README.rst index 1f07fc6577a..d8a4975cf63 100644 --- a/src/command_modules/azure-cli-lbs/README.rst +++ b/src/command_modules/azure-cli-locationbasedservices/README.rst @@ -2,6 +2,6 @@ Microsoft Azure CLI 'location based services' Command Module ==================================================== This package is for the 'location based services' module. -i.e. 'az lbs' +i.e. 'az locationbasedservices' diff --git a/src/command_modules/azure-cli-lbs/__init__.py b/src/command_modules/azure-cli-locationbasedservices/__init__.py similarity index 100% rename from src/command_modules/azure-cli-lbs/__init__.py rename to src/command_modules/azure-cli-locationbasedservices/__init__.py diff --git a/src/command_modules/azure-cli-lbs/azure/__init__.py b/src/command_modules/azure-cli-locationbasedservices/azure/__init__.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/__init__.py rename to src/command_modules/azure-cli-locationbasedservices/azure/__init__.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/__init__.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/__init__.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/__init__.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/__init__.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/__init__.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/__init__.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/command_modules/__init__.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/__init__.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/__init__.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/__init__.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/__init__.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/__init__.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_client_factory.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_client_factory.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_help.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_help.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_params.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/_params.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/commands.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/custom.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/custom.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/__init__.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/__init__.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/__init__.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/__init__.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/__init__.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/__init__.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/__init__.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/__init__.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/test_lbs_commands.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/test_lbs_validators.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_validators.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/tests/latest/test_lbs_validators.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_validators.py diff --git a/src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/validators.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/validators.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure/cli/command_modules/lbs/validators.py rename to src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/validators.py diff --git a/src/command_modules/azure-cli-lbs/azure_bdist_wheel.py b/src/command_modules/azure-cli-locationbasedservices/azure_bdist_wheel.py similarity index 100% rename from src/command_modules/azure-cli-lbs/azure_bdist_wheel.py rename to src/command_modules/azure-cli-locationbasedservices/azure_bdist_wheel.py diff --git a/src/command_modules/azure-cli-lbs/setup.cfg b/src/command_modules/azure-cli-locationbasedservices/setup.cfg similarity index 100% rename from src/command_modules/azure-cli-lbs/setup.cfg rename to src/command_modules/azure-cli-locationbasedservices/setup.cfg diff --git a/src/command_modules/azure-cli-lbs/setup.py b/src/command_modules/azure-cli-locationbasedservices/setup.py similarity index 94% rename from src/command_modules/azure-cli-lbs/setup.py rename to src/command_modules/azure-cli-locationbasedservices/setup.py index f0a8cc73c16..5a8a3a89f39 100644 --- a/src/command_modules/azure-cli-lbs/setup.py +++ b/src/command_modules/azure-cli-locationbasedservices/setup.py @@ -41,7 +41,7 @@ HISTORY = f.read() setup( - name='azure-cli-lbs', + name='azure-cli-locationbasedservices', version=VERSION, description='Microsoft Azure Command-Line Tools Location Based Services Command Module', long_description=README + '\n\n' + HISTORY, @@ -54,7 +54,7 @@ 'azure', 'azure.cli', 'azure.cli.command_modules', - 'azure.cli.command_modules.lbs' + 'azure.cli.command_modules.locationbasedservices' ], install_requires=DEPENDENCIES, cmdclass=cmdclass From cb738dbdcee12ddc7f7f54decbc203df95692798 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Fri, 23 Feb 2018 16:16:36 -0800 Subject: [PATCH 04/28] [Refactor] Renamed lbs to locationbasedservices --- .../locationbasedservices/__init__.py | 10 ++-- .../locationbasedservices/_client_factory.py | 4 +- .../locationbasedservices/_help.py | 18 +++--- .../locationbasedservices/_params.py | 20 +++---- .../locationbasedservices/commands.py | 6 +- .../tests/latest/test_lbs_commands.py | 59 ++++++++++--------- .../tests/latest/test_lbs_validators.py | 2 +- 7 files changed, 60 insertions(+), 59 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/__init__.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/__init__.py index 18bdef16ec6..2b6b4d45e28 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/__init__.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/__init__.py @@ -5,8 +5,8 @@ from azure.cli.core import AzCommandsLoader -import azure.cli.command_modules.lbs._help # pylint: disable=unused-import -from azure.cli.command_modules.lbs._client_factory import cf_accounts +import azure.cli.command_modules.locationbasedservices._help # pylint: disable=unused-import +from azure.cli.command_modules.locationbasedservices._client_factory import cf_accounts class LocationBasedServicesCommandsLoader(AzCommandsLoader): @@ -14,18 +14,18 @@ class LocationBasedServicesCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType custom_type = CliCommandType( - operations_tmpl='azure.cli.command_modules.lbs.custom#{}', + operations_tmpl='azure.cli.command_modules.locationbasedservices.custom#{}', client_factory=cf_accounts) super(LocationBasedServicesCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=custom_type) def load_command_table(self, args): - from azure.cli.command_modules.lbs.commands import load_command_table + from azure.cli.command_modules.locationbasedservices.commands import load_command_table load_command_table(self, args) return self.command_table def load_arguments(self, command): - from azure.cli.command_modules.lbs._params import load_arguments + from azure.cli.command_modules.locationbasedservices._params import load_arguments load_arguments(self, command) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py index e803ddb6a8f..062d719b90a 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py @@ -4,11 +4,11 @@ # -------------------------------------------------------------------------------------------- -def cf_lbs(cli_ctx, *_): +def cf_locationbasedservices(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.mgmt.locationbasedservices import Client return get_mgmt_service_client(cli_ctx, Client) def cf_accounts(cli_ctx, *_): - return cf_lbs(cli_ctx).accounts + return cf_locationbasedservices(cli_ctx).accounts diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py index a3452a482af..8618afd2d7a 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py @@ -5,51 +5,51 @@ from knack.help_files import helps -helps['lbs'] = """ +helps['locationbasedservices'] = """ type: group short-summary: Manage Azure Location Based Services accounts. """ -helps['lbs account'] = """ +helps['locationbasedservices account'] = """ type: group short-summary: Commands to manage Azure Location Based Services accounts. """ -helps['lbs account key'] = """ +helps['locationbasedservices account key'] = """ type: group short-summary: Commands to manage Azure Location Based Services account keys. """ -helps['lbs account show'] = """ +helps['locationbasedservices account show'] = """ type: command short-summary: Show a Location Based Services account. """ -helps['lbs account list'] = """ +helps['locationbasedservices account list'] = """ type: command short-summary: Show all Location Based Services accounts in a Subscription or in a Resource Group. """ -helps['lbs account create'] = """ +helps['locationbasedservices account create'] = """ type: command short-summary: Create a Location Based Services account. long-summary: | Create a Location Based Services account. A Location Based Services account holds the keys which allow access to the Location Based Services REST APIs. """ -helps['lbs account delete'] = """ +helps['locationbasedservices account delete'] = """ type: command short-summary: Delete a Location Based Services account. """ -helps['lbs account key list'] = """ +helps['locationbasedservices account key list'] = """ type: command short-summary: List the keys to use with the Location Based Services APIs. long-summary: | List the keys to use with the Location Based Services APIs. A key is used to authenticate and authorize access to the Location Based Services REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. """ -helps['lbs account key regenerate'] = """ +helps['locationbasedservices account key regenerate'] = """ type: command short-summary: Regenerate either the primary or secondary key for use with the Location Based Services APIs. long-summary: | diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py index 53b2d787c77..a951c2d9905 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py @@ -11,27 +11,27 @@ resource_group_name_type, tags_type) -from azure.cli.command_modules.lbs.validators import validate_account_name +from azure.cli.command_modules.locationbasedservices.validators import validate_account_name from azure.mgmt.locationbasedservices.models.client_enums import KeyType def load_arguments(self, _): # Argument Definition - lbs_name_type = CLIArgumentType(options_list=['--account-name', '-n'], - completer=get_resource_name_completion_list( - 'Microsoft.LocationBasedServices/accounts'), - help='The name of the Location Based Services Account', - validator=validate_account_name) + locationbasedservices_name_type = CLIArgumentType(options_list=['--account-name', '-n'], + completer=get_resource_name_completion_list( + 'Microsoft.LocationBasedServices/accounts'), + help='The name of the Location Based Services Account', + validator=validate_account_name) # Parameter Registration - with self.argument_context('lbs') as c: + with self.argument_context('locationbasedservices') as c: c.argument('resource_group_name', arg_type=resource_group_name_type, help='Resource group name') c.argument('account_name', - arg_type=lbs_name_type) + arg_type=locationbasedservices_name_type) - with self.argument_context('lbs account create') as c: + with self.argument_context('locationbasedservices account create') as c: c.argument('sku_name', options_list=['--sku', '-s'], help='The name of the SKU, in standard format (such as S0).', @@ -40,7 +40,7 @@ def load_arguments(self, _): c.argument('tags', arg_type=tags_type) - with self.argument_context('lbs account key regenerate') as c: + with self.argument_context('locationbasedservices account key regenerate') as c: c.argument('key_type', options_list=['--type', '-t'], arg_type=get_enum_type(KeyType)) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py index 2dee99ce1f3..cee3e63301d 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType -from azure.cli.command_modules.lbs._client_factory import cf_accounts +from azure.cli.command_modules.locationbasedservices._client_factory import cf_accounts def load_command_table(self, _): @@ -12,12 +12,12 @@ def load_command_table(self, _): operations_tmpl='azure.mgmt.locationbasedservices.operations.accounts_operations#AccountsOperations.{}', client_factory=cf_accounts) - with self.command_group('lbs account', mgmt_type) as g: + with self.command_group('locationbasedservices account', mgmt_type) as g: g.command('show', 'get') g.custom_command('list', 'list_accounts') g.custom_command('create', 'create') g.command('delete', 'delete') - with self.command_group('lbs account key', mgmt_type) as g: + with self.command_group('locationbasedservices account key', mgmt_type) as g: g.command('regenerate', 'regenerate_keys') g.command('list', 'list_keys') diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py index 3587024fa67..de78de5dbfc 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py @@ -10,20 +10,20 @@ class LocationBasedServicesScenarioTests(ScenarioTest): @ResourceGroupPreparer() - def test_create_lbs_account(self, resource_group): + def test_create_locationbasedservices_account(self, resource_group): self.kwargs.update({ - 'name': self.create_random_name(prefix='cli-lbs', length=20), - 'name1': self.create_random_name(prefix='cli-lbs', length=20), - 'name2': self.create_random_name(prefix='cli-lbs', length=20), + 'name': self.create_random_name(prefix='cli-locationbasedservices', length=20), + 'name1': self.create_random_name(prefix='cli-locationbasedservices', length=20), + 'name2': self.create_random_name(prefix='cli-locationbasedservices', length=20), 'sku': 'S0', 'loc': 'global', 'key_type_primary': KeyType.primary.value, 'key_type_secondary': KeyType.secondary.value }) - # Test 'az lbs account create' + # Test 'az locationbasedservices account create' # Test to create an LocationBasedServices account - account = self.cmd('az lbs account create -n {name} -g {rg} --sku {sku} -l {loc}', checks=[ + account = self.cmd('az locationbasedservices account create -n {name} -g {rg} --sku {sku} -l {loc}', checks=[ self.check('location', '{loc}'), self.check('name', '{name}'), self.check('resourceGroup', '{rg}'), @@ -32,12 +32,12 @@ def test_create_lbs_account(self, resource_group): # Call create again, expect to get the same account account_duplicated = self.cmd( - 'az lbs account create -n {name} -g {rg} --sku {sku} -l {loc}').get_output_in_json() + 'az locationbasedservices account create -n {name} -g {rg} --sku {sku} -l {loc}').get_output_in_json() self.assertEqual(account, account_duplicated) - # Test 'az lbs account show' + # Test 'az locationbasedservices account show' # Test to get information on LocationBasedServices account - self.cmd('az lbs account show -n {name} -g {rg}', checks=[ + self.cmd('az locationbasedservices account show -n {name} -g {rg}', checks=[ self.check('id', account['id']), self.check('location', '{loc}'), self.check('name', '{name}'), @@ -45,9 +45,9 @@ def test_create_lbs_account(self, resource_group): self.check('sku.name', '{sku}') ]) - # Test 'az lbs account list' + # Test 'az locationbasedservices account list' # Test to list all LocationBasedServices accounts under a resource group - self.cmd('az lbs account list -g {rg}', checks=[ + self.cmd('az locationbasedservices account list -g {rg}', checks=[ self.check('length(@)', 1), self.check('type(@)', 'array'), self.check('[0].id', account['id']), @@ -59,10 +59,10 @@ def test_create_lbs_account(self, resource_group): ]) # Create two new accounts - self.cmd('az lbs account create -n {name1} -g {rg} --sku {sku} -l {loc}') - self.cmd('az lbs account create -n {name2} -g {rg} --sku {sku} -l {loc}') + self.cmd('az locationbasedservices account create -n {name1} -g {rg} --sku {sku} -l {loc}') + self.cmd('az locationbasedservices account create -n {name2} -g {rg} --sku {sku} -l {loc}') # Check that list command now shows three accounts. - self.cmd('az lbs account list -g {rg}', checks=[ + self.cmd('az locationbasedservices account list -g {rg}', checks=[ self.check('length(@)', 3), self.check('type(@)', 'array'), self.check("length([?name == '{name}'])", 1), @@ -71,9 +71,9 @@ def test_create_lbs_account(self, resource_group): self.check("length([?resourceGroup == '{rg}'])", 3) ]) - # Test 'az lbs account key list' + # Test 'az locationbasedservices account key list' # Test to list keys for an LocationBasedServices account - account_key_list = self.cmd('az lbs account key list -n {name} -g {rg}', checks=[ + account_key_list = self.cmd('az locationbasedservices account key list -n {name} -g {rg}', checks=[ self.check('id', account['id']), self.check('resourceGroup', '{rg}') ]).get_output_in_json() @@ -84,12 +84,13 @@ def test_create_lbs_account(self, resource_group): self.assertIsNotNone(primary_key_old) self.assertIsNotNone(secondary_key_old) - # Test 'az lbs account key regenerate' + # Test 'az locationbasedservices account key regenerate' # Test to change primary and secondary keys for an LocationBasedServices account - key_regenerated = self.cmd('az lbs account key regenerate -n {name} -g {rg} -t {key_type_primary}', checks=[ - self.check('id', account['id']), - self.check('resourceGroup', '{rg}') - ]).get_output_in_json() + key_regenerated = self.cmd( + 'az locationbasedservices account key regenerate -n {name} -g {rg} -t {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']) @@ -98,21 +99,21 @@ def test_create_lbs_account(self, resource_group): # Save the new primary key, and regenerate the secondary key. primary_key_old = key_regenerated['primaryKey'] key_regenerated = self.cmd( - 'az lbs account key regenerate -n {name} -g {rg} -t {key_type_secondary}').get_output_in_json() + 'az locationbasedservices account key regenerate -n {name} -g {rg} -t {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 lbs account delete' + # Test 'az locationbasedservices account delete' # Test to remove an LocationBasedServices account - self.cmd('az lbs account delete -n {name} -g {rg}', checks=self.is_empty()) - self.cmd('az lbs account show -n {name} -g {rg}', checks=self.is_empty()) - self.cmd('az lbs account list -g {rg}', checks=[ + self.cmd('az locationbasedservices account delete -n {name} -g {rg}', checks=self.is_empty()) + self.cmd('az locationbasedservices account show -n {name} -g {rg}', checks=self.is_empty()) + self.cmd('az locationbasedservices account list -g {rg}', checks=[ self.check('length(@)', 2), self.check("length([?name == '{name}'])", 0) ]) # Remove the rest of LocationBasedServices accounts - exit_code = self.cmd('az lbs account delete -n {name1} -g {rg}').exit_code + exit_code = self.cmd('az locationbasedservices account delete -n {name1} -g {rg}').exit_code self.assertEqual(exit_code, 0) - self.cmd('az lbs account delete -n {name2} -g {rg}') - self.cmd('az lbs account list -g {rg}', checks=self.is_empty()) + self.cmd('az locationbasedservices account delete -n {name2} -g {rg}') + self.cmd('az locationbasedservices account list -g {rg}', checks=self.is_empty()) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_validators.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_validators.py index ae1c79f1b1c..3ad45a052c0 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_validators.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_validators.py @@ -7,7 +7,7 @@ from argparse import Namespace from knack.util import CLIError -from azure.cli.command_modules.lbs.validators import validate_account_name, ACCOUNT_NAME_MAX_LENGTH +from azure.cli.command_modules.locationbasedservices.validators import validate_account_name, ACCOUNT_NAME_MAX_LENGTH class TestValidators(unittest.TestCase): From b74cb79aa6c72b4409941f6115af9ad854d7675b Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Fri, 23 Feb 2018 17:57:55 -0800 Subject: [PATCH 05/28] [Legal] Add the Preview Terms agreement requirement - Add the Preview Terms agreement requirement - Remove location, custom_header, and raw parameters for account operations. --- .../locationbasedservices/_params.py | 4 +++ .../locationbasedservices/custom.py | 33 +++++++++++++----- .../tests/latest/test_lbs_commands.py | 34 ++++++++++--------- 3 files changed, 46 insertions(+), 25 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py index a951c2d9905..7ca0b2aa5db 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py @@ -39,6 +39,10 @@ def load_arguments(self, _): required=False) c.argument('tags', arg_type=tags_type) + c.argument('agree', + options_list=['--agree-to-the-preview-terms'], + help='You agree to the Preview Terms. Ignore prompt for confirmation.', + action='store_true') with self.argument_context('locationbasedservices account key regenerate') as c: c.argument('key_type', diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py index aec2e349556..084a6b68385 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py @@ -3,12 +3,17 @@ # 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.locationbasedservices.models import LocationBasedServicesAccountCreateParameters, Sku +logger = get_logger(__name__) + # pylint: disable=line-too-long -def create(client, resource_group_name, account_name, sku_name='S0', tags=None, custom_headers=None, - raw=False): +def create(client, resource_group_name, account_name, sku_name='S0', tags=None, agree=None): """Create a Location Based Services Account. A Location Based Services Account holds the keys which allow access to the Location Based Services REST APIs. @@ -25,9 +30,9 @@ def create(client, resource_group_name, account_name, sku_name='S0', tags=None, resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response + :param agree: If true, user agrees to the Preview Terms. Ignore prompt + for confirmation. False otherwise. + :type agree: bool :return: LocationBasedServicesAccount or ClientRawResponse if raw=true :rtype: ~azure.mgmt.locationbasedservices.models.LocationBasedServicesAccount @@ -35,13 +40,23 @@ def create(client, resource_group_name, account_name, sku_name='S0', tags=None, :raises: :class:`ErrorException` """ + # Prompt for the Preview Terms agreement. + logger.warning( + 'By creating a Location Based Services account, you agree to the Microsoft Azure Preview Terms.' + + '\nThe Preview Terms can be found at: ' + + '\nhttps://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/') + if not agree: # ... in order to pass tests + response = prompt_y_n('I confirm that I have read and agree to the Microsoft Azure Preview Terms.') + if not response: + raise CLIError('You must agree to the Microsoft Azure Preview Terms to create an account.') + # Proceed if user has agreed to the Preview Terms. sku = Sku(sku_name) lbs_account_create_params = LocationBasedServicesAccountCreateParameters('global', sku, tags) - return client.create_or_update(resource_group_name, account_name, lbs_account_create_params, custom_headers, raw) + return client.create_or_update(resource_group_name, account_name, lbs_account_create_params) -def list_accounts(client, resource_group_name=None, custom_headers=None, raw=False): +def list_accounts(client, resource_group_name=None): """Get all Location Based Services Accounts in a Resource Group OR in a Subscription. :param resource_group_name: The name of the Azure Resource Group. @@ -58,5 +73,5 @@ def list_accounts(client, resource_group_name=None, custom_headers=None, raw=Fal :class:`ErrorException` """ if resource_group_name is None: - return client.list_by_subscription(custom_headers, raw) - return client.list_by_resource_group(resource_group_name, custom_headers, raw) + return client.list_by_subscription() + return client.list_by_resource_group(resource_group_name) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py index de78de5dbfc..692837da4b7 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py @@ -12,34 +12,34 @@ class LocationBasedServicesScenarioTests(ScenarioTest): @ResourceGroupPreparer() def test_create_locationbasedservices_account(self, resource_group): self.kwargs.update({ - 'name': self.create_random_name(prefix='cli-locationbasedservices', length=20), - 'name1': self.create_random_name(prefix='cli-locationbasedservices', length=20), - 'name2': self.create_random_name(prefix='cli-locationbasedservices', length=20), + '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', - 'loc': 'global', 'key_type_primary': KeyType.primary.value, 'key_type_secondary': KeyType.secondary.value }) # Test 'az locationbasedservices account create' # Test to create an LocationBasedServices account - account = self.cmd('az locationbasedservices account create -n {name} -g {rg} --sku {sku} -l {loc}', checks=[ - self.check('location', '{loc}'), - self.check('name', '{name}'), - self.check('resourceGroup', '{rg}'), - self.check('sku.name', '{sku}') - ]).get_output_in_json() + account = self.cmd('az locationbasedservices account create -n {name} -g {rg} --sku {sku} ' + + '--agree-to-the-preview-terms', + checks=[ + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('sku.name', '{sku}') + ]).get_output_in_json() # Call create again, expect to get the same account account_duplicated = self.cmd( - 'az locationbasedservices account create -n {name} -g {rg} --sku {sku} -l {loc}').get_output_in_json() + 'az locationbasedservices account create -n {name} -g {rg} --sku {sku} ' + + '--agree-to-the-preview-terms').get_output_in_json() self.assertEqual(account, account_duplicated) # Test 'az locationbasedservices account show' # Test to get information on LocationBasedServices account self.cmd('az locationbasedservices account show -n {name} -g {rg}', checks=[ self.check('id', account['id']), - self.check('location', '{loc}'), self.check('name', '{name}'), self.check('resourceGroup', '{rg}'), self.check('sku.name', '{sku}') @@ -51,7 +51,6 @@ def test_create_locationbasedservices_account(self, resource_group): self.check('length(@)', 1), self.check('type(@)', 'array'), self.check('[0].id', account['id']), - self.check('[0].location', '{loc}'), self.check('[0].name', '{name}'), self.check('[0].resourceGroup', '{rg}'), self.check('[0].sku.name', '{sku}'), @@ -59,8 +58,10 @@ def test_create_locationbasedservices_account(self, resource_group): ]) # Create two new accounts - self.cmd('az locationbasedservices account create -n {name1} -g {rg} --sku {sku} -l {loc}') - self.cmd('az locationbasedservices account create -n {name2} -g {rg} --sku {sku} -l {loc}') + self.cmd('az locationbasedservices account create -n {name1} -g {rg} --sku {sku} ' + + '--agree-to-the-preview-terms') + self.cmd('az locationbasedservices account create -n {name2} -g {rg} --sku {sku} ' + + '--agree-to-the-preview-terms') # Check that list command now shows three accounts. self.cmd('az locationbasedservices account list -g {rg}', checks=[ self.check('length(@)', 3), @@ -99,7 +100,8 @@ def test_create_locationbasedservices_account(self, resource_group): # Save the new primary key, and regenerate the secondary key. primary_key_old = key_regenerated['primaryKey'] key_regenerated = self.cmd( - 'az locationbasedservices account key regenerate -n {name} -g {rg} -t {key_type_secondary}').get_output_in_json() + 'az locationbasedservices account key regenerate -n {name} -g {rg} -t {key_type_secondary}') \ + .get_output_in_json() self.assertEqual(primary_key_old, key_regenerated['primaryKey']) self.assertNotEqual(secondary_key_old, key_regenerated['secondaryKey']) From 409b03b190222c77c3e5209db63f8b2971cf1689 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Mon, 26 Feb 2018 10:45:34 -0800 Subject: [PATCH 06/28] [Test] Add more strict assertion rule for key validation. --- .../tests/latest/test_lbs_commands.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py index 692837da4b7..1aeea63b39d 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py @@ -3,6 +3,8 @@ # 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.locationbasedservices.models.client_enums import KeyType @@ -16,6 +18,7 @@ def test_create_locationbasedservices_account(self, resource_group): 'name1': self.create_random_name(prefix='cli-', length=20), 'name2': self.create_random_name(prefix='cli-', length=20), 'sku': 'S0', + 'tags': 'a=b', 'key_type_primary': KeyType.primary.value, 'key_type_secondary': KeyType.secondary.value }) @@ -82,8 +85,8 @@ def test_create_locationbasedservices_account(self, resource_group): # Retrieve primary and secondary keys primary_key_old = account_key_list['primaryKey'] secondary_key_old = account_key_list['secondaryKey'] - self.assertIsNotNone(primary_key_old) - self.assertIsNotNone(secondary_key_old) + self.assertTrue(re.match('^[a-zA-Z0-9_-]+$', primary_key_old)) + self.assertTrue(re.match('^[a-zA-Z0-9_-]+$', secondary_key_old)) # Test 'az locationbasedservices account key regenerate' # Test to change primary and secondary keys for an LocationBasedServices account From ed3ca0121c3b6a0379342b5a89b05c9e2ebfedb7 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Mon, 26 Feb 2018 11:38:03 -0800 Subject: [PATCH 07/28] [Test] Add test for tags parameter --- .../tests/latest/test_lbs_commands.py | 55 ++++++++++++------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py index 1aeea63b39d..121ec18af79 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py @@ -11,36 +11,51 @@ class LocationBasedServicesScenarioTests(ScenarioTest): - @ResourceGroupPreparer() + @ResourceGroupPreparer(key='rg') def test_create_locationbasedservices_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': 'a=b', + 'tags': tag_key + '=' + tag_value, 'key_type_primary': KeyType.primary.value, 'key_type_secondary': KeyType.secondary.value }) - # Test 'az locationbasedservices account create' - # Test to create an LocationBasedServices account + # Test 'az locationbasedservices account create'. + # Test to create a LocationBasedServices account. account = self.cmd('az locationbasedservices account create -n {name} -g {rg} --sku {sku} ' + '--agree-to-the-preview-terms', checks=[ self.check('name', '{name}'), self.check('resourceGroup', '{rg}'), - self.check('sku.name', '{sku}') + self.check('sku.name', '{sku}'), + self.check('tags', None) ]).get_output_in_json() - # Call create again, expect to get the same account + # Call create again, expect to get the same account. account_duplicated = self.cmd( 'az locationbasedservices account create -n {name} -g {rg} --sku {sku} ' + '--agree-to-the-preview-terms').get_output_in_json() self.assertEqual(account, account_duplicated) - # Test 'az locationbasedservices account show' - # Test to get information on LocationBasedServices account + # Test update/override a LocationBasedServices account with tags param update. + self.cmd('az locationbasedservices account create -n {name} -g {rg} --sku {sku} --tags {tags} ' + + '--agree-to-the-preview-terms', + 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 locationbasedservices account show'. + # Test to get information on LocationBasedServices account. self.cmd('az locationbasedservices account show -n {name} -g {rg}', checks=[ self.check('id', account['id']), self.check('name', '{name}'), @@ -48,8 +63,8 @@ def test_create_locationbasedservices_account(self, resource_group): self.check('sku.name', '{sku}') ]) - # Test 'az locationbasedservices account list' - # Test to list all LocationBasedServices accounts under a resource group + # Test 'az locationbasedservices account list'. + # Test to list all LocationBasedServices accounts under a resource group. self.cmd('az locationbasedservices account list -g {rg}', checks=[ self.check('length(@)', 1), self.check('type(@)', 'array'), @@ -57,10 +72,10 @@ def test_create_locationbasedservices_account(self, resource_group): self.check('[0].name', '{name}'), self.check('[0].resourceGroup', '{rg}'), self.check('[0].sku.name', '{sku}'), - self.check('[0].tags', None) + self.check('[0].tags', {tag_key: tag_value}) ]) - # Create two new accounts + # Create two new accounts. self.cmd('az locationbasedservices account create -n {name1} -g {rg} --sku {sku} ' + '--agree-to-the-preview-terms') self.cmd('az locationbasedservices account create -n {name2} -g {rg} --sku {sku} ' + @@ -75,21 +90,21 @@ def test_create_locationbasedservices_account(self, resource_group): self.check("length([?resourceGroup == '{rg}'])", 3) ]) - # Test 'az locationbasedservices account key list' - # Test to list keys for an LocationBasedServices account + # Test 'az locationbasedservices account key list'. + # Test to list keys for an LocationBasedServices account. account_key_list = self.cmd('az locationbasedservices account key list -n {name} -g {rg}', checks=[ self.check('id', account['id']), self.check('resourceGroup', '{rg}') ]).get_output_in_json() - # Retrieve primary and secondary keys + # 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 locationbasedservices account key regenerate' - # Test to change primary and secondary keys for an LocationBasedServices account + # Test 'az locationbasedservices account key regenerate'. + # Test to change primary and secondary keys for an LocationBasedServices account. key_regenerated = self.cmd( 'az locationbasedservices account key regenerate -n {name} -g {rg} -t {key_type_primary}', checks=[ self.check('id', account['id']), @@ -108,8 +123,8 @@ def test_create_locationbasedservices_account(self, resource_group): self.assertEqual(primary_key_old, key_regenerated['primaryKey']) self.assertNotEqual(secondary_key_old, key_regenerated['secondaryKey']) - # Test 'az locationbasedservices account delete' - # Test to remove an LocationBasedServices account + # Test 'az locationbasedservices account delete'. + # Test to remove an LocationBasedServices account. self.cmd('az locationbasedservices account delete -n {name} -g {rg}', checks=self.is_empty()) self.cmd('az locationbasedservices account show -n {name} -g {rg}', checks=self.is_empty()) self.cmd('az locationbasedservices account list -g {rg}', checks=[ @@ -117,7 +132,7 @@ def test_create_locationbasedservices_account(self, resource_group): self.check("length([?name == '{name}'])", 0) ]) - # Remove the rest of LocationBasedServices accounts + # Remove the rest of LocationBasedServices accounts. exit_code = self.cmd('az locationbasedservices account delete -n {name1} -g {rg}').exit_code self.assertEqual(exit_code, 0) self.cmd('az locationbasedservices account delete -n {name2} -g {rg}') From 81e4fb5e4fd7ad719893ea2771709dd3e7e60dee Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Mon, 26 Feb 2018 12:04:13 -0800 Subject: [PATCH 08/28] [Test] Added an additional resource group. --- .../tests/latest/test_lbs_commands.py | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py index 121ec18af79..eac6d3b9915 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py @@ -12,6 +12,7 @@ class LocationBasedServicesScenarioTests(ScenarioTest): @ResourceGroupPreparer(key='rg') + @ResourceGroupPreparer(key='rg1') def test_create_locationbasedservices_account(self, resource_group): tag_key = self.create_random_name(prefix='key-', length=10) tag_value = self.create_random_name(prefix='val-', length=10) @@ -75,19 +76,29 @@ def test_create_locationbasedservices_account(self, resource_group): self.check('[0].tags', {tag_key: tag_value}) ]) - # Create two new accounts. - self.cmd('az locationbasedservices account create -n {name1} -g {rg} --sku {sku} ' + + # Create two new accounts (One in separate resource group). + self.cmd('az locationbasedservices account create -n {name1} -g {rg1} --sku {sku} ' + '--agree-to-the-preview-terms') self.cmd('az locationbasedservices account create -n {name2} -g {rg} --sku {sku} ' + '--agree-to-the-preview-terms') - # Check that list command now shows three accounts. + # Check that list command now shows two accounts in one resource group, and one in another. self.cmd('az locationbasedservices account list -g {rg}', checks=[ - self.check('length(@)', 3), + self.check('length(@)', 2), self.check('type(@)', 'array'), self.check("length([?name == '{name}'])", 1), - self.check("length([?name == '{name1}'])", 1), + self.check("length([?name == '{name1}'])", 0), self.check("length([?name == '{name2}'])", 1), - self.check("length([?resourceGroup == '{rg}'])", 3) + self.check("length([?resourceGroup == '{rg}'])", 2), + self.check("length([?resourceGroup == '{rg1}'])", 0) + ]) + self.cmd('az locationbasedservices 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 locationbasedservices account key list'. @@ -128,12 +139,13 @@ def test_create_locationbasedservices_account(self, resource_group): self.cmd('az locationbasedservices account delete -n {name} -g {rg}', checks=self.is_empty()) self.cmd('az locationbasedservices account show -n {name} -g {rg}', checks=self.is_empty()) self.cmd('az locationbasedservices account list -g {rg}', checks=[ - self.check('length(@)', 2), + self.check('length(@)', 1), self.check("length([?name == '{name}'])", 0) ]) # Remove the rest of LocationBasedServices accounts. - exit_code = self.cmd('az locationbasedservices account delete -n {name1} -g {rg}').exit_code + exit_code = self.cmd('az locationbasedservices account delete -n {name1} -g {rg1}').exit_code self.assertEqual(exit_code, 0) self.cmd('az locationbasedservices account delete -n {name2} -g {rg}') self.cmd('az locationbasedservices account list -g {rg}', checks=self.is_empty()) + self.cmd('az locationbasedservices account list -g {rg1}', checks=self.is_empty()) From 0d11a6db5e4c3a21aa066c0f0959bcc9c3aa6303 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Mon, 26 Feb 2018 13:42:36 -0800 Subject: [PATCH 09/28] [Test] Init recordings --- ..._create_locationbasedservices_account.yaml | 718 ++++++++++++++++++ 1 file changed, 718 insertions(+) create mode 100644 src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml new file mode 100644 index 00000000000..47e687b3c21 --- /dev/null +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml @@ -0,0 +1,718 @@ +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.26 + msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.27] + 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, 26 Feb 2018 21:40:35 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.26 + msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.27] + 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, 26 Feb 2018 21:40:38 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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:40:43 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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:40:47 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: 'b''b\''{"location": "global", "tags": {"key-000003": "val-000004"}, "sku": + {"name": "S0"}}\''''' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [locationbasedservices account create] + 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['457'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:40:50 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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['457'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:40:52 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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['534'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:40:54 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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts/cli-000006?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts/cli-000006\"\ + ,\r\n \"name\": \"cli-000006\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:41:00 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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007\"\ + ,\r\n \"name\": \"cli-000007\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:41:03 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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007\"\ + ,\r\n \"name\": \"cli-000007\",\r\n \"type\": \"Microsoft.LocationBasedServices/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.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['983'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21: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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts/cli-000006\"\ + ,\r\n \"name\": \"cli-000006\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['471'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:41:09 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: [locationbasedservices account key 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005/listKeys?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"primaryKey\": \"NzpVyKaydgUlWqGmCzRz7cPtZpnE0-jjjNJwmLcvNHc\",\r\n\ + \ \"secondaryKey\": \"FQ6J_YPyMzcATEoi4ooD_EZkP0RG2mLOAbZ8gTmMZw8\"\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['360'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:41:12 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: [locationbasedservices account key regenerate] + 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005/regenerateKey?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"primaryKey\": \"zmNwbYwLXdWFoL4qfoY29fv_l_kKF14Ruumzqk5g_H4\",\r\n\ + \ \"secondaryKey\": \"FQ6J_YPyMzcATEoi4ooD_EZkP0RG2mLOAbZ8gTmMZw8\"\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['360'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:41:15 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: [locationbasedservices account key regenerate] + 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005/regenerateKey?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"primaryKey\": \"zmNwbYwLXdWFoL4qfoY29fv_l_kKF14Ruumzqk5g_H4\",\r\n\ + \ \"secondaryKey\": \"A3TClJrfCiv3RIphaz8Yk6oWzSF9UC34e51jwhXNDvA\"\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['360'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:41:17 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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Mon, 26 Feb 2018 21:41:22 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: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.LocationBasedServices/accounts/cli-000005'' + under resource group ''clitest.rg000001'' was not found."}}'} + headers: + cache-control: [no-cache] + content-length: ['240'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:41:24 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-failure-cause: [gateway] + status: {code: 404, message: Not Found} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007\"\ + ,\r\n \"name\": \"cli-000007\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['471'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 26 Feb 2018 21:41:26 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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts/cli-000006?api-version=2017-01-01-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Mon, 26 Feb 2018 21:41:30 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: ['1198'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007?api-version=2017-01-01-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Mon, 26 Feb 2018 21:41:33 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: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts?api-version=2017-01-01-preview + 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, 26 Feb 2018 21:41:35 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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.27] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts?api-version=2017-01-01-preview + 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, 26 Feb 2018 21:41: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] + 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.26 + msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.27] + 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, 26 Feb 2018 21:41:40 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkczN1hMQ1RXNTRTWUVKN0ZJVVhORUpNWkhXRERIRkRRMklEUHxDQzZCRjdBOTJCQUVBQ0Q1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?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-writes: ['1199'] + 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.26 + msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.27] + 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, 26 Feb 2018 21:41:43 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkc1N0JUSTdOWkdYN1RCREs0SVNLN1U1SjVHTFFWU1VHNFI2UHw2QTZEQzcyRUY2QzBDRkU4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?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-writes: ['1199'] + status: {code: 202, message: Accepted} +version: 1 From 9e5051fd918d9467bb35534147edfb91b205f4c9 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Mon, 26 Feb 2018 15:52:59 -0800 Subject: [PATCH 10/28] [Pylint] Specify string format arguments as logging function parameters --- .../cli/command_modules/locationbasedservices/custom.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py index 084a6b68385..05c3e3ba3b3 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py @@ -41,10 +41,11 @@ def create(client, resource_group_name, account_name, sku_name='S0', tags=None, :class:`ErrorException` """ # Prompt for the Preview Terms agreement. - logger.warning( - 'By creating a Location Based Services account, you agree to the Microsoft Azure Preview Terms.' + - '\nThe Preview Terms can be found at: ' + - '\nhttps://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/') + warning_msg = 'By creating a Location Based Services account, you agree to the Microsoft Azure Preview Terms.' + \ + '\nThe Preview Terms can be found at: ' + \ + '\nhttps://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/' + + logger.warning(warning_msg) if not agree: # ... in order to pass tests response = prompt_y_n('I confirm that I have read and agree to the Microsoft Azure Preview Terms.') if not response: From 77a9f2226a69e33721045c86f26c696d63fa884a Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Tue, 27 Feb 2018 15:20:56 -0800 Subject: [PATCH 11/28] [Refactor] Update description in _help to match the general template --- .../azure/cli/command_modules/locationbasedservices/_help.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py index 8618afd2d7a..b0fd01219ef 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py @@ -12,12 +12,12 @@ helps['locationbasedservices account'] = """ type: group - short-summary: Commands to manage Azure Location Based Services accounts. + short-summary: Manage Azure Location Based Services accounts. """ helps['locationbasedservices account key'] = """ type: group - short-summary: Commands to manage Azure Location Based Services account keys. + short-summary: Manage Azure Location Based Services account keys. """ helps['locationbasedservices account show'] = """ From 98d973eedf15abf4ef947d514b4496130f2a2d75 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Tue, 27 Feb 2018 15:33:58 -0800 Subject: [PATCH 12/28] [Refactor] General template mismatch fix for 'key' --- .../cli/command_modules/locationbasedservices/_help.py | 10 +++++----- .../command_modules/locationbasedservices/_params.py | 4 ++-- .../command_modules/locationbasedservices/commands.py | 4 ++-- .../tests/latest/test_lbs_commands.py | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py index b0fd01219ef..4dfb274dade 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py @@ -15,7 +15,7 @@ short-summary: Manage Azure Location Based Services accounts. """ -helps['locationbasedservices account key'] = """ +helps['locationbasedservices account keys'] = """ type: group short-summary: Manage Azure Location Based Services account keys. """ @@ -42,16 +42,16 @@ short-summary: Delete a Location Based Services account. """ -helps['locationbasedservices account key list'] = """ +helps['locationbasedservices account keys list'] = """ type: command short-summary: List the keys to use with the Location Based Services APIs. long-summary: | List the keys to use with the Location Based Services APIs. A key is used to authenticate and authorize access to the Location Based Services REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. """ -helps['locationbasedservices account key regenerate'] = """ +helps['locationbasedservices account keys renew'] = """ type: command - short-summary: Regenerate either the primary or secondary key for use with the Location Based Services APIs. + short-summary: Renew either the primary or secondary key for use with the Location Based Services APIs. long-summary: | - Regenerate either the primary or secondary key for use with the Location Based Services APIs. The old key will stop working immediately. + Renew either the primary or secondary key for use with the Location Based Services APIs. The old key will stop working immediately. """ diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py index 7ca0b2aa5db..ae1f3383898 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py @@ -44,7 +44,7 @@ def load_arguments(self, _): help='You agree to the Preview Terms. Ignore prompt for confirmation.', action='store_true') - with self.argument_context('locationbasedservices account key regenerate') as c: + with self.argument_context('locationbasedservices account keys regenerate') as c: c.argument('key_type', - options_list=['--type', '-t'], + options_list=['--key'], arg_type=get_enum_type(KeyType)) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py index cee3e63301d..730e270006c 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py @@ -18,6 +18,6 @@ def load_command_table(self, _): g.custom_command('create', 'create') g.command('delete', 'delete') - with self.command_group('locationbasedservices account key', mgmt_type) as g: - g.command('regenerate', 'regenerate_keys') + with self.command_group('locationbasedservices account keys', mgmt_type) as g: + g.command('renew', 'regenerate_keys') g.command('list', 'list_keys') diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py index eac6d3b9915..8f6f0b9adc8 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py @@ -103,7 +103,7 @@ def test_create_locationbasedservices_account(self, resource_group): # Test 'az locationbasedservices account key list'. # Test to list keys for an LocationBasedServices account. - account_key_list = self.cmd('az locationbasedservices account key list -n {name} -g {rg}', checks=[ + account_key_list = self.cmd('az locationbasedservices account keys list -n {name} -g {rg}', checks=[ self.check('id', account['id']), self.check('resourceGroup', '{rg}') ]).get_output_in_json() @@ -117,7 +117,7 @@ def test_create_locationbasedservices_account(self, resource_group): # Test 'az locationbasedservices account key regenerate'. # Test to change primary and secondary keys for an LocationBasedServices account. key_regenerated = self.cmd( - 'az locationbasedservices account key regenerate -n {name} -g {rg} -t {key_type_primary}', checks=[ + 'az locationbasedservices account keys renew -n {name} -g {rg} -t {key_type_primary}', checks=[ self.check('id', account['id']), self.check('resourceGroup', '{rg}') ]).get_output_in_json() @@ -129,7 +129,7 @@ def test_create_locationbasedservices_account(self, resource_group): # Save the new primary key, and regenerate the secondary key. primary_key_old = key_regenerated['primaryKey'] key_regenerated = self.cmd( - 'az locationbasedservices account key regenerate -n {name} -g {rg} -t {key_type_secondary}') \ + 'az locationbasedservices account keys renew -n {name} -g {rg} -t {key_type_secondary}') \ .get_output_in_json() self.assertEqual(primary_key_old, key_regenerated['primaryKey']) self.assertNotEqual(secondary_key_old, key_regenerated['secondaryKey']) From 58533310707fec698feb358bcf50989c1d0c2795 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Tue, 27 Feb 2018 18:04:14 -0800 Subject: [PATCH 13/28] [Feature] Introduce search by ids [Fix] --key-type, -t are now --key --- .../command_modules/locationbasedservices/_params.py | 12 ++++++++++-- .../tests/latest/test_lbs_commands.py | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py index ae1f3383898..bd8f7e3e783 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py @@ -17,7 +17,7 @@ def load_arguments(self, _): # Argument Definition - locationbasedservices_name_type = CLIArgumentType(options_list=['--account-name', '-n'], + locationbasedservices_name_type = CLIArgumentType(options_list=['--name', '-n'], completer=get_resource_name_completion_list( 'Microsoft.LocationBasedServices/accounts'), help='The name of the Location Based Services Account', @@ -27,8 +27,10 @@ def load_arguments(self, _): with self.argument_context('locationbasedservices') 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=locationbasedservices_name_type) with self.argument_context('locationbasedservices account create') as c: @@ -44,7 +46,13 @@ def load_arguments(self, _): help='You agree to the Preview Terms. Ignore prompt for confirmation.', action='store_true') - with self.argument_context('locationbasedservices account keys regenerate') as c: + # Prevent --ids argument in keys with id_part=None + with self.argument_context('locationbasedservices account keys') as c: + c.argument('account_name', + id_part=None, + arg_type=locationbasedservices_name_type) + + with self.argument_context('locationbasedservices 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-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py index 8f6f0b9adc8..263d1ba709e 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py @@ -117,7 +117,7 @@ def test_create_locationbasedservices_account(self, resource_group): # Test 'az locationbasedservices account key regenerate'. # Test to change primary and secondary keys for an LocationBasedServices account. key_regenerated = self.cmd( - 'az locationbasedservices account keys renew -n {name} -g {rg} -t {key_type_primary}', checks=[ + 'az locationbasedservices 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() @@ -129,7 +129,7 @@ def test_create_locationbasedservices_account(self, resource_group): # Save the new primary key, and regenerate the secondary key. primary_key_old = key_regenerated['primaryKey'] key_regenerated = self.cmd( - 'az locationbasedservices account keys renew -n {name} -g {rg} -t {key_type_secondary}') \ + 'az locationbasedservices 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']) From 4d930f80dc7505595e202bbd25c9710d0cf1afc5 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Wed, 28 Feb 2018 14:04:49 -0800 Subject: [PATCH 14/28] [Temporary] Throw an exception on 'account show' command, when nonexist --- .../locationbasedservices/commands.py | 5 ++--- .../locationbasedservices/custom.py | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py index 730e270006c..334e0280c99 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py @@ -13,11 +13,10 @@ def load_command_table(self, _): client_factory=cf_accounts) with self.command_group('locationbasedservices account', mgmt_type) as g: - g.command('show', 'get') + g.custom_command('show', 'get_account') g.custom_command('list', 'list_accounts') - g.custom_command('create', 'create') + g.custom_command('create', 'create_account') g.command('delete', 'delete') - with self.command_group('locationbasedservices account keys', mgmt_type) as g: g.command('renew', 'regenerate_keys') g.command('list', 'list_keys') diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py index 05c3e3ba3b3..00edec332dc 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py @@ -9,11 +9,21 @@ from azure.mgmt.locationbasedservices.models import LocationBasedServicesAccountCreateParameters, Sku +ACCOUNT_LOCATION = 'global' + logger = get_logger(__name__) # pylint: disable=line-too-long -def create(client, resource_group_name, account_name, sku_name='S0', tags=None, agree=None): +def get_account(client, resource_group_name, account_name): + response = client.get(resource_group_name, account_name) + if response is None: + raise CLIError("The resource 'Microsoft.LocationBasedServices/accounts/" + account_name + + "' under resource group '" + resource_group_name + "' was not found.") + return response + + +def create_account(client, resource_group_name, account_name, sku_name='S0', tags=None, agree=None): """Create a Location Based Services Account. A Location Based Services Account holds the keys which allow access to the Location Based Services REST APIs. @@ -44,16 +54,16 @@ def create(client, resource_group_name, account_name, sku_name='S0', tags=None, warning_msg = 'By creating a Location Based Services account, you agree to the Microsoft Azure Preview Terms.' + \ '\nThe Preview Terms can be found at: ' + \ '\nhttps://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/' - logger.warning(warning_msg) - if not agree: # ... in order to pass tests + + if not agree: # ... in order to pass ScenarioTest response = prompt_y_n('I confirm that I have read and agree to the Microsoft Azure Preview Terms.') if not response: raise CLIError('You must agree to the Microsoft Azure Preview Terms to create an account.') # Proceed if user has agreed to the Preview Terms. sku = Sku(sku_name) - lbs_account_create_params = LocationBasedServicesAccountCreateParameters('global', sku, tags) + lbs_account_create_params = LocationBasedServicesAccountCreateParameters(ACCOUNT_LOCATION, sku, tags) return client.create_or_update(resource_group_name, account_name, lbs_account_create_params) From d36abf9e354e2db96896a71d9d454e30b863518a Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Wed, 28 Feb 2018 14:57:45 -0800 Subject: [PATCH 15/28] [Test] 'account show' on non-existent account should not return empty. --- .../locationbasedservices/tests/latest/test_lbs_commands.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py index 263d1ba709e..bc3f6d6919e 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py @@ -137,7 +137,6 @@ def test_create_locationbasedservices_account(self, resource_group): # Test 'az locationbasedservices account delete'. # Test to remove an LocationBasedServices account. self.cmd('az locationbasedservices account delete -n {name} -g {rg}', checks=self.is_empty()) - self.cmd('az locationbasedservices account show -n {name} -g {rg}', checks=self.is_empty()) self.cmd('az locationbasedservices account list -g {rg}', checks=[ self.check('length(@)', 1), self.check("length([?name == '{name}'])", 0) From b79cb108bcdf103977aed44db63a80930e06fd9b Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Thu, 1 Mar 2018 00:41:31 -0800 Subject: [PATCH 16/28] [Feature] Introduce update command [Refactor] get_account command now specifically throws error only if it's a 404 response. --- .../locationbasedservices/_help.py | 7 ++- .../locationbasedservices/_params.py | 7 ++- .../locationbasedservices/commands.py | 8 +++ .../locationbasedservices/custom.py | 58 +++++++++++++++++-- 4 files changed, 72 insertions(+), 8 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py index 4dfb274dade..3023c6583ad 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py @@ -22,7 +22,7 @@ helps['locationbasedservices account show'] = """ type: command - short-summary: Show a Location Based Services account. + short-summary: Show the details of a Location Based Services account. """ helps['locationbasedservices account list'] = """ @@ -37,6 +37,11 @@ Create a Location Based Services account. A Location Based Services account holds the keys which allow access to the Location Based Services REST APIs. """ +helps['locationbasedservices account update'] = """ + type: command + short-summary: Update the properties of a Location Based Services account. +""" + helps['locationbasedservices account delete'] = """ type: command short-summary: Delete a Location Based Services account. diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py index bd8f7e3e783..96a2d6aa36c 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py @@ -33,7 +33,7 @@ def load_arguments(self, _): id_part='name', arg_type=locationbasedservices_name_type) - with self.argument_context('locationbasedservices account create') as c: + with self.argument_context('locationbasedservices account') as c: c.argument('sku_name', options_list=['--sku', '-s'], help='The name of the SKU, in standard format (such as S0).', @@ -41,11 +41,16 @@ def load_arguments(self, _): required=False) c.argument('tags', arg_type=tags_type) + + with self.argument_context('locationbasedservices account create') as c: c.argument('agree', options_list=['--agree-to-the-preview-terms'], help='You agree to the Preview Terms. Ignore prompt for confirmation.', action='store_true') + with self.argument_context('locationbasedservices account update') as c: + c.ignore('agree') + # Prevent --ids argument in keys with id_part=None with self.argument_context('locationbasedservices account keys') as c: c.argument('account_name', diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py index 334e0280c99..20739b1026f 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py @@ -11,12 +11,20 @@ def load_command_table(self, _): mgmt_type = CliCommandType( operations_tmpl='azure.mgmt.locationbasedservices.operations.accounts_operations#AccountsOperations.{}', client_factory=cf_accounts) + custom_type = CliCommandType( + operations_tmpl='azure.cli.command_modules.locationbasedservices.custom#{}') with self.command_group('locationbasedservices account', mgmt_type) as g: g.custom_command('show', 'get_account') g.custom_command('list', 'list_accounts') g.custom_command('create', 'create_account') g.command('delete', 'delete') + g.generic_update_command('update', + getter_name='get_account', + getter_type=custom_type, + setter_arg_name='location_based_services_account_create_parameters', + custom_func_name='generic_update_account') + with self.command_group('locationbasedservices account keys', mgmt_type) as g: g.command('renew', 'regenerate_keys') g.command('list', 'list_keys') diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py index 00edec332dc..d0e7d850c75 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py @@ -7,7 +7,9 @@ from knack.prompting import prompt_y_n from knack.util import CLIError -from azure.mgmt.locationbasedservices.models import LocationBasedServicesAccountCreateParameters, Sku +from azure.mgmt.locationbasedservices.models import ( + LocationBasedServicesAccountCreateParameters, + Sku) ACCOUNT_LOCATION = 'global' @@ -16,11 +18,26 @@ # pylint: disable=line-too-long def get_account(client, resource_group_name, account_name): - response = client.get(resource_group_name, account_name) - if response is None: + """Get a Location Based Services Account. + + :param resource_group_name: The name of the Azure Resource Group. + :type resource_group_name: str + :param account_name: The name of the Location Based Services Account. + :type account_name: str + :return: LocationBasedServicesAccount + :rtype: + ~azure.mgmt.locationbasedservices.models.LocationBasedServicesAccount + :raises: + :class:`ErrorException` + or :class:`ErrorException` + """ + # Retrieve ClientRawResponse from get call + out = client.get(resource_group_name, account_name, raw=True) + # Handle 404 error + if out.response.status_code == 404: raise CLIError("The resource 'Microsoft.LocationBasedServices/accounts/" + account_name + "' under resource group '" + resource_group_name + "' was not found.") - return response + return out.output def create_account(client, resource_group_name, account_name, sku_name='S0', tags=None, agree=None): @@ -43,10 +60,9 @@ def create_account(client, resource_group_name, account_name, sku_name='S0', tag :param agree: If true, user agrees to the Preview Terms. Ignore prompt for confirmation. False otherwise. :type agree: bool - :return: LocationBasedServicesAccount or ClientRawResponse if raw=true + :return: LocationBasedServicesAccount :rtype: ~azure.mgmt.locationbasedservices.models.LocationBasedServicesAccount - or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorException` """ @@ -83,6 +99,36 @@ def list_accounts(client, resource_group_name=None): :raises: :class:`ErrorException` """ + # 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): + """Create a LocationBasedServicesCreateParameters from old account instance + with new sku_name and tags. This function is called from the + generic_update_command(...) in commands.py . + + :param sku_name: The name of the SKU, in standard format (such as S0). + :type sku_name: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :return: LocationBasedServicesAccountCreateParameters + :rtype: + ~azure.mgmt.locationbasedservices.models.LocationBasedServicesAccountCreateParameters + """ + # Pre-populate with old instance + lbs_account_create_params = LocationBasedServicesAccountCreateParameters(ACCOUNT_LOCATION, instance.sku, + instance.tags) + # Update fields with new parameter values + if sku_name: + lbs_account_create_params.sku.name = sku_name + if tags: + lbs_account_create_params.tags = tags + return lbs_account_create_params From 75795e6058a69cf5166576d0e6dc374e5c42d477 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Thu, 1 Mar 2018 13:56:00 -0800 Subject: [PATCH 17/28] [Test] Add test for update and search by id [Output] Added recordings --- ..._create_locationbasedservices_account.yaml | 209 +++++++++++------- .../tests/latest/test_lbs_commands.py | 14 +- 2 files changed, 134 insertions(+), 89 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml index 47e687b3c21..e73f4c97e4e 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml @@ -10,7 +10,7 @@ interactions: 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.26 msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] 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 @@ -20,7 +20,7 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:40:35 GMT'] + date: ['Thu, 01 Mar 2018 21:53:15 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -38,7 +38,7 @@ interactions: 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.26 msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] 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 @@ -48,7 +48,7 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:40:38 GMT'] + date: ['Thu, 01 Mar 2018 21:53:17 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -66,7 +66,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview @@ -79,7 +79,7 @@ interactions: cache-control: [no-cache] content-length: ['406'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:40:43 GMT'] + date: ['Thu, 01 Mar 2018 21:53:21 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -98,7 +98,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview @@ -111,7 +111,7 @@ interactions: cache-control: [no-cache] content-length: ['406'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:40:47 GMT'] + date: ['Thu, 01 Mar 2018 21:53:23 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -121,19 +121,51 @@ interactions: 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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 01 Mar 2018 21:53:23 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: [locationbasedservices account create] + CommandName: [locationbasedservices 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview @@ -147,7 +179,7 @@ interactions: cache-control: [no-cache] content-length: ['457'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:40:50 GMT'] + date: ['Thu, 01 Mar 2018 21:53:24 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -167,7 +199,40 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['457'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 01 Mar 2018 21:53:25 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: [locationbasedservices 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.26 + msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python + AZURECLI/2.0.29] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview @@ -181,7 +246,7 @@ interactions: cache-control: [no-cache] content-length: ['457'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:40:52 GMT'] + date: ['Thu, 01 Mar 2018 21:53:26 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -200,7 +265,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts?api-version=2017-01-01-preview @@ -214,7 +279,7 @@ interactions: cache-control: [no-cache] content-length: ['534'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:40:54 GMT'] + date: ['Thu, 01 Mar 2018 21:53:27 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -234,7 +299,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts/cli-000006?api-version=2017-01-01-preview @@ -247,7 +312,7 @@ interactions: cache-control: [no-cache] content-length: ['406'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:41:00 GMT'] + date: ['Thu, 01 Mar 2018 21:53:29 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -266,7 +331,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007?api-version=2017-01-01-preview @@ -279,7 +344,7 @@ interactions: cache-control: [no-cache] content-length: ['406'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:41:03 GMT'] + date: ['Thu, 01 Mar 2018 21:53:31 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -297,7 +362,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts?api-version=2017-01-01-preview @@ -315,7 +380,7 @@ interactions: cache-control: [no-cache] content-length: ['983'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:41:06 GMT'] + date: ['Thu, 01 Mar 2018 21:53:33 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -334,7 +399,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts?api-version=2017-01-01-preview @@ -348,7 +413,7 @@ interactions: cache-control: [no-cache] content-length: ['471'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:41:09 GMT'] + date: ['Thu, 01 Mar 2018 21:53:34 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -362,25 +427,25 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [locationbasedservices account key list] + CommandName: [locationbasedservices 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005/listKeys?api-version=2017-01-01-preview response: body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"NzpVyKaydgUlWqGmCzRz7cPtZpnE0-jjjNJwmLcvNHc\",\r\n\ - \ \"secondaryKey\": \"FQ6J_YPyMzcATEoi4ooD_EZkP0RG2mLOAbZ8gTmMZw8\"\r\n}"} + ,\r\n \"primaryKey\": \"DZjUwV55FiXWENGVA2DCkCjrPHKB76s3wlL5IAW69qg\",\r\n\ + \ \"secondaryKey\": \"YTEcYoFxNXpcB3q5rfF2ZYtqUP-5Ax2PmnrkIM9XiPA\"\r\n}"} headers: cache-control: [no-cache] content-length: ['360'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:41:12 GMT'] + date: ['Thu, 01 Mar 2018 21:53:35 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -395,25 +460,25 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [locationbasedservices account key regenerate] + CommandName: [locationbasedservices 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005/regenerateKey?api-version=2017-01-01-preview response: body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"zmNwbYwLXdWFoL4qfoY29fv_l_kKF14Ruumzqk5g_H4\",\r\n\ - \ \"secondaryKey\": \"FQ6J_YPyMzcATEoi4ooD_EZkP0RG2mLOAbZ8gTmMZw8\"\r\n}"} + ,\r\n \"primaryKey\": \"mdUpJbiVWvnZNx-sr8ybzqzmJSWZy3MaKAyy-_lSyzY\",\r\n\ + \ \"secondaryKey\": \"YTEcYoFxNXpcB3q5rfF2ZYtqUP-5Ax2PmnrkIM9XiPA\"\r\n}"} headers: cache-control: [no-cache] content-length: ['360'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:41:15 GMT'] + date: ['Thu, 01 Mar 2018 21:53:35 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -428,25 +493,25 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [locationbasedservices account key regenerate] + CommandName: [locationbasedservices 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005/regenerateKey?api-version=2017-01-01-preview response: body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"zmNwbYwLXdWFoL4qfoY29fv_l_kKF14Ruumzqk5g_H4\",\r\n\ - \ \"secondaryKey\": \"A3TClJrfCiv3RIphaz8Yk6oWzSF9UC34e51jwhXNDvA\"\r\n}"} + ,\r\n \"primaryKey\": \"mdUpJbiVWvnZNx-sr8ybzqzmJSWZy3MaKAyy-_lSyzY\",\r\n\ + \ \"secondaryKey\": \"Iy7R2-DrYZoZCl69nljOEVDc4iEfvdyUGEplxR2UX8c\"\r\n}"} headers: cache-control: [no-cache] content-length: ['360'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:41:17 GMT'] + date: ['Thu, 01 Mar 2018 21:53:36 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -467,7 +532,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview @@ -476,7 +541,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Mon, 26 Feb 2018 21:41:22 GMT'] + date: ['Thu, 01 Mar 2018 21:53:39 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -484,34 +549,6 @@ interactions: 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] - accept-language: [en-US] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview - response: - body: {string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.LocationBasedServices/accounts/cli-000005'' - under resource group ''clitest.rg000001'' was not found."}}'} - headers: - cache-control: [no-cache] - content-length: ['240'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:41:24 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - x-content-type-options: [nosniff] - x-ms-failure-cause: [gateway] - status: {code: 404, message: Not Found} - request: body: null headers: @@ -522,7 +559,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts?api-version=2017-01-01-preview @@ -536,7 +573,7 @@ interactions: cache-control: [no-cache] content-length: ['471'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:41:26 GMT'] + date: ['Thu, 01 Mar 2018 21:53:40 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -556,7 +593,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts/cli-000006?api-version=2017-01-01-preview @@ -565,13 +602,13 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Mon, 26 Feb 2018 21:41:30 GMT'] + date: ['Thu, 01 Mar 2018 21:53:42 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: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: body: null @@ -584,7 +621,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007?api-version=2017-01-01-preview @@ -593,7 +630,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Mon, 26 Feb 2018 21:41:33 GMT'] + date: ['Thu, 01 Mar 2018 21:53:43 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -611,7 +648,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts?api-version=2017-01-01-preview @@ -621,7 +658,7 @@ interactions: cache-control: [no-cache] content-length: ['19'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:41:35 GMT'] + date: ['Thu, 01 Mar 2018 21:53:45 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -640,7 +677,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] accept-language: [en-US] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts?api-version=2017-01-01-preview @@ -650,7 +687,7 @@ interactions: cache-control: [no-cache] content-length: ['19'] content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Feb 2018 21:41:37 GMT'] + date: ['Thu, 01 Mar 2018 21:53:45 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -670,7 +707,7 @@ interactions: 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.26 msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] 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 @@ -679,9 +716,9 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Mon, 26 Feb 2018 21:41:40 GMT'] + date: ['Thu, 01 Mar 2018 21:53:47 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkczN1hMQ1RXNTRTWUVKN0ZJVVhORUpNWkhXRERIRkRRMklEUHxDQzZCRjdBOTJCQUVBQ0Q1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkcyQ1BHRkM0NEM0TVBPTkVMRzVDRVk3N0ZLTVI1R1AyWjNKTHw2RDRCNDQwNTQ2NEQwNEQ0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] @@ -698,7 +735,7 @@ interactions: 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.26 msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.27] + AZURECLI/2.0.29] 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 @@ -707,12 +744,12 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Mon, 26 Feb 2018 21:41:43 GMT'] + date: ['Thu, 01 Mar 2018 21:53:48 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkc1N0JUSTdOWkdYN1RCREs0SVNLN1U1SjVHTFFWU1VHNFI2UHw2QTZEQzcyRUY2QzBDRkU4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdOQVFEU0Y3Q01aTExVWU5GRk1TWUlQRDRGTEhHVVNWRjRYNnwxRTZBNkI0QTQ0MzE0QjhGLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?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-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 202, message: Accepted} version: 1 diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py index bc3f6d6919e..56949bb6643 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py @@ -44,9 +44,9 @@ def test_create_locationbasedservices_account(self, resource_group): '--agree-to-the-preview-terms').get_output_in_json() self.assertEqual(account, account_duplicated) - # Test update/override a LocationBasedServices account with tags param update. - self.cmd('az locationbasedservices account create -n {name} -g {rg} --sku {sku} --tags {tags} ' + - '--agree-to-the-preview-terms', + # Test 'az locationbasedservices account update' + # Test to add a new tag to an existing account. + self.cmd('az locationbasedservices account update -n {name} -g {rg} --sku {sku} --tags {tags}', checks=[ self.check('id', account['id']), self.check('name', '{name}'), @@ -63,6 +63,14 @@ def test_create_locationbasedservices_account(self, resource_group): self.check('resourceGroup', '{rg}'), self.check('sku.name', '{sku}') ]) + # Search by id + self.cmd('az locationbasedservices 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 locationbasedservices account list'. # Test to list all LocationBasedServices accounts under a resource group. From 1fd7bef1ab353a78868a07f326ee5c995c690bd0 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Tue, 20 Mar 2018 17:45:34 -0700 Subject: [PATCH 18/28] [Refactor] Rename generic client (sync with updated Swagger) --- .../command_modules/locationbasedservices/_client_factory.py | 4 ++-- .../cli/command_modules/locationbasedservices/_params.py | 2 +- .../locationbasedservices/tests/latest/test_lbs_commands.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py index 062d719b90a..f2bd8b7a998 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py @@ -6,8 +6,8 @@ def cf_locationbasedservices(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client - from azure.mgmt.locationbasedservices import Client - return get_mgmt_service_client(cli_ctx, Client) + from azure.mgmt.locationbasedservices import LocationBasedServicesManagementClient + return get_mgmt_service_client(cli_ctx, LocationBasedServicesManagementClient) def cf_accounts(cli_ctx, *_): diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py index 96a2d6aa36c..5105f60bdc6 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py @@ -12,7 +12,7 @@ tags_type) from azure.cli.command_modules.locationbasedservices.validators import validate_account_name -from azure.mgmt.locationbasedservices.models.client_enums import KeyType +from azure.mgmt.locationbasedservices.models.location_based_services_management_client_enums import KeyType def load_arguments(self, _): diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py index 56949bb6643..9225ce810f2 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py @@ -6,7 +6,7 @@ import re from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from azure.mgmt.locationbasedservices.models.client_enums import KeyType +from azure.mgmt.locationbasedservices.models.location_based_services_management_client_enums import KeyType class LocationBasedServicesScenarioTests(ScenarioTest): From 1aee6b2e28279d81da03f654741ac84cbbee64d9 Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Tue, 20 Mar 2018 17:46:49 -0700 Subject: [PATCH 19/28] [Refactor] Use default SDK's function --- .../locationbasedservices/commands.py | 5 ++-- .../locationbasedservices/custom.py | 23 ------------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py index 20739b1026f..8f467744086 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py @@ -15,13 +15,12 @@ def load_command_table(self, _): operations_tmpl='azure.cli.command_modules.locationbasedservices.custom#{}') with self.command_group('locationbasedservices account', mgmt_type) as g: - g.custom_command('show', 'get_account') + g.command('show', 'get') g.custom_command('list', 'list_accounts') g.custom_command('create', 'create_account') g.command('delete', 'delete') g.generic_update_command('update', - getter_name='get_account', - getter_type=custom_type, + getter_name='get', setter_arg_name='location_based_services_account_create_parameters', custom_func_name='generic_update_account') diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py index d0e7d850c75..6f78e0c848f 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py @@ -17,29 +17,6 @@ # pylint: disable=line-too-long -def get_account(client, resource_group_name, account_name): - """Get a Location Based Services Account. - - :param resource_group_name: The name of the Azure Resource Group. - :type resource_group_name: str - :param account_name: The name of the Location Based Services Account. - :type account_name: str - :return: LocationBasedServicesAccount - :rtype: - ~azure.mgmt.locationbasedservices.models.LocationBasedServicesAccount - :raises: - :class:`ErrorException` - or :class:`ErrorException` - """ - # Retrieve ClientRawResponse from get call - out = client.get(resource_group_name, account_name, raw=True) - # Handle 404 error - if out.response.status_code == 404: - raise CLIError("The resource 'Microsoft.LocationBasedServices/accounts/" + account_name + - "' under resource group '" + resource_group_name + "' was not found.") - return out.output - - def create_account(client, resource_group_name, account_name, sku_name='S0', tags=None, agree=None): """Create a Location Based Services Account. A Location Based Services Account holds the keys which allow access to the Location From 35976e7f515491980b8a37dc06b6ccb6fdde0c5a Mon Sep 17 00:00:00 2001 From: James Park <94jamespark@gmail.com> Date: Tue, 20 Mar 2018 18:08:18 -0700 Subject: [PATCH 20/28] [Refactor] Remove Preview Terms & docs in custom.py --- .../locationbasedservices/_params.py | 9 -- .../locationbasedservices/commands.py | 2 - .../locationbasedservices/custom.py | 72 +--------- ..._create_locationbasedservices_account.yaml | 128 +++++++++--------- .../tests/latest/test_lbs_commands.py | 12 +- 5 files changed, 72 insertions(+), 151 deletions(-) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py index 5105f60bdc6..a9822c7bfdb 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py @@ -42,15 +42,6 @@ def load_arguments(self, _): c.argument('tags', arg_type=tags_type) - with self.argument_context('locationbasedservices account create') as c: - c.argument('agree', - options_list=['--agree-to-the-preview-terms'], - help='You agree to the Preview Terms. Ignore prompt for confirmation.', - action='store_true') - - with self.argument_context('locationbasedservices account update') as c: - c.ignore('agree') - # Prevent --ids argument in keys with id_part=None with self.argument_context('locationbasedservices account keys') as c: c.argument('account_name', diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py index 8f467744086..125925ce471 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py @@ -11,8 +11,6 @@ def load_command_table(self, _): mgmt_type = CliCommandType( operations_tmpl='azure.mgmt.locationbasedservices.operations.accounts_operations#AccountsOperations.{}', client_factory=cf_accounts) - custom_type = CliCommandType( - operations_tmpl='azure.cli.command_modules.locationbasedservices.custom#{}') with self.command_group('locationbasedservices account', mgmt_type) as g: g.command('show', 'get') diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py index 6f78e0c848f..1fecfc1a829 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py @@ -4,8 +4,6 @@ # -------------------------------------------------------------------------------------------- from knack.log import get_logger -from knack.prompting import prompt_y_n -from knack.util import CLIError from azure.mgmt.locationbasedservices.models import ( LocationBasedServicesAccountCreateParameters, @@ -17,65 +15,13 @@ # pylint: disable=line-too-long -def create_account(client, resource_group_name, account_name, sku_name='S0', tags=None, agree=None): - """Create a Location Based Services Account. A Location Based - Services Account holds the keys which allow access to the Location - Based Services REST APIs. - - :param resource_group_name: The name of the Azure Resource Group. - :type resource_group_name: str - :param account_name: The name of the Location Based Services Account. - :type account_name: str - :param sku_name: The name of the SKU, in standard format (such as S0). - :type sku_name: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater than 128 characters and - value no greater than 256 characters. - :type tags: dict[str, str] - :param agree: If true, user agrees to the Preview Terms. Ignore prompt - for confirmation. False otherwise. - :type agree: bool - :return: LocationBasedServicesAccount - :rtype: - ~azure.mgmt.locationbasedservices.models.LocationBasedServicesAccount - :raises: - :class:`ErrorException` - """ - # Prompt for the Preview Terms agreement. - warning_msg = 'By creating a Location Based Services account, you agree to the Microsoft Azure Preview Terms.' + \ - '\nThe Preview Terms can be found at: ' + \ - '\nhttps://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/' - logger.warning(warning_msg) - - if not agree: # ... in order to pass ScenarioTest - response = prompt_y_n('I confirm that I have read and agree to the Microsoft Azure Preview Terms.') - if not response: - raise CLIError('You must agree to the Microsoft Azure Preview Terms to create an account.') - - # Proceed if user has agreed to the Preview Terms. +def create_account(client, resource_group_name, account_name, sku_name='S0', tags=None): sku = Sku(sku_name) lbs_account_create_params = LocationBasedServicesAccountCreateParameters(ACCOUNT_LOCATION, sku, tags) return client.create_or_update(resource_group_name, account_name, lbs_account_create_params) def list_accounts(client, resource_group_name=None): - """Get all Location Based Services Accounts in a Resource Group OR in a Subscription. - - :param resource_group_name: The name of the Azure Resource Group. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of LocationBasedServicesAccount - :rtype: - ~azure.mgmt.locationbasedservices.models.LocationBasedServicesAccountPaged[~azure.mgmt.locationbasedservices.models.LocationBasedServicesAccount] - :raises: - :class:`ErrorException` - """ # Retrieve accounts via subscription if resource_group_name is None: return client.list_by_subscription() @@ -84,22 +30,6 @@ def list_accounts(client, resource_group_name=None): def generic_update_account(instance, sku_name=None, tags=None): - """Create a LocationBasedServicesCreateParameters from old account instance - with new sku_name and tags. This function is called from the - generic_update_command(...) in commands.py . - - :param sku_name: The name of the SKU, in standard format (such as S0). - :type sku_name: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater than 128 characters and - value no greater than 256 characters. - :type tags: dict[str, str] - :return: LocationBasedServicesAccountCreateParameters - :rtype: - ~azure.mgmt.locationbasedservices.models.LocationBasedServicesAccountCreateParameters - """ # Pre-populate with old instance lbs_account_create_params = LocationBasedServicesAccountCreateParameters(ACCOUNT_LOCATION, instance.sku, instance.tags) diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml index e73f4c97e4e..7646ea164b2 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml @@ -10,7 +10,7 @@ interactions: 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.26 msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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 @@ -20,7 +20,7 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:15 GMT'] + date: ['Wed, 21 Mar 2018 01:05:22 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -38,7 +38,7 @@ interactions: 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.26 msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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 @@ -48,7 +48,7 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:17 GMT'] + date: ['Wed, 21 Mar 2018 01:05:23 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -66,7 +66,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview @@ -79,7 +79,7 @@ interactions: cache-control: [no-cache] content-length: ['406'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:21 GMT'] + date: ['Wed, 21 Mar 2018 01:05:27 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -98,7 +98,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview @@ -111,7 +111,7 @@ interactions: cache-control: [no-cache] content-length: ['406'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:23 GMT'] + date: ['Wed, 21 Mar 2018 01:05:28 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -131,7 +131,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview @@ -144,7 +144,7 @@ interactions: cache-control: [no-cache] content-length: ['406'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:23 GMT'] + date: ['Wed, 21 Mar 2018 01:05:29 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -165,7 +165,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview @@ -179,7 +179,7 @@ interactions: cache-control: [no-cache] content-length: ['457'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:24 GMT'] + date: ['Wed, 21 Mar 2018 01:05:31 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -199,7 +199,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview @@ -213,7 +213,7 @@ interactions: cache-control: [no-cache] content-length: ['457'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:25 GMT'] + date: ['Wed, 21 Mar 2018 01:05:32 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -232,7 +232,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview @@ -246,7 +246,7 @@ interactions: cache-control: [no-cache] content-length: ['457'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:26 GMT'] + date: ['Wed, 21 Mar 2018 01:05:32 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -265,7 +265,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview @@ -279,7 +279,7 @@ interactions: cache-control: [no-cache] content-length: ['534'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:27 GMT'] + date: ['Wed, 21 Mar 2018 01:05:34 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -299,7 +299,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000006?api-version=2017-01-01-preview @@ -312,7 +312,7 @@ interactions: cache-control: [no-cache] content-length: ['406'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:29 GMT'] + date: ['Wed, 21 Mar 2018 01:05:36 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -331,7 +331,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000007?api-version=2017-01-01-preview @@ -344,7 +344,7 @@ interactions: cache-control: [no-cache] content-length: ['406'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:31 GMT'] + date: ['Wed, 21 Mar 2018 01:05:39 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -362,7 +362,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview @@ -380,7 +380,7 @@ interactions: cache-control: [no-cache] content-length: ['983'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:33 GMT'] + date: ['Wed, 21 Mar 2018 01:05:40 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -399,7 +399,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview @@ -413,7 +413,7 @@ interactions: cache-control: [no-cache] content-length: ['471'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:34 GMT'] + date: ['Wed, 21 Mar 2018 01:05:42 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -433,19 +433,21 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000005/listKeys?api-version=2017-01-01-preview response: body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"DZjUwV55FiXWENGVA2DCkCjrPHKB76s3wlL5IAW69qg\",\r\n\ - \ \"secondaryKey\": \"YTEcYoFxNXpcB3q5rfF2ZYtqUP-5Ax2PmnrkIM9XiPA\"\r\n}"} + ,\r\n \"primaryKey\": \"wBpB9fRVKMD32aANz2W_FlDeYm_eM0jWfDdVo3CbdqU\",\r\n\ + \ \"secondaryKey\": \"3dteq5uw_i9PyGmccxeVn_X0nObOKIvGetCp_PXKeF0\",\r\n\ + \ \"primaryKeyLastUpdated\": \"2018-03-21T01:05:26.0418034Z\",\r\n \"secondaryKeyLastUpdated\"\ + : \"2018-03-21T01:05:26.0418034Z\"\r\n}"} headers: cache-control: [no-cache] - content-length: ['360'] + content-length: ['482'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:35 GMT'] + date: ['Wed, 21 Mar 2018 01:05:43 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -466,19 +468,21 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000005/regenerateKey?api-version=2017-01-01-preview response: body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"mdUpJbiVWvnZNx-sr8ybzqzmJSWZy3MaKAyy-_lSyzY\",\r\n\ - \ \"secondaryKey\": \"YTEcYoFxNXpcB3q5rfF2ZYtqUP-5Ax2PmnrkIM9XiPA\"\r\n}"} + ,\r\n \"primaryKey\": \"VQlHeo6BqHPGXqKuLyWP8CGWPge1OfaXtpAZLXDRqcc\",\r\n\ + \ \"secondaryKey\": \"3dteq5uw_i9PyGmccxeVn_X0nObOKIvGetCp_PXKeF0\",\r\n\ + \ \"primaryKeyLastUpdated\": \"2018-03-21T01:05:45.8319164Z\",\r\n \"secondaryKeyLastUpdated\"\ + : \"2018-03-21T01:05:26.0418034Z\"\r\n}"} headers: cache-control: [no-cache] - content-length: ['360'] + content-length: ['482'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:35 GMT'] + date: ['Wed, 21 Mar 2018 01:05:45 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -499,19 +503,21 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000005/regenerateKey?api-version=2017-01-01-preview response: body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"mdUpJbiVWvnZNx-sr8ybzqzmJSWZy3MaKAyy-_lSyzY\",\r\n\ - \ \"secondaryKey\": \"Iy7R2-DrYZoZCl69nljOEVDc4iEfvdyUGEplxR2UX8c\"\r\n}"} + ,\r\n \"primaryKey\": \"VQlHeo6BqHPGXqKuLyWP8CGWPge1OfaXtpAZLXDRqcc\",\r\n\ + \ \"secondaryKey\": \"LIfdy4wFWwFqo5jjCgMMLE2EA7Y4Kdd9QIkeniitHF0\",\r\n\ + \ \"primaryKeyLastUpdated\": \"2018-03-21T01:05:45.8319164Z\",\r\n \"secondaryKeyLastUpdated\"\ + : \"2018-03-21T01:05:47.6913121Z\"\r\n}"} headers: cache-control: [no-cache] - content-length: ['360'] + content-length: ['482'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:36 GMT'] + date: ['Wed, 21 Mar 2018 01:05:47 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -532,7 +538,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview @@ -541,7 +547,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Thu, 01 Mar 2018 21:53:39 GMT'] + date: ['Wed, 21 Mar 2018 01:05:50 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -559,7 +565,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview @@ -573,7 +579,7 @@ interactions: cache-control: [no-cache] content-length: ['471'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:40 GMT'] + date: ['Wed, 21 Mar 2018 01:05:52 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -593,7 +599,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000006?api-version=2017-01-01-preview @@ -602,13 +608,13 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Thu, 01 Mar 2018 21:53:42 GMT'] + date: ['Wed, 21 Mar 2018 01:05:54 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'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 200, message: OK} - request: body: null @@ -621,7 +627,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts/cli-000007?api-version=2017-01-01-preview @@ -630,7 +636,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Thu, 01 Mar 2018 21:53:43 GMT'] + date: ['Wed, 21 Mar 2018 01:05:55 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -648,7 +654,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview @@ -658,7 +664,7 @@ interactions: cache-control: [no-cache] content-length: ['19'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:45 GMT'] + date: ['Wed, 21 Mar 2018 01:05:56 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -677,7 +683,7 @@ interactions: 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.26 msrest_azure/0.4.21 azure-mgmt-locationbasedservices/0.1.0 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview @@ -687,7 +693,7 @@ interactions: cache-control: [no-cache] content-length: ['19'] content-type: [application/json; charset=utf-8] - date: ['Thu, 01 Mar 2018 21:53:45 GMT'] + date: ['Wed, 21 Mar 2018 01:05:57 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -707,7 +713,7 @@ interactions: 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.26 msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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 @@ -716,9 +722,9 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Thu, 01 Mar 2018 21:53:47 GMT'] + date: ['Wed, 21 Mar 2018 01:05:58 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkcyQ1BHRkM0NEM0TVBPTkVMRzVDRVk3N0ZLTVI1R1AyWjNKTHw2RDRCNDQwNTQ2NEQwNEQ0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdKR1VGWVlVTk9VRENLTE1KQ0JaN1lETzJEQ1k2WUFUTFZZUHw5RkVCNjVGNjM5OEIwRTM2LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] @@ -735,7 +741,7 @@ interactions: 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.26 msrest_azure/0.4.21 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.29] + 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 @@ -744,12 +750,12 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Thu, 01 Mar 2018 21:53:48 GMT'] + date: ['Wed, 21 Mar 2018 01:05:59 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdOQVFEU0Y3Q01aTExVWU5GRk1TWUlQRDRGTEhHVVNWRjRYNnwxRTZBNkI0QTQ0MzE0QjhGLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkcyNExFMldGRFpXU0ZMVlZWUDM0UE5SSzI1UlFDVFRVTjdYQ3w4N0IyN0M1QTkzQzg2MTRCLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?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-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 202, message: Accepted} version: 1 diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py index 9225ce810f2..c431ac3f138 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py +++ b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py @@ -29,8 +29,7 @@ def test_create_locationbasedservices_account(self, resource_group): # Test 'az locationbasedservices account create'. # Test to create a LocationBasedServices account. - account = self.cmd('az locationbasedservices account create -n {name} -g {rg} --sku {sku} ' + - '--agree-to-the-preview-terms', + account = self.cmd('az locationbasedservices account create -n {name} -g {rg} --sku {sku}', checks=[ self.check('name', '{name}'), self.check('resourceGroup', '{rg}'), @@ -40,8 +39,7 @@ def test_create_locationbasedservices_account(self, resource_group): # Call create again, expect to get the same account. account_duplicated = self.cmd( - 'az locationbasedservices account create -n {name} -g {rg} --sku {sku} ' + - '--agree-to-the-preview-terms').get_output_in_json() + 'az locationbasedservices account create -n {name} -g {rg} --sku {sku}').get_output_in_json() self.assertEqual(account, account_duplicated) # Test 'az locationbasedservices account update' @@ -85,10 +83,8 @@ def test_create_locationbasedservices_account(self, resource_group): ]) # Create two new accounts (One in separate resource group). - self.cmd('az locationbasedservices account create -n {name1} -g {rg1} --sku {sku} ' + - '--agree-to-the-preview-terms') - self.cmd('az locationbasedservices account create -n {name2} -g {rg} --sku {sku} ' + - '--agree-to-the-preview-terms') + self.cmd('az locationbasedservices account create -n {name1} -g {rg1} --sku {sku}') + self.cmd('az locationbasedservices 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 locationbasedservices account list -g {rg}', checks=[ self.check('length(@)', 2), From e7784a1850100c8c25899bb9848a20571984f1a9 Mon Sep 17 00:00:00 2001 From: James Park Date: Mon, 7 May 2018 13:38:44 -0700 Subject: [PATCH 21/28] [Maps] Rename LocationBasedServices to Maps --- .../README.rst | 7 - .../locationbasedservices/_help.py | 62 -- .../HISTORY.rst | 0 .../MANIFEST.in | 0 src/command_modules/azure-cli-maps/README.rst | 7 + .../__init__.py | 0 .../azure/__init__.py | 0 .../azure/cli/__init__.py | 0 .../azure/cli/command_modules/__init__.py | 0 .../cli/command_modules/maps}/__init__.py | 18 +- .../command_modules/maps}/_client_factory.py | 4 +- .../azure/cli/command_modules/maps/_help.py | 62 ++ .../cli/command_modules/maps}/_params.py | 24 +- .../cli/command_modules/maps}/commands.py | 9 +- .../azure/cli/command_modules/maps}/custom.py | 14 +- .../command_modules/maps}/tests/__init__.py | 0 .../maps}/tests/latest/__init__.py | 0 ..._create_locationbasedservices_account.yaml | 0 .../recordings/test_create_maps_account.yaml | 741 ++++++++++++++++++ .../maps/tests/latest/test_maps_commands.py} | 70 +- .../tests/latest/test_maps_validators.py} | 2 +- .../cli/command_modules/maps}/validators.py | 0 .../azure_bdist_wheel.py | 0 .../setup.cfg | 0 .../setup.py | 6 +- 25 files changed, 884 insertions(+), 142 deletions(-) delete mode 100644 src/command_modules/azure-cli-locationbasedservices/README.rst delete mode 100644 src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py rename src/command_modules/{azure-cli-locationbasedservices => azure-cli-maps}/HISTORY.rst (100%) rename src/command_modules/{azure-cli-locationbasedservices => azure-cli-maps}/MANIFEST.in (100%) create mode 100644 src/command_modules/azure-cli-maps/README.rst rename src/command_modules/{azure-cli-locationbasedservices => azure-cli-maps}/__init__.py (100%) rename src/command_modules/{azure-cli-locationbasedservices => azure-cli-maps}/azure/__init__.py (100%) rename src/command_modules/{azure-cli-locationbasedservices => azure-cli-maps}/azure/cli/__init__.py (100%) rename src/command_modules/{azure-cli-locationbasedservices => azure-cli-maps}/azure/cli/command_modules/__init__.py (100%) rename src/command_modules/{azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices => azure-cli-maps/azure/cli/command_modules/maps}/__init__.py (50%) rename src/command_modules/{azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices => azure-cli-maps/azure/cli/command_modules/maps}/_client_factory.py (86%) create mode 100644 src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_help.py rename src/command_modules/{azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices => azure-cli-maps/azure/cli/command_modules/maps}/_params.py (61%) rename src/command_modules/{azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices => azure-cli-maps/azure/cli/command_modules/maps}/commands.py (78%) rename src/command_modules/{azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices => azure-cli-maps/azure/cli/command_modules/maps}/custom.py (75%) rename src/command_modules/{azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices => azure-cli-maps/azure/cli/command_modules/maps}/tests/__init__.py (100%) rename src/command_modules/{azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices => azure-cli-maps/azure/cli/command_modules/maps}/tests/latest/__init__.py (100%) rename src/command_modules/{azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices => azure-cli-maps/azure/cli/command_modules/maps}/tests/latest/recordings/test_create_locationbasedservices_account.yaml (100%) create mode 100644 src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/recordings/test_create_maps_account.yaml rename src/command_modules/{azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py => azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py} (65%) rename src/command_modules/{azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_validators.py => azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_validators.py} (93%) rename src/command_modules/{azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices => azure-cli-maps/azure/cli/command_modules/maps}/validators.py (100%) rename src/command_modules/{azure-cli-locationbasedservices => azure-cli-maps}/azure_bdist_wheel.py (100%) rename src/command_modules/{azure-cli-locationbasedservices => azure-cli-maps}/setup.cfg (100%) rename src/command_modules/{azure-cli-locationbasedservices => azure-cli-maps}/setup.py (90%) diff --git a/src/command_modules/azure-cli-locationbasedservices/README.rst b/src/command_modules/azure-cli-locationbasedservices/README.rst deleted file mode 100644 index d8a4975cf63..00000000000 --- a/src/command_modules/azure-cli-locationbasedservices/README.rst +++ /dev/null @@ -1,7 +0,0 @@ -Microsoft Azure CLI 'location based services' Command Module -==================================================== - -This package is for the 'location based services' module. -i.e. 'az locationbasedservices' - - diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py b/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py deleted file mode 100644 index 3023c6583ad..00000000000 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_help.py +++ /dev/null @@ -1,62 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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['locationbasedservices'] = """ - type: group - short-summary: Manage Azure Location Based Services accounts. -""" - -helps['locationbasedservices account'] = """ - type: group - short-summary: Manage Azure Location Based Services accounts. -""" - -helps['locationbasedservices account keys'] = """ - type: group - short-summary: Manage Azure Location Based Services account keys. -""" - -helps['locationbasedservices account show'] = """ - type: command - short-summary: Show the details of a Location Based Services account. -""" - -helps['locationbasedservices account list'] = """ - type: command - short-summary: Show all Location Based Services accounts in a Subscription or in a Resource Group. -""" - -helps['locationbasedservices account create'] = """ - type: command - short-summary: Create a Location Based Services account. - long-summary: | - Create a Location Based Services account. A Location Based Services account holds the keys which allow access to the Location Based Services REST APIs. -""" - -helps['locationbasedservices account update'] = """ - type: command - short-summary: Update the properties of a Location Based Services account. -""" - -helps['locationbasedservices account delete'] = """ - type: command - short-summary: Delete a Location Based Services account. -""" - -helps['locationbasedservices account keys list'] = """ - type: command - short-summary: List the keys to use with the Location Based Services APIs. - long-summary: | - List the keys to use with the Location Based Services APIs. A key is used to authenticate and authorize access to the Location Based Services REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. -""" - -helps['locationbasedservices account keys renew'] = """ - type: command - short-summary: Renew either the primary or secondary key for use with the Location Based Services APIs. - long-summary: | - Renew either the primary or secondary key for use with the Location Based Services APIs. The old key will stop working immediately. -""" diff --git a/src/command_modules/azure-cli-locationbasedservices/HISTORY.rst b/src/command_modules/azure-cli-maps/HISTORY.rst similarity index 100% rename from src/command_modules/azure-cli-locationbasedservices/HISTORY.rst rename to src/command_modules/azure-cli-maps/HISTORY.rst diff --git a/src/command_modules/azure-cli-locationbasedservices/MANIFEST.in b/src/command_modules/azure-cli-maps/MANIFEST.in similarity index 100% rename from src/command_modules/azure-cli-locationbasedservices/MANIFEST.in rename to src/command_modules/azure-cli-maps/MANIFEST.in 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-locationbasedservices/__init__.py b/src/command_modules/azure-cli-maps/__init__.py similarity index 100% rename from src/command_modules/azure-cli-locationbasedservices/__init__.py rename to src/command_modules/azure-cli-maps/__init__.py diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/__init__.py b/src/command_modules/azure-cli-maps/azure/__init__.py similarity index 100% rename from src/command_modules/azure-cli-locationbasedservices/azure/__init__.py rename to src/command_modules/azure-cli-maps/azure/__init__.py diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/__init__.py b/src/command_modules/azure-cli-maps/azure/cli/__init__.py similarity index 100% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/__init__.py rename to src/command_modules/azure-cli-maps/azure/cli/__init__.py diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/__init__.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/__init__.py similarity index 100% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/__init__.py rename to src/command_modules/azure-cli-maps/azure/cli/command_modules/__init__.py diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/__init__.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/__init__.py similarity index 50% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/__init__.py rename to src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/__init__.py index 2b6b4d45e28..5bdd63ff517 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/__init__.py +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/__init__.py @@ -5,28 +5,28 @@ from azure.cli.core import AzCommandsLoader -import azure.cli.command_modules.locationbasedservices._help # pylint: disable=unused-import -from azure.cli.command_modules.locationbasedservices._client_factory import cf_accounts +import azure.cli.command_modules.maps._help # pylint: disable=unused-import +from azure.cli.command_modules.maps._client_factory import cf_accounts -class LocationBasedServicesCommandsLoader(AzCommandsLoader): +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.locationbasedservices.custom#{}', + operations_tmpl='azure.cli.command_modules.maps.custom#{}', client_factory=cf_accounts) - super(LocationBasedServicesCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=custom_type) + super(MapsCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=custom_type) def load_command_table(self, args): - from azure.cli.command_modules.locationbasedservices.commands import load_command_table + 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.locationbasedservices._params import load_arguments + from azure.cli.command_modules.maps._params import load_arguments load_arguments(self, command) -COMMAND_LOADER_CLS = LocationBasedServicesCommandsLoader +COMMAND_LOADER_CLS = MapsCommandsLoader diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_client_factory.py similarity index 86% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py rename to src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_client_factory.py index f2bd8b7a998..bee7fd628d3 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_client_factory.py +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_client_factory.py @@ -4,11 +4,11 @@ # -------------------------------------------------------------------------------------------- -def cf_locationbasedservices(cli_ctx, *_): +def cf_maps(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.mgmt.locationbasedservices import LocationBasedServicesManagementClient return get_mgmt_service_client(cli_ctx, LocationBasedServicesManagementClient) def cf_accounts(cli_ctx, *_): - return cf_locationbasedservices(cli_ctx).accounts + 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..ec1bca90320 --- /dev/null +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_help.py @@ -0,0 +1,62 @@ +# -------------------------------------------------------------------------------------------- +# 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 accounts. +""" + +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. + long-summary: | + Create a Maps account. A Maps account holds the keys which allow access to the Maps REST APIs. +""" + +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: | + List 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. +""" + +helps['maps account keys renew'] = """ + type: command + short-summary: Renew either the primary or secondary key for use with the Maps APIs. + long-summary: | + Renew either the primary or secondary key for use with the Maps APIs. The old key will stop working immediately. +""" diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_params.py similarity index 61% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py rename to src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_params.py index a9822c7bfdb..c9b3d12f8a2 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/_params.py +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_params.py @@ -11,29 +11,29 @@ resource_group_name_type, tags_type) -from azure.cli.command_modules.locationbasedservices.validators import validate_account_name +from azure.cli.command_modules.maps.validators import validate_account_name from azure.mgmt.locationbasedservices.models.location_based_services_management_client_enums import KeyType def load_arguments(self, _): # Argument Definition - locationbasedservices_name_type = CLIArgumentType(options_list=['--name', '-n'], - completer=get_resource_name_completion_list( - 'Microsoft.LocationBasedServices/accounts'), - help='The name of the Location Based Services Account', - validator=validate_account_name) + maps_name_type = CLIArgumentType(options_list=['--name', '-n'], + completer=get_resource_name_completion_list( + 'Microsoft.Maps/accounts'), + help='The name of the Maps Account', + validator=validate_account_name) # Parameter Registration - with self.argument_context('locationbasedservices') as c: + 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=locationbasedservices_name_type) + arg_type=maps_name_type) - with self.argument_context('locationbasedservices account') as c: + with self.argument_context('maps account') as c: c.argument('sku_name', options_list=['--sku', '-s'], help='The name of the SKU, in standard format (such as S0).', @@ -43,12 +43,12 @@ def load_arguments(self, _): arg_type=tags_type) # Prevent --ids argument in keys with id_part=None - with self.argument_context('locationbasedservices account keys') as c: + with self.argument_context('maps account keys') as c: c.argument('account_name', id_part=None, - arg_type=locationbasedservices_name_type) + arg_type=maps_name_type) - with self.argument_context('locationbasedservices account keys renew') as c: + 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-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/commands.py similarity index 78% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py rename to src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/commands.py index 125925ce471..78f7c38ca35 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/commands.py +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/commands.py @@ -4,7 +4,8 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType -from azure.cli.command_modules.locationbasedservices._client_factory import cf_accounts +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, _): @@ -12,8 +13,8 @@ def load_command_table(self, _): operations_tmpl='azure.mgmt.locationbasedservices.operations.accounts_operations#AccountsOperations.{}', client_factory=cf_accounts) - with self.command_group('locationbasedservices account', mgmt_type) as g: - g.command('show', 'get') + 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') @@ -22,6 +23,6 @@ def load_command_table(self, _): setter_arg_name='location_based_services_account_create_parameters', custom_func_name='generic_update_account') - with self.command_group('locationbasedservices account keys', mgmt_type) as g: + 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-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/custom.py similarity index 75% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py rename to src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/custom.py index 1fecfc1a829..9ccd1502c83 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/custom.py +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/custom.py @@ -17,8 +17,8 @@ # pylint: disable=line-too-long def create_account(client, resource_group_name, account_name, sku_name='S0', tags=None): sku = Sku(sku_name) - lbs_account_create_params = LocationBasedServicesAccountCreateParameters(ACCOUNT_LOCATION, sku, tags) - return client.create_or_update(resource_group_name, account_name, lbs_account_create_params) + maps_account_create_params = LocationBasedServicesAccountCreateParameters(ACCOUNT_LOCATION, sku, tags) + return client.create_or_update(resource_group_name, account_name, maps_account_create_params) def list_accounts(client, resource_group_name=None): @@ -31,11 +31,11 @@ def list_accounts(client, resource_group_name=None): def generic_update_account(instance, sku_name=None, tags=None): # Pre-populate with old instance - lbs_account_create_params = LocationBasedServicesAccountCreateParameters(ACCOUNT_LOCATION, instance.sku, - instance.tags) + maps_account_create_params = LocationBasedServicesAccountCreateParameters(ACCOUNT_LOCATION, instance.sku, + instance.tags) # Update fields with new parameter values if sku_name: - lbs_account_create_params.sku.name = sku_name + maps_account_create_params.sku.name = sku_name if tags: - lbs_account_create_params.tags = tags - return lbs_account_create_params + maps_account_create_params.tags = tags + return maps_account_create_params diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/__init__.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/__init__.py similarity index 100% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/__init__.py rename to src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/__init__.py diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/__init__.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/__init__.py similarity index 100% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/__init__.py rename to src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/__init__.py diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/recordings/test_create_locationbasedservices_account.yaml similarity index 100% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/recordings/test_create_locationbasedservices_account.yaml rename to src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/recordings/test_create_locationbasedservices_account.yaml 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..9fedf4f58e4 --- /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.26 + 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: ['Wed, 21 Mar 2018 23:08:55 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.26 + 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: ['Wed, 21 Mar 2018 23:08:57 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09:01 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: ['1198'] + 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09: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 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09: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: '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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['457'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09: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] + 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['457'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09: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 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['457'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09: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.26 + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['534'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09:07 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.26 + 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.LocationBasedServices/accounts/cli-000006?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts/cli-000006\"\ + ,\r\n \"name\": \"cli-000006\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09:10 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.26 + 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.LocationBasedServices/accounts/cli-000007?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007\"\ + ,\r\n \"name\": \"cli-000007\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09:13 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.26 + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007\"\ + ,\r\n \"name\": \"cli-000007\",\r\n \"type\": \"Microsoft.LocationBasedServices/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.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['983'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09: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] + 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.26 + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts/cli-000006\"\ + ,\r\n \"name\": \"cli-000006\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['471'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09:15 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.26 + 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.LocationBasedServices/accounts/cli-000005/listKeys?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"primaryKey\": \"Xm08C4fTdkMhN7JCz2Ndy20P5DeYQAgMkD-5GV86Dh8\",\r\n\ + \ \"secondaryKey\": \"TjGidOXjerDRc6f8k7K9GaQKiq-WLXGEbqcxlDZPw9Y\",\r\n\ + \ \"primaryKeyLastUpdated\": \"2018-03-21T23:09:00.0293201Z\",\r\n \"secondaryKeyLastUpdated\"\ + : \"2018-03-21T23:09:00.0293201Z\"\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['482'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09:17 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.26 + 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.LocationBasedServices/accounts/cli-000005/regenerateKey?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"primaryKey\": \"oOd6XVecENOmn2fzzwbbUs4zcKjFdN9YO07e4Kpl6pk\",\r\n\ + \ \"secondaryKey\": \"TjGidOXjerDRc6f8k7K9GaQKiq-WLXGEbqcxlDZPw9Y\",\r\n\ + \ \"primaryKeyLastUpdated\": \"2018-03-21T23:09:17.9403457Z\",\r\n \"secondaryKeyLastUpdated\"\ + : \"2018-03-21T23:09:00.0293201Z\"\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['482'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09: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] + 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.26 + 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.LocationBasedServices/accounts/cli-000005/regenerateKey?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ + ,\r\n \"primaryKey\": \"oOd6XVecENOmn2fzzwbbUs4zcKjFdN9YO07e4Kpl6pk\",\r\n\ + \ \"secondaryKey\": \"Sf7llbskbMYIlPnc3TzCqx-qsUqVsAZGtfm9zkO4l1A\",\r\n\ + \ \"primaryKeyLastUpdated\": \"2018-03-21T23:09:17.9403457Z\",\r\n \"secondaryKeyLastUpdated\"\ + : \"2018-03-21T23:09:18.9489245Z\"\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['482'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09: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] + 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 21 Mar 2018 23:09:21 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: 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.26 + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007\"\ + ,\r\n \"name\": \"cli-000007\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['471'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09:22 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.26 + 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.LocationBasedServices/accounts/cli-000006?api-version=2017-01-01-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 21 Mar 2018 23:09:24 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: 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.26 + 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.LocationBasedServices/accounts/cli-000007?api-version=2017-01-01-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 21 Mar 2018 23:09:26 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: 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.26 + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"value\": []\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['19'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09:27 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.26 + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview + response: + body: {string: "{\r\n \"value\": []\r\n}"} + headers: + cache-control: [no-cache] + content-length: ['19'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 21 Mar 2018 23:09:28 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.26 + 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: ['Wed, 21 Mar 2018 23:09:30 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdRWENMWFJMT081NkpYTzRLVlZSSVBMRkFFSlJNTFdYSTUyUXw4QkZDNEM2NTUyMDM0MDlGLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?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-writes: ['1199'] + 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.26 + 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: ['Wed, 21 Mar 2018 23:09:30 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkczWU5CNUhTTjNENlRSTEtUTFQ3QkREV1ZTQ080Q0dWU0JGRHw4MUIwQTI5MEM0RERGRTAxLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?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-writes: ['1199'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py similarity index 65% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py rename to src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py index c431ac3f138..287d52bc979 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_commands.py +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py @@ -9,11 +9,11 @@ from azure.mgmt.locationbasedservices.models.location_based_services_management_client_enums import KeyType -class LocationBasedServicesScenarioTests(ScenarioTest): +class MapsScenarioTests(ScenarioTest): @ResourceGroupPreparer(key='rg') @ResourceGroupPreparer(key='rg1') - def test_create_locationbasedservices_account(self, resource_group): + 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) @@ -27,9 +27,9 @@ def test_create_locationbasedservices_account(self, resource_group): 'key_type_secondary': KeyType.secondary.value }) - # Test 'az locationbasedservices account create'. - # Test to create a LocationBasedServices account. - account = self.cmd('az locationbasedservices account create -n {name} -g {rg} --sku {sku}', + # 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}'), @@ -39,12 +39,12 @@ def test_create_locationbasedservices_account(self, resource_group): # Call create again, expect to get the same account. account_duplicated = self.cmd( - 'az locationbasedservices account create -n {name} -g {rg} --sku {sku}').get_output_in_json() + 'az maps account create -n {name} -g {rg} --sku {sku}').get_output_in_json() self.assertEqual(account, account_duplicated) - # Test 'az locationbasedservices account update' + # Test 'az maps account update' # Test to add a new tag to an existing account. - self.cmd('az locationbasedservices account update -n {name} -g {rg} --sku {sku} --tags {tags}', + self.cmd('az maps account update -n {name} -g {rg} --sku {sku} --tags {tags}', checks=[ self.check('id', account['id']), self.check('name', '{name}'), @@ -53,16 +53,16 @@ def test_create_locationbasedservices_account(self, resource_group): self.check('tags', {tag_key: tag_value}) ]) - # Test 'az locationbasedservices account show'. - # Test to get information on LocationBasedServices account. - self.cmd('az locationbasedservices account show -n {name} -g {rg}', checks=[ + # 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 locationbasedservices account show --ids ' + account['id'], checks=[ + self.cmd('az maps account show --ids ' + account['id'], checks=[ self.check('id', account['id']), self.check('name', '{name}'), self.check('resourceGroup', '{rg}'), @@ -70,9 +70,9 @@ def test_create_locationbasedservices_account(self, resource_group): self.check('tags', {tag_key: tag_value}) ]) - # Test 'az locationbasedservices account list'. - # Test to list all LocationBasedServices accounts under a resource group. - self.cmd('az locationbasedservices account list -g {rg}', checks=[ + # 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']), @@ -83,10 +83,10 @@ def test_create_locationbasedservices_account(self, resource_group): ]) # Create two new accounts (One in separate resource group). - self.cmd('az locationbasedservices account create -n {name1} -g {rg1} --sku {sku}') - self.cmd('az locationbasedservices account create -n {name2} -g {rg} --sku {sku}') + 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 locationbasedservices account list -g {rg}', checks=[ + self.cmd('az maps account list -g {rg}', checks=[ self.check('length(@)', 2), self.check('type(@)', 'array'), self.check("length([?name == '{name}'])", 1), @@ -95,7 +95,7 @@ def test_create_locationbasedservices_account(self, resource_group): self.check("length([?resourceGroup == '{rg}'])", 2), self.check("length([?resourceGroup == '{rg1}'])", 0) ]) - self.cmd('az locationbasedservices account list -g {rg1}', checks=[ + self.cmd('az maps account list -g {rg1}', checks=[ self.check('length(@)', 1), self.check('type(@)', 'array'), self.check("length([?name == '{name}'])", 0), @@ -105,9 +105,9 @@ def test_create_locationbasedservices_account(self, resource_group): self.check("length([?resourceGroup == '{rg1}'])", 1) ]) - # Test 'az locationbasedservices account key list'. - # Test to list keys for an LocationBasedServices account. - account_key_list = self.cmd('az locationbasedservices account keys list -n {name} -g {rg}', checks=[ + # 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() @@ -118,10 +118,10 @@ def test_create_locationbasedservices_account(self, resource_group): self.assertTrue(re.match('^[a-zA-Z0-9_-]+$', primary_key_old)) self.assertTrue(re.match('^[a-zA-Z0-9_-]+$', secondary_key_old)) - # Test 'az locationbasedservices account key regenerate'. - # Test to change primary and secondary keys for an LocationBasedServices account. + # Test 'az maps account key regenerate'. + # Test to change primary and secondary keys for a Maps account. key_regenerated = self.cmd( - 'az locationbasedservices account keys renew -n {name} -g {rg} --key {key_type_primary}', checks=[ + '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() @@ -133,22 +133,22 @@ def test_create_locationbasedservices_account(self, resource_group): # Save the new primary key, and regenerate the secondary key. primary_key_old = key_regenerated['primaryKey'] key_regenerated = self.cmd( - 'az locationbasedservices account keys renew -n {name} -g {rg} --key {key_type_secondary}') \ + '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 locationbasedservices account delete'. - # Test to remove an LocationBasedServices account. - self.cmd('az locationbasedservices account delete -n {name} -g {rg}', checks=self.is_empty()) - self.cmd('az locationbasedservices account list -g {rg}', checks=[ + # 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 LocationBasedServices accounts. - exit_code = self.cmd('az locationbasedservices account delete -n {name1} -g {rg1}').exit_code + # 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 locationbasedservices account delete -n {name2} -g {rg}') - self.cmd('az locationbasedservices account list -g {rg}', checks=self.is_empty()) - self.cmd('az locationbasedservices account list -g {rg1}', checks=self.is_empty()) + 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-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_validators.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_validators.py similarity index 93% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_validators.py rename to src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_validators.py index 3ad45a052c0..8d49cc64faa 100644 --- a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/tests/latest/test_lbs_validators.py +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_validators.py @@ -7,7 +7,7 @@ from argparse import Namespace from knack.util import CLIError -from azure.cli.command_modules.locationbasedservices.validators import validate_account_name, ACCOUNT_NAME_MAX_LENGTH +from azure.cli.command_modules.maps.validators import validate_account_name, ACCOUNT_NAME_MAX_LENGTH class TestValidators(unittest.TestCase): diff --git a/src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/validators.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/validators.py similarity index 100% rename from src/command_modules/azure-cli-locationbasedservices/azure/cli/command_modules/locationbasedservices/validators.py rename to src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/validators.py diff --git a/src/command_modules/azure-cli-locationbasedservices/azure_bdist_wheel.py b/src/command_modules/azure-cli-maps/azure_bdist_wheel.py similarity index 100% rename from src/command_modules/azure-cli-locationbasedservices/azure_bdist_wheel.py rename to src/command_modules/azure-cli-maps/azure_bdist_wheel.py diff --git a/src/command_modules/azure-cli-locationbasedservices/setup.cfg b/src/command_modules/azure-cli-maps/setup.cfg similarity index 100% rename from src/command_modules/azure-cli-locationbasedservices/setup.cfg rename to src/command_modules/azure-cli-maps/setup.cfg diff --git a/src/command_modules/azure-cli-locationbasedservices/setup.py b/src/command_modules/azure-cli-maps/setup.py similarity index 90% rename from src/command_modules/azure-cli-locationbasedservices/setup.py rename to src/command_modules/azure-cli-maps/setup.py index 5a8a3a89f39..43b49472fa9 100644 --- a/src/command_modules/azure-cli-locationbasedservices/setup.py +++ b/src/command_modules/azure-cli-maps/setup.py @@ -41,9 +41,9 @@ HISTORY = f.read() setup( - name='azure-cli-locationbasedservices', + name='azure-cli-maps', version=VERSION, - description='Microsoft Azure Command-Line Tools Location Based Services Command Module', + description='Microsoft Azure Command-Line Tools Maps Command Module', long_description=README + '\n\n' + HISTORY, license='MIT', author='Microsoft Corporation', @@ -54,7 +54,7 @@ 'azure', 'azure.cli', 'azure.cli.command_modules', - 'azure.cli.command_modules.locationbasedservices' + 'azure.cli.command_modules.maps' ], install_requires=DEPENDENCIES, cmdclass=cmdclass From f9ca47da5ee1a311a0c4bfa615e8860fb38dec25 Mon Sep 17 00:00:00 2001 From: James Park Date: Mon, 7 May 2018 15:31:54 -0700 Subject: [PATCH 22/28] [Maps] Use Maps SDK from LocationBasedServices SDK --- .../command_modules/maps/_client_factory.py | 4 +- .../azure/cli/command_modules/maps/_params.py | 2 +- .../cli/command_modules/maps/commands.py | 4 +- .../azure/cli/command_modules/maps/custom.py | 12 +- .../recordings/test_create_maps_account.yaml | 258 +++++++++--------- .../maps/tests/latest/test_maps_commands.py | 2 +- 6 files changed, 141 insertions(+), 141 deletions(-) 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 index bee7fd628d3..96c1a3ca3b7 100644 --- 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 @@ -6,8 +6,8 @@ def cf_maps(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client - from azure.mgmt.locationbasedservices import LocationBasedServicesManagementClient - return get_mgmt_service_client(cli_ctx, LocationBasedServicesManagementClient) + from azure.mgmt.maps import MapsManagementClient + return get_mgmt_service_client(cli_ctx, MapsManagementClient) def cf_accounts(cli_ctx, *_): 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 index c9b3d12f8a2..c6c5dc4b449 100644 --- 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 @@ -12,7 +12,7 @@ tags_type) from azure.cli.command_modules.maps.validators import validate_account_name -from azure.mgmt.locationbasedservices.models.location_based_services_management_client_enums import KeyType +from azure.mgmt.maps.models.maps_management_client_enums import KeyType def load_arguments(self, _): 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 index 78f7c38ca35..2d74cb6c5b1 100644 --- 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 @@ -10,7 +10,7 @@ def load_command_table(self, _): mgmt_type = CliCommandType( - operations_tmpl='azure.mgmt.locationbasedservices.operations.accounts_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: @@ -20,7 +20,7 @@ def load_command_table(self, _): g.command('delete', 'delete') g.generic_update_command('update', getter_name='get', - setter_arg_name='location_based_services_account_create_parameters', + setter_arg_name='maps_account_create_parameters', custom_func_name='generic_update_account') with self.command_group('maps account keys', mgmt_type) as g: 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 index 9ccd1502c83..f39b91e6f2c 100644 --- 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 @@ -5,8 +5,8 @@ from knack.log import get_logger -from azure.mgmt.locationbasedservices.models import ( - LocationBasedServicesAccountCreateParameters, +from azure.mgmt.maps.models import ( + MapsAccountCreateParameters, Sku) ACCOUNT_LOCATION = 'global' @@ -16,8 +16,8 @@ # pylint: disable=line-too-long def create_account(client, resource_group_name, account_name, sku_name='S0', tags=None): - sku = Sku(sku_name) - maps_account_create_params = LocationBasedServicesAccountCreateParameters(ACCOUNT_LOCATION, sku, tags) + 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) @@ -31,8 +31,8 @@ def list_accounts(client, resource_group_name=None): def generic_update_account(instance, sku_name=None, tags=None): # Pre-populate with old instance - maps_account_create_params = LocationBasedServicesAccountCreateParameters(ACCOUNT_LOCATION, instance.sku, - instance.tags) + 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 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 index 9fedf4f58e4..77d4b90c1cf 100644 --- 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 @@ -8,7 +8,7 @@ interactions: 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.26 + 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] @@ -20,7 +20,7 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:08:55 GMT'] + date: ['Mon, 07 May 2018 22:14:34 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -36,7 +36,7 @@ interactions: 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.26 + 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] @@ -48,7 +48,7 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:08:57 GMT'] + date: ['Mon, 07 May 2018 22:14:35 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -64,21 +64,21 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + 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: ['406'] + content-length: ['372'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:01 GMT'] + date: ['Mon, 07 May 2018 22:14:39 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -95,21 +95,21 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + 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: ['406'] + content-length: ['372'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:02 GMT'] + date: ['Mon, 07 May 2018 22:14:40 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -127,21 +127,21 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + 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: ['406'] + content-length: ['372'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:04 GMT'] + date: ['Mon, 07 May 2018 22:14:40 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -160,22 +160,22 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + 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: ['457'] + content-length: ['423'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:04 GMT'] + date: ['Mon, 07 May 2018 22:14:42 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -183,7 +183,7 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 200, message: OK} - request: body: null @@ -193,22 +193,22 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + 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: ['457'] + content-length: ['423'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:06 GMT'] + date: ['Mon, 07 May 2018 22:14:43 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -225,22 +225,22 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + 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: ['457'] + content-length: ['423'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:06 GMT'] + date: ['Mon, 07 May 2018 22:14:44 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -257,22 +257,22 @@ interactions: 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.26 + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + 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: ['534'] + content-length: ['500'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:07 GMT'] + date: ['Mon, 07 May 2018 22:14:46 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -290,21 +290,21 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000006?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000006\"\ - ,\r\n \"name\": \"cli-000006\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + 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: ['406'] + content-length: ['372'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:10 GMT'] + date: ['Mon, 07 May 2018 22:14:47 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -321,21 +321,21 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000007?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000007\"\ - ,\r\n \"name\": \"cli-000007\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + 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: ['406'] + content-length: ['372'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:13 GMT'] + date: ['Mon, 07 May 2018 22:14:50 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -351,26 +351,26 @@ interactions: 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.26 + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000007\"\ - ,\r\n \"name\": \"cli-000007\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + 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.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + \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: ['983'] + content-length: ['915'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:14 GMT'] + date: ['Mon, 07 May 2018 22:14:51 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -387,22 +387,22 @@ interactions: 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.26 + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000006\"\ - ,\r\n \"name\": \"cli-000006\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + 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: ['471'] + content-length: ['437'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:15 GMT'] + date: ['Mon, 07 May 2018 22:14:52 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -420,22 +420,22 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000005/listKeys?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"Xm08C4fTdkMhN7JCz2Ndy20P5DeYQAgMkD-5GV86Dh8\",\r\n\ - \ \"secondaryKey\": \"TjGidOXjerDRc6f8k7K9GaQKiq-WLXGEbqcxlDZPw9Y\",\r\n\ - \ \"primaryKeyLastUpdated\": \"2018-03-21T23:09:00.0293201Z\",\r\n \"secondaryKeyLastUpdated\"\ - : \"2018-03-21T23:09:00.0293201Z\"\r\n}"} + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ + ,\r\n \"primaryKey\": \"LgXfqacv_ceGcIbM6z5cgdYUbXxL6kmXreuvRAmg0UY\",\r\n\ + \ \"secondaryKey\": \"-1lOjejbEo19WPTzExLqY6BYwQzhE0otaOGpdToRt5U\",\r\n\ + \ \"primaryKeyLastUpdated\": \"2018-05-07T22:14:37.0904343Z\",\r\n \"secondaryKeyLastUpdated\"\ + : \"2018-05-07T22:14:37.0904343Z\"\r\n}"} headers: cache-control: [no-cache] - content-length: ['482'] + content-length: ['465'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:17 GMT'] + date: ['Mon, 07 May 2018 22:14:53 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -454,22 +454,22 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000005/regenerateKey?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"oOd6XVecENOmn2fzzwbbUs4zcKjFdN9YO07e4Kpl6pk\",\r\n\ - \ \"secondaryKey\": \"TjGidOXjerDRc6f8k7K9GaQKiq-WLXGEbqcxlDZPw9Y\",\r\n\ - \ \"primaryKeyLastUpdated\": \"2018-03-21T23:09:17.9403457Z\",\r\n \"secondaryKeyLastUpdated\"\ - : \"2018-03-21T23:09:00.0293201Z\"\r\n}"} + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ + ,\r\n \"primaryKey\": \"v9Mir1-nDO6-RFlpDhtFGt4VI_arackJUDBoW6S0Es4\",\r\n\ + \ \"secondaryKey\": \"-1lOjejbEo19WPTzExLqY6BYwQzhE0otaOGpdToRt5U\",\r\n\ + \ \"primaryKeyLastUpdated\": \"2018-05-07T22:14:54.0275093Z\",\r\n \"secondaryKeyLastUpdated\"\ + : \"2018-05-07T22:14:37.0904343Z\"\r\n}"} headers: cache-control: [no-cache] - content-length: ['482'] + content-length: ['465'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:18 GMT'] + date: ['Mon, 07 May 2018 22:14:54 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -488,22 +488,22 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000005/regenerateKey?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"oOd6XVecENOmn2fzzwbbUs4zcKjFdN9YO07e4Kpl6pk\",\r\n\ - \ \"secondaryKey\": \"Sf7llbskbMYIlPnc3TzCqx-qsUqVsAZGtfm9zkO4l1A\",\r\n\ - \ \"primaryKeyLastUpdated\": \"2018-03-21T23:09:17.9403457Z\",\r\n \"secondaryKeyLastUpdated\"\ - : \"2018-03-21T23:09:18.9489245Z\"\r\n}"} + body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Maps/accounts/cli-000005\"\ + ,\r\n \"primaryKey\": \"v9Mir1-nDO6-RFlpDhtFGt4VI_arackJUDBoW6S0Es4\",\r\n\ + \ \"secondaryKey\": \"dsEtDZdAmKpJOH8hza78dcXSmFc7Zekum4mEycrZaqM\",\r\n\ + \ \"primaryKeyLastUpdated\": \"2018-05-07T22:14:54.0275093Z\",\r\n \"secondaryKeyLastUpdated\"\ + : \"2018-05-07T22:14:55.2184763Z\"\r\n}"} headers: cache-control: [no-cache] - content-length: ['482'] + content-length: ['465'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:18 GMT'] + date: ['Mon, 07 May 2018 22:14:55 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -522,17 +522,17 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview + 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: ['Wed, 21 Mar 2018 23:09:21 GMT'] + date: ['Mon, 07 May 2018 22:14:58 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -548,22 +548,22 @@ interactions: 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.26 + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview + 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.LocationBasedServices/accounts/cli-000007\"\ - ,\r\n \"name\": \"cli-000007\",\r\n \"type\": \"Microsoft.LocationBasedServices/accounts\"\ + 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: ['471'] + content-length: ['437'] content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 23:09:22 GMT'] + date: ['Mon, 07 May 2018 22:14:58 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -581,23 +581,23 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000006?api-version=2017-01-01-preview + 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: ['Wed, 21 Mar 2018 23:09:24 GMT'] + date: ['Mon, 07 May 2018 22:15:00 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'] + x-ms-ratelimit-remaining-subscription-deletes: ['14999'] status: {code: 200, message: OK} - request: body: null @@ -608,17 +608,17 @@ interactions: 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.26 + 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.LocationBasedServices/accounts/cli-000007?api-version=2017-01-01-preview + 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: ['Wed, 21 Mar 2018 23:09:26 GMT'] + date: ['Mon, 07 May 2018 22:15:02 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -634,18 +634,18 @@ interactions: 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.26 + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview + 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: ['Wed, 21 Mar 2018 23:09:27 GMT'] + date: ['Mon, 07 May 2018 22:15:04 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -662,18 +662,18 @@ interactions: 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.26 + 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.LocationBasedServices/accounts?api-version=2017-01-01-preview + 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: ['Wed, 21 Mar 2018 23:09:28 GMT'] + date: ['Mon, 07 May 2018 22:15:04 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -691,7 +691,7 @@ interactions: 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.26 + 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] @@ -702,9 +702,9 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 21 Mar 2018 23:09:30 GMT'] + date: ['Mon, 07 May 2018 22:15:06 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdRWENMWFJMT081NkpYTzRLVlZSSVBMRkFFSlJNTFdYSTUyUXw4QkZDNEM2NTUyMDM0MDlGLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkc1SDJKT1lBWEpXRVNFVTVETzZDUkdQT001NU9HMzRMRlUzSXxDMDE2OTA0MEM1QzIwMTA0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] @@ -719,7 +719,7 @@ interactions: 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.26 + 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] @@ -730,12 +730,12 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 21 Mar 2018 23:09:30 GMT'] + date: ['Mon, 07 May 2018 22:15:07 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkczWU5CNUhTTjNENlRSTEtUTFQ3QkREV1ZTQ080Q0dWU0JGRHw4MUIwQTI5MEM0RERGRTAxLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdFWVZNVjU2WUlDNDNWN1YyRTNJTU9IUUtISEc0M0hONlQ0VnxBQ0JDMzgyQzZCQzI4MjRGLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?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-writes: ['1199'] + 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 index 287d52bc979..edba266d7c8 100644 --- 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 @@ -6,7 +6,7 @@ import re from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from azure.mgmt.locationbasedservices.models.location_based_services_management_client_enums import KeyType +from azure.mgmt.maps.models.maps_management_client_enums import KeyType class MapsScenarioTests(ScenarioTest): From 52b9ddec55d2c9603af1ca18c9f3ef23023dad17 Mon Sep 17 00:00:00 2001 From: James Park Date: Mon, 7 May 2018 15:42:28 -0700 Subject: [PATCH 23/28] [Maps] Update dependencies --- ..._create_locationbasedservices_account.yaml | 761 ------------------ .../recordings/test_create_maps_account.yaml | 86 +- src/command_modules/azure-cli-maps/setup.py | 2 +- 3 files changed, 44 insertions(+), 805 deletions(-) delete mode 100644 src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/recordings/test_create_locationbasedservices_account.yaml diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/recordings/test_create_locationbasedservices_account.yaml b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/recordings/test_create_locationbasedservices_account.yaml deleted file mode 100644 index 7646ea164b2..00000000000 --- a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/recordings/test_create_locationbasedservices_account.yaml +++ /dev/null @@ -1,761 +0,0 @@ -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.26 - 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: ['Wed, 21 Mar 2018 01:05:22 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.26 - 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: ['Wed, 21 Mar 2018 01:05:23 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:27 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:28 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:29 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['457'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:31 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['457'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:32 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['457'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:32 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['534'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:34 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000006?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts/cli-000006\"\ - ,\r\n \"name\": \"cli-000006\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:36 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000007?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007\"\ - ,\r\n \"name\": \"cli-000007\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['406'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:39 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007\"\ - ,\r\n \"name\": \"cli-000007\",\r\n \"type\": \"Microsoft.LocationBasedServices/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.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"name\": \"cli-000005\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['983'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:40 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.LocationBasedServices/accounts/cli-000006\"\ - ,\r\n \"name\": \"cli-000006\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['471'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:42 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000005/listKeys?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"wBpB9fRVKMD32aANz2W_FlDeYm_eM0jWfDdVo3CbdqU\",\r\n\ - \ \"secondaryKey\": \"3dteq5uw_i9PyGmccxeVn_X0nObOKIvGetCp_PXKeF0\",\r\n\ - \ \"primaryKeyLastUpdated\": \"2018-03-21T01:05:26.0418034Z\",\r\n \"secondaryKeyLastUpdated\"\ - : \"2018-03-21T01:05:26.0418034Z\"\r\n}"} - headers: - cache-control: [no-cache] - content-length: ['482'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:43 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000005/regenerateKey?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"VQlHeo6BqHPGXqKuLyWP8CGWPge1OfaXtpAZLXDRqcc\",\r\n\ - \ \"secondaryKey\": \"3dteq5uw_i9PyGmccxeVn_X0nObOKIvGetCp_PXKeF0\",\r\n\ - \ \"primaryKeyLastUpdated\": \"2018-03-21T01:05:45.8319164Z\",\r\n \"secondaryKeyLastUpdated\"\ - : \"2018-03-21T01:05:26.0418034Z\"\r\n}"} - headers: - cache-control: [no-cache] - content-length: ['482'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:45 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000005/regenerateKey?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000005\"\ - ,\r\n \"primaryKey\": \"VQlHeo6BqHPGXqKuLyWP8CGWPge1OfaXtpAZLXDRqcc\",\r\n\ - \ \"secondaryKey\": \"LIfdy4wFWwFqo5jjCgMMLE2EA7Y4Kdd9QIkeniitHF0\",\r\n\ - \ \"primaryKeyLastUpdated\": \"2018-03-21T01:05:45.8319164Z\",\r\n \"secondaryKeyLastUpdated\"\ - : \"2018-03-21T01:05:47.6913121Z\"\r\n}"} - headers: - cache-control: [no-cache] - content-length: ['482'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:47 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000005?api-version=2017-01-01-preview - response: - body: {string: ''} - headers: - cache-control: [no-cache] - content-length: ['0'] - date: ['Wed, 21 Mar 2018 01:05:50 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: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - CommandName: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.LocationBasedServices/accounts/cli-000007\"\ - ,\r\n \"name\": \"cli-000007\",\r\n \"type\": \"Microsoft.LocationBasedServices/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: ['471'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:52 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000006?api-version=2017-01-01-preview - response: - body: {string: ''} - headers: - cache-control: [no-cache] - content-length: ['0'] - date: ['Wed, 21 Mar 2018 01:05:54 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: ['1198'] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - CommandName: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts/cli-000007?api-version=2017-01-01-preview - response: - body: {string: ''} - headers: - cache-control: [no-cache] - content-length: ['0'] - date: ['Wed, 21 Mar 2018 01:05:55 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: 200, message: OK} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - CommandName: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"value\": []\r\n}"} - headers: - cache-control: [no-cache] - content-length: ['19'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:56 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: [locationbasedservices 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.26 - msrest_azure/0.4.21 azure-mgmt-locationbasedservices/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.LocationBasedServices/accounts?api-version=2017-01-01-preview - response: - body: {string: "{\r\n \"value\": []\r\n}"} - headers: - cache-control: [no-cache] - content-length: ['19'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 21 Mar 2018 01:05:57 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.26 - 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: ['Wed, 21 Mar 2018 01:05:58 GMT'] - expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdKR1VGWVlVTk9VRENLTE1KQ0JaN1lETzJEQ1k2WUFUTFZZUHw5RkVCNjVGNjM5OEIwRTM2LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?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-writes: ['1199'] - 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.26 - 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: ['Wed, 21 Mar 2018 01:05:59 GMT'] - expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkcyNExFMldGRFpXU0ZMVlZWUDM0UE5SSzI1UlFDVFRVTjdYQ3w4N0IyN0M1QTkzQzg2MTRCLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?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-writes: ['1199'] - status: {code: 202, message: Accepted} -version: 1 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 index 77d4b90c1cf..9cc1ab71f27 100644 --- 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 @@ -20,7 +20,7 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:34 GMT'] + date: ['Mon, 07 May 2018 22:39:53 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -48,7 +48,7 @@ interactions: cache-control: [no-cache] content-length: ['328'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:35 GMT'] + date: ['Mon, 07 May 2018 22:39:54 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -78,13 +78,13 @@ interactions: cache-control: [no-cache] content-length: ['372'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:39 GMT'] + 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: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 201, message: Created} - request: body: '{"location": "global", "sku": {"name": "S0"}}' @@ -109,7 +109,7 @@ interactions: cache-control: [no-cache] content-length: ['372'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:40 GMT'] + date: ['Mon, 07 May 2018 22:39:59 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -141,7 +141,7 @@ interactions: cache-control: [no-cache] content-length: ['372'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:40 GMT'] + date: ['Mon, 07 May 2018 22:40:00 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -175,7 +175,7 @@ interactions: cache-control: [no-cache] content-length: ['423'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:42 GMT'] + date: ['Mon, 07 May 2018 22:40:02 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -183,7 +183,7 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: body: null @@ -208,7 +208,7 @@ interactions: cache-control: [no-cache] content-length: ['423'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:43 GMT'] + date: ['Mon, 07 May 2018 22:40:03 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -240,7 +240,7 @@ interactions: cache-control: [no-cache] content-length: ['423'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:44 GMT'] + date: ['Mon, 07 May 2018 22:40:03 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -272,7 +272,7 @@ interactions: cache-control: [no-cache] content-length: ['500'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:46 GMT'] + date: ['Mon, 07 May 2018 22:40:04 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -304,7 +304,7 @@ interactions: cache-control: [no-cache] content-length: ['372'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:47 GMT'] + date: ['Mon, 07 May 2018 22:40:06 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -335,7 +335,7 @@ interactions: cache-control: [no-cache] content-length: ['372'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:50 GMT'] + date: ['Mon, 07 May 2018 22:40:09 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -370,7 +370,7 @@ interactions: cache-control: [no-cache] content-length: ['915'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:51 GMT'] + date: ['Mon, 07 May 2018 22:40:10 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -402,7 +402,7 @@ interactions: cache-control: [no-cache] content-length: ['437'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:52 GMT'] + date: ['Mon, 07 May 2018 22:40:11 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -427,15 +427,15 @@ interactions: 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\": \"LgXfqacv_ceGcIbM6z5cgdYUbXxL6kmXreuvRAmg0UY\",\r\n\ - \ \"secondaryKey\": \"-1lOjejbEo19WPTzExLqY6BYwQzhE0otaOGpdToRt5U\",\r\n\ - \ \"primaryKeyLastUpdated\": \"2018-05-07T22:14:37.0904343Z\",\r\n \"secondaryKeyLastUpdated\"\ - : \"2018-05-07T22:14:37.0904343Z\"\r\n}"} + ,\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:14:53 GMT'] + date: ['Mon, 07 May 2018 22:40:11 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -461,15 +461,15 @@ interactions: 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\": \"v9Mir1-nDO6-RFlpDhtFGt4VI_arackJUDBoW6S0Es4\",\r\n\ - \ \"secondaryKey\": \"-1lOjejbEo19WPTzExLqY6BYwQzhE0otaOGpdToRt5U\",\r\n\ - \ \"primaryKeyLastUpdated\": \"2018-05-07T22:14:54.0275093Z\",\r\n \"secondaryKeyLastUpdated\"\ - : \"2018-05-07T22:14:37.0904343Z\"\r\n}"} + ,\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:14:54 GMT'] + date: ['Mon, 07 May 2018 22:40:13 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -495,15 +495,15 @@ interactions: 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\": \"v9Mir1-nDO6-RFlpDhtFGt4VI_arackJUDBoW6S0Es4\",\r\n\ - \ \"secondaryKey\": \"dsEtDZdAmKpJOH8hza78dcXSmFc7Zekum4mEycrZaqM\",\r\n\ - \ \"primaryKeyLastUpdated\": \"2018-05-07T22:14:54.0275093Z\",\r\n \"secondaryKeyLastUpdated\"\ - : \"2018-05-07T22:14:55.2184763Z\"\r\n}"} + ,\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:14:55 GMT'] + date: ['Mon, 07 May 2018 22:40:14 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -532,13 +532,13 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Mon, 07 May 2018 22:14:58 GMT'] + 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-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-deletes: ['14999'] status: {code: 200, message: OK} - request: body: null @@ -563,7 +563,7 @@ interactions: cache-control: [no-cache] content-length: ['437'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:14:58 GMT'] + date: ['Mon, 07 May 2018 22:40:18 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -591,7 +591,7 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Mon, 07 May 2018 22:15:00 GMT'] + date: ['Mon, 07 May 2018 22:41:02 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -618,13 +618,13 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Mon, 07 May 2018 22:15:02 GMT'] + 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-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-deletes: ['14999'] status: {code: 200, message: OK} - request: body: null @@ -645,7 +645,7 @@ interactions: cache-control: [no-cache] content-length: ['19'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:15:04 GMT'] + date: ['Mon, 07 May 2018 22:41:06 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -673,7 +673,7 @@ interactions: cache-control: [no-cache] content-length: ['19'] content-type: [application/json; charset=utf-8] - date: ['Mon, 07 May 2018 22:15:04 GMT'] + date: ['Mon, 07 May 2018 22:41:06 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -702,13 +702,13 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Mon, 07 May 2018 22:15:06 GMT'] + date: ['Mon, 07 May 2018 22:41:07 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkc1SDJKT1lBWEpXRVNFVTVETzZDUkdQT001NU9HMzRMRlUzSXxDMDE2OTA0MEM1QzIwMTA0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + 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-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-deletes: ['14999'] status: {code: 202, message: Accepted} - request: body: null @@ -730,9 +730,9 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Mon, 07 May 2018 22:15:07 GMT'] + date: ['Mon, 07 May 2018 22:41:08 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdFWVZNVjU2WUlDNDNWN1YyRTNJTU9IUUtISEc0M0hONlQ0VnxBQ0JDMzgyQzZCQzI4MjRGLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + 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] diff --git a/src/command_modules/azure-cli-maps/setup.py b/src/command_modules/azure-cli-maps/setup.py index 43b49472fa9..a843d67d00f 100644 --- a/src/command_modules/azure-cli-maps/setup.py +++ b/src/command_modules/azure-cli-maps/setup.py @@ -32,7 +32,7 @@ DEPENDENCIES = [ 'azure-cli-core', - 'azure-mgmt-locationbasedservices==0.1.0' + 'azure-mgmt-maps==0.1.0' ] with open('README.rst', 'r', encoding='utf-8') as f: From c0c8bb88eb5d9bbe7035ab5ee3e59c55654ea597 Mon Sep 17 00:00:00 2001 From: James Park Date: Mon, 7 May 2018 16:25:46 -0700 Subject: [PATCH 24/28] [Maps] Resolving build error (doc_source_map) --- doc/sphinx/azhelpgen/doc_source_map.json | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/sphinx/azhelpgen/doc_source_map.json b/doc/sphinx/azhelpgen/doc_source_map.json index ea2d5369ad0..c89e0fbcdc9 100644 --- a/doc/sphinx/azhelpgen/doc_source_map.json +++ b/doc/sphinx/azhelpgen/doc_source_map.json @@ -30,6 +30,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", From c6c5c02fd98c59b02109aebd6f48c9338d6e3242 Mon Sep 17 00:00:00 2001 From: James Park Date: Wed, 9 May 2018 00:20:46 -0700 Subject: [PATCH 25/28] [Maps] Resolving PR issues. Removed validators.py. Will be adding checks in REST API specs and our backend routes to avoid redundancy. Updated azure_bdist_wheel.py Introduced minor fixes. --- .../azure/cli/command_modules/maps/_params.py | 10 +- .../azure/cli/command_modules/maps/custom.py | 1 - .../maps/tests/latest/test_maps_validators.py | 46 -- .../cli/command_modules/maps/validators.py | 26 - .../azure-cli-maps/azure_bdist_wheel.py | 493 +----------------- 5 files changed, 10 insertions(+), 566 deletions(-) delete mode 100644 src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_validators.py delete mode 100644 src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/validators.py 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 index c6c5dc4b449..cfdeb3f30f5 100644 --- 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 @@ -11,17 +11,14 @@ resource_group_name_type, tags_type) -from azure.cli.command_modules.maps.validators import validate_account_name 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', - validator=validate_account_name) + 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: @@ -37,8 +34,7 @@ def load_arguments(self, _): c.argument('sku_name', options_list=['--sku', '-s'], help='The name of the SKU, in standard format (such as S0).', - arg_type=get_enum_type(['S0']), - required=False) + arg_type=get_enum_type(['S0'])) c.argument('tags', arg_type=tags_type) 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 index f39b91e6f2c..ddcfc5aebef 100644 --- 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 @@ -14,7 +14,6 @@ logger = get_logger(__name__) -# pylint: disable=line-too-long 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) diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_validators.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_validators.py deleted file mode 100644 index 8d49cc64faa..00000000000 --- a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_validators.py +++ /dev/null @@ -1,46 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -import unittest - -from argparse import Namespace -from knack.util import CLIError -from azure.cli.command_modules.maps.validators import validate_account_name, ACCOUNT_NAME_MAX_LENGTH - - -class TestValidators(unittest.TestCase): - def setUp(self): - self.namespace = Namespace() - - def _assert_invalid_account_names(self, invalid_names): - for invalid_name in invalid_names: - self.namespace.account_name = invalid_name - self.assertRaises(CLIError, lambda: validate_account_name(self.namespace)) - - def _assert_valid_account_names(self, valid_names): - for valid_name in valid_names: - self.namespace.account_name = valid_name - try: - validate_account_name(self.namespace) - except CLIError: - self.fail("validate_account_name() raised CLIError unexpectedly!") - - def test_validate_account_name_length(self): - invalid_names = ["", "a", "a" * (ACCOUNT_NAME_MAX_LENGTH + 1)] - valid_names = ["Valid-Account-Name", "aa", "a" * ACCOUNT_NAME_MAX_LENGTH] - - self._assert_invalid_account_names(invalid_names) - self._assert_valid_account_names(valid_names) - - def test_validate_account_name_regex(self): - invalid_names = ["_A", "úñícódé", "ΞΞ", "resumé", "American cheese"] - valid_names = ["Bergenost", "Cheddar_cheese", "Colby-Jack", "Cottage.cheese", "Cr34MCh3353", "montereyjack"] - - self._assert_invalid_account_names(invalid_names) - self._assert_valid_account_names(valid_names) - - -if __name__ == '__main__': - unittest.main() diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/validators.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/validators.py deleted file mode 100644 index b856452c4f5..00000000000 --- a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/validators.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 knack.util import CLIError - -ACCOUNT_NAME_MIN_LENGTH = 2 -ACCOUNT_NAME_MAX_LENGTH = 64 -ACCOUNT_NAME_REGEX = re.compile("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$") - - -def validate_account_name(namespace): - """ Validates account name.""" - account_name = namespace.account_name - char_len = len(account_name) - - if not ACCOUNT_NAME_MIN_LENGTH <= char_len <= ACCOUNT_NAME_MAX_LENGTH: - raise CLIError("Input account-name is invalid. Account name character length must be between 2 and 64.") - if not re.match(ACCOUNT_NAME_REGEX, account_name): - raise CLIError("Input account-name is invalid. Allowed regex: " + ACCOUNT_NAME_REGEX.pattern + - "\nFirst character must be alphanumeric." + - "\nSubsequent character(s) must be any combination of alphanumeric, underscore (_), " + - "period (.), or hyphen (-).") diff --git a/src/command_modules/azure-cli-maps/azure_bdist_wheel.py b/src/command_modules/azure-cli-maps/azure_bdist_wheel.py index 3ffa5ea50a9..2f64bd44033 100644 --- a/src/command_modules/azure-cli-maps/azure_bdist_wheel.py +++ b/src/command_modules/azure-cli-maps/azure_bdist_wheel.py @@ -1,486 +1,3 @@ -""" -"wheel" copyright (c) 2012-2017 Daniel Holth and -contributors. - -The MIT License - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Create a Azure wheel (.whl) distribution (a wheel is a built archive format). - -This file is a copy of the official bdist_wheel file from wheel 0.30.0a0, enhanced -of the bottom with some Microsoft extension for Azure SDK for Python - -""" - -import csv -import hashlib -import os -import subprocess -import warnings -import shutil -import json -import sys - -try: - import sysconfig -except ImportError: # pragma nocover - # Python < 2.7 - import distutils.sysconfig as sysconfig - -import pkg_resources - -safe_name = pkg_resources.safe_name -safe_version = pkg_resources.safe_version - -from shutil import rmtree -from email.generator import Generator - -from distutils.core import Command -from distutils.sysconfig import get_python_version - -from distutils import log as logger - -from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag, get_platform -from wheel.util import native, open_for_csv -from wheel.archive import archive_wheelfile -from wheel.pkginfo import read_pkg_info, write_pkg_info -from wheel.metadata import pkginfo_to_dict -from wheel import pep425tags, metadata -from wheel import __version__ as wheel_version - -def safer_name(name): - return safe_name(name).replace('-', '_') - -def safer_version(version): - return safe_version(version).replace('-', '_') - -class bdist_wheel(Command): - - description = 'create a wheel distribution' - - user_options = [('bdist-dir=', 'b', - "temporary directory for creating the distribution"), - ('plat-name=', 'p', - "platform name to embed in generated filenames " - "(default: %s)" % get_platform()), - ('keep-temp', 'k', - "keep the pseudo-installation tree around after " + - "creating the distribution archive"), - ('dist-dir=', 'd', - "directory to put final built distributions in"), - ('skip-build', None, - "skip rebuilding everything (for testing/debugging)"), - ('relative', None, - "build the archive using relative paths" - "(default: false)"), - ('owner=', 'u', - "Owner name used when creating a tar file" - " [default: current user]"), - ('group=', 'g', - "Group name used when creating a tar file" - " [default: current group]"), - ('universal', None, - "make a universal wheel" - " (default: false)"), - ('python-tag=', None, - "Python implementation compatibility tag" - " (default: py%s)" % get_impl_ver()[0]), - ] - - boolean_options = ['keep-temp', 'skip-build', 'relative', 'universal'] - - def initialize_options(self): - self.bdist_dir = None - self.data_dir = None - self.plat_name = None - self.plat_tag = None - self.format = 'zip' - self.keep_temp = False - self.dist_dir = None - self.distinfo_dir = None - self.egginfo_dir = None - self.root_is_pure = None - self.skip_build = None - self.relative = False - self.owner = None - self.group = None - self.universal = False - self.python_tag = 'py' + get_impl_ver()[0] - self.plat_name_supplied = False - - def finalize_options(self): - if self.bdist_dir is None: - bdist_base = self.get_finalized_command('bdist').bdist_base - self.bdist_dir = os.path.join(bdist_base, 'wheel') - - self.data_dir = self.wheel_dist_name + '.data' - self.plat_name_supplied = self.plat_name is not None - - need_options = ('dist_dir', 'plat_name', 'skip_build') - - self.set_undefined_options('bdist', - *zip(need_options, need_options)) - - self.root_is_pure = not (self.distribution.has_ext_modules() - or self.distribution.has_c_libraries()) - - # Support legacy [wheel] section for setting universal - wheel = self.distribution.get_option_dict('wheel') - if 'universal' in wheel: - # please don't define this in your global configs - val = wheel['universal'][1].strip() - if val.lower() in ('1', 'true', 'yes'): - self.universal = True - - @property - def wheel_dist_name(self): - """Return distribution full name with - replaced with _""" - return '-'.join((safer_name(self.distribution.get_name()), - safer_version(self.distribution.get_version()))) - - def get_tag(self): - # bdist sets self.plat_name if unset, we should only use it for purepy - # wheels if the user supplied it. - if self.plat_name_supplied: - plat_name = self.plat_name - elif self.root_is_pure: - plat_name = 'any' - else: - plat_name = self.plat_name or get_platform() - if plat_name in ('linux-x86_64', 'linux_x86_64') and sys.maxsize == 2147483647: - plat_name = 'linux_i686' - plat_name = plat_name.replace('-', '_').replace('.', '_') - - - if self.root_is_pure: - if self.universal: - impl = 'py2.py3' - else: - impl = self.python_tag - tag = (impl, 'none', plat_name) - else: - impl_name = get_abbr_impl() - impl_ver = get_impl_ver() - # PEP 3149 - abi_tag = str(get_abi_tag()).lower() - tag = (impl_name + impl_ver, abi_tag, plat_name) - supported_tags = pep425tags.get_supported( - supplied_platform=plat_name if self.plat_name_supplied else None) - # XXX switch to this alternate implementation for non-pure: - assert tag == supported_tags[0], "%s != %s" % (tag, supported_tags[0]) - return tag - - def get_archive_basename(self): - """Return archive name without extension""" - - impl_tag, abi_tag, plat_tag = self.get_tag() - - archive_basename = "%s-%s-%s-%s" % ( - self.wheel_dist_name, - impl_tag, - abi_tag, - plat_tag) - return archive_basename - - def run(self): - build_scripts = self.reinitialize_command('build_scripts') - build_scripts.executable = 'python' - - if not self.skip_build: - self.run_command('build') - - install = self.reinitialize_command('install', - reinit_subcommands=True) - install.root = self.bdist_dir - install.compile = False - install.skip_build = self.skip_build - install.warn_dir = False - - # A wheel without setuptools scripts is more cross-platform. - # Use the (undocumented) `no_ep` option to setuptools' - # install_scripts command to avoid creating entry point scripts. - install_scripts = self.reinitialize_command('install_scripts') - install_scripts.no_ep = True - - # Use a custom scheme for the archive, because we have to decide - # at installation time which scheme to use. - for key in ('headers', 'scripts', 'data', 'purelib', 'platlib'): - setattr(install, - 'install_' + key, - os.path.join(self.data_dir, key)) - - basedir_observed = '' - - if os.name == 'nt': - # win32 barfs if any of these are ''; could be '.'? - # (distutils.command.install:change_roots bug) - basedir_observed = os.path.normpath(os.path.join(self.data_dir, '..')) - self.install_libbase = self.install_lib = basedir_observed - - setattr(install, - 'install_purelib' if self.root_is_pure else 'install_platlib', - basedir_observed) - - logger.info("installing to %s", self.bdist_dir) - - self.run_command('install') - - archive_basename = self.get_archive_basename() - - pseudoinstall_root = os.path.join(self.dist_dir, archive_basename) - if not self.relative: - archive_root = self.bdist_dir - else: - archive_root = os.path.join( - self.bdist_dir, - self._ensure_relative(install.install_base)) - - self.set_undefined_options( - 'install_egg_info', ('target', 'egginfo_dir')) - self.distinfo_dir = os.path.join(self.bdist_dir, - '%s.dist-info' % self.wheel_dist_name) - self.egg2dist(self.egginfo_dir, - self.distinfo_dir) - - self.write_wheelfile(self.distinfo_dir) - - self.write_record(self.bdist_dir, self.distinfo_dir) - - # Make the archive - if not os.path.exists(self.dist_dir): - os.makedirs(self.dist_dir) - wheel_name = archive_wheelfile(pseudoinstall_root, archive_root) - - # Sign the archive - if 'WHEEL_TOOL' in os.environ: - subprocess.call([os.environ['WHEEL_TOOL'], 'sign', wheel_name]) - - # Add to 'Distribution.dist_files' so that the "upload" command works - getattr(self.distribution, 'dist_files', []).append( - ('bdist_wheel', get_python_version(), wheel_name)) - - if not self.keep_temp: - if self.dry_run: - logger.info('removing %s', self.bdist_dir) - else: - rmtree(self.bdist_dir) - - def write_wheelfile(self, wheelfile_base, generator='bdist_wheel (' + wheel_version + ')'): - from email.message import Message - msg = Message() - msg['Wheel-Version'] = '1.0' # of the spec - msg['Generator'] = generator - msg['Root-Is-Purelib'] = str(self.root_is_pure).lower() - - # Doesn't work for bdist_wininst - impl_tag, abi_tag, plat_tag = self.get_tag() - for impl in impl_tag.split('.'): - for abi in abi_tag.split('.'): - for plat in plat_tag.split('.'): - msg['Tag'] = '-'.join((impl, abi, plat)) - - wheelfile_path = os.path.join(wheelfile_base, 'WHEEL') - logger.info('creating %s', wheelfile_path) - with open(wheelfile_path, 'w') as f: - Generator(f, maxheaderlen=0).flatten(msg) - - def _ensure_relative(self, path): - # copied from dir_util, deleted - drive, path = os.path.splitdrive(path) - if path[0:1] == os.sep: - path = drive + path[1:] - return path - - def _pkginfo_to_metadata(self, egg_info_path, pkginfo_path): - return metadata.pkginfo_to_metadata(egg_info_path, pkginfo_path) - - def license_file(self): - """Return license filename from a license-file key in setup.cfg, or None.""" - metadata = self.distribution.get_option_dict('metadata') - if not 'license_file' in metadata: - return None - return metadata['license_file'][1] - - def setupcfg_requirements(self): - """Generate requirements from setup.cfg as - ('Requires-Dist', 'requirement; qualifier') tuples. From a metadata - section in setup.cfg: - - [metadata] - provides-extra = extra1 - extra2 - requires-dist = requirement; qualifier - another; qualifier2 - unqualified - - Yields - - ('Provides-Extra', 'extra1'), - ('Provides-Extra', 'extra2'), - ('Requires-Dist', 'requirement; qualifier'), - ('Requires-Dist', 'another; qualifier2'), - ('Requires-Dist', 'unqualified') - """ - metadata = self.distribution.get_option_dict('metadata') - - # our .ini parser folds - to _ in key names: - for key, title in (('provides_extra', 'Provides-Extra'), - ('requires_dist', 'Requires-Dist')): - if not key in metadata: - continue - field = metadata[key] - for line in field[1].splitlines(): - line = line.strip() - if not line: - continue - yield (title, line) - - def add_requirements(self, metadata_path): - """Add additional requirements from setup.cfg to file metadata_path""" - additional = list(self.setupcfg_requirements()) - if not additional: return - pkg_info = read_pkg_info(metadata_path) - if 'Provides-Extra' in pkg_info or 'Requires-Dist' in pkg_info: - warnings.warn('setup.cfg requirements overwrite values from setup.py') - del pkg_info['Provides-Extra'] - del pkg_info['Requires-Dist'] - for k, v in additional: - pkg_info[k] = v - write_pkg_info(metadata_path, pkg_info) - - def egg2dist(self, egginfo_path, distinfo_path): - """Convert an .egg-info directory into a .dist-info directory""" - def adios(p): - """Appropriately delete directory, file or link.""" - if os.path.exists(p) and not os.path.islink(p) and os.path.isdir(p): - shutil.rmtree(p) - elif os.path.exists(p): - os.unlink(p) - - adios(distinfo_path) - - if not os.path.exists(egginfo_path): - # There is no egg-info. This is probably because the egg-info - # file/directory is not named matching the distribution name used - # to name the archive file. Check for this case and report - # accordingly. - import glob - pat = os.path.join(os.path.dirname(egginfo_path), '*.egg-info') - possible = glob.glob(pat) - err = "Egg metadata expected at %s but not found" % (egginfo_path,) - if possible: - alt = os.path.basename(possible[0]) - err += " (%s found - possible misnamed archive file?)" % (alt,) - - raise ValueError(err) - - if os.path.isfile(egginfo_path): - # .egg-info is a single file - pkginfo_path = egginfo_path - pkg_info = self._pkginfo_to_metadata(egginfo_path, egginfo_path) - os.mkdir(distinfo_path) - else: - # .egg-info is a directory - pkginfo_path = os.path.join(egginfo_path, 'PKG-INFO') - pkg_info = self._pkginfo_to_metadata(egginfo_path, pkginfo_path) - - # ignore common egg metadata that is useless to wheel - shutil.copytree(egginfo_path, distinfo_path, - ignore=lambda x, y: set(('PKG-INFO', - 'requires.txt', - 'SOURCES.txt', - 'not-zip-safe',))) - - # delete dependency_links if it is only whitespace - dependency_links_path = os.path.join(distinfo_path, 'dependency_links.txt') - with open(dependency_links_path, 'r') as dependency_links_file: - dependency_links = dependency_links_file.read().strip() - if not dependency_links: - adios(dependency_links_path) - - write_pkg_info(os.path.join(distinfo_path, 'METADATA'), pkg_info) - - # XXX deprecated. Still useful for current distribute/setuptools. - metadata_path = os.path.join(distinfo_path, 'METADATA') - self.add_requirements(metadata_path) - - # XXX intentionally a different path than the PEP. - metadata_json_path = os.path.join(distinfo_path, 'metadata.json') - pymeta = pkginfo_to_dict(metadata_path, - distribution=self.distribution) - - if 'description' in pymeta: - description_filename = 'DESCRIPTION.rst' - description_text = pymeta.pop('description') - description_path = os.path.join(distinfo_path, - description_filename) - with open(description_path, "wb") as description_file: - description_file.write(description_text.encode('utf-8')) - pymeta['extensions']['python.details']['document_names']['description'] = description_filename - - # XXX heuristically copy any LICENSE/LICENSE.txt? - license = self.license_file() - if license: - license_filename = 'LICENSE.txt' - shutil.copy(license, os.path.join(self.distinfo_dir, license_filename)) - pymeta['extensions']['python.details']['document_names']['license'] = license_filename - - with open(metadata_json_path, "w") as metadata_json: - json.dump(pymeta, metadata_json, sort_keys=True) - - adios(egginfo_path) - - def write_record(self, bdist_dir, distinfo_dir): - from wheel.util import urlsafe_b64encode - - record_path = os.path.join(distinfo_dir, 'RECORD') - record_relpath = os.path.relpath(record_path, bdist_dir) - - def walk(): - for dir, dirs, files in os.walk(bdist_dir): - dirs.sort() - for f in sorted(files): - yield os.path.join(dir, f) - - def skip(path): - """Wheel hashes every possible file.""" - return (path == record_relpath) - - with open_for_csv(record_path, 'w+') as record_file: - writer = csv.writer(record_file) - for path in walk(): - relpath = os.path.relpath(path, bdist_dir) - if skip(relpath): - hash = '' - size = '' - else: - with open(path, 'rb') as f: - data = f.read() - digest = hashlib.sha256(data).digest() - hash = 'sha256=' + native(urlsafe_b64encode(digest)) - size = len(data) - record_path = os.path.relpath( - path, bdist_dir).replace(os.path.sep, '/') - writer.writerow((record_path, hash, size)) - - #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for @@ -490,8 +7,12 @@ def skip(path): from distutils import log as logger import os.path -#from wheel.bdist_wheel import bdist_wheel +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" @@ -512,7 +33,7 @@ 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.replace('_', '-'))) + "{}>=2.0.0".format(self.azure_namespace_package)) bdist_wheel.run(self) def write_record(self, bdist_dir, distinfo_dir): @@ -530,4 +51,4 @@ def write_record(self, bdist_dir, distinfo_dir): bdist_wheel.write_record(self, bdist_dir, distinfo_dir) cmdclass = { 'bdist_wheel': azure_bdist_wheel, -} +} \ No newline at end of file From 31f7a3aee9a122412b8325c2bb39205855d78c90 Mon Sep 17 00:00:00 2001 From: James Park Date: Wed, 9 May 2018 13:17:20 -0700 Subject: [PATCH 26/28] [Maps] Revise help text --- .../azure/cli/command_modules/maps/_help.py | 21 +++++++------------ .../azure/cli/command_modules/maps/_params.py | 4 ++-- .../azure-cli-maps/azure_bdist_wheel.py | 2 +- 3 files changed, 10 insertions(+), 17 deletions(-) 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 index ec1bca90320..8d20f2e2a61 100644 --- 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 @@ -10,11 +10,6 @@ short-summary: Manage Azure Maps accounts. """ -helps['maps account'] = """ - type: group - short-summary: Manage Azure Maps accounts. -""" - helps['maps account keys'] = """ type: group short-summary: Manage Azure Maps account keys. @@ -22,41 +17,39 @@ helps['maps account show'] = """ type: command - short-summary: Show the details of a Maps account. + 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. + 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. - long-summary: | - Create a Maps account. A Maps account holds the keys which allow access to the Maps REST APIs. + short-summary: Create a maps account. """ helps['maps account update'] = """ type: command - short-summary: Update the properties of a Maps account. + short-summary: Update the properties of a maps account. """ helps['maps account delete'] = """ type: command - short-summary: Delete a Maps account. + 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: | - List 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. + 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: | - Renew either the primary or secondary key for use with the Maps APIs. The old key will stop working immediately. + 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 index cfdeb3f30f5..d4bd4ca8774 100644 --- 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 @@ -18,7 +18,7 @@ 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') + help='The name of the maps account') # Parameter Registration with self.argument_context('maps') as c: @@ -33,7 +33,7 @@ def load_arguments(self, _): with self.argument_context('maps account') as c: c.argument('sku_name', options_list=['--sku', '-s'], - help='The name of the SKU, in standard format (such as S0).', + help='The name of the SKU.', arg_type=get_enum_type(['S0'])) c.argument('tags', arg_type=tags_type) diff --git a/src/command_modules/azure-cli-maps/azure_bdist_wheel.py b/src/command_modules/azure-cli-maps/azure_bdist_wheel.py index 2f64bd44033..8a81d1b6177 100644 --- a/src/command_modules/azure-cli-maps/azure_bdist_wheel.py +++ b/src/command_modules/azure-cli-maps/azure_bdist_wheel.py @@ -51,4 +51,4 @@ def write_record(self, bdist_dir, distinfo_dir): bdist_wheel.write_record(self, bdist_dir, distinfo_dir) cmdclass = { 'bdist_wheel': azure_bdist_wheel, -} \ No newline at end of file +} From d49f8ad4a0629d6ffe471bc3fdeb54f7a21c08f7 Mon Sep 17 00:00:00 2001 From: James Park Date: Wed, 9 May 2018 13:56:38 -0700 Subject: [PATCH 27/28] [Maps] Adding back help docs for maps account Misinterpreted PR comment. --- .../azure-cli-maps/azure/cli/command_modules/maps/_help.py | 5 +++++ 1 file changed, 5 insertions(+) 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 index 8d20f2e2a61..a8f6401adaf 100644 --- 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 @@ -6,6 +6,11 @@ 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. """ From 19b2fe9da3387dbddee2d49b29af20dce824bb3c Mon Sep 17 00:00:00 2001 From: James Park Date: Mon, 14 May 2018 13:23:17 -0700 Subject: [PATCH 28/28] [Load Test] replace sql with servicefabric --- tools/automation/verify/verify_module_load_times.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }