commit azure-cli-cognitiveservices for openSUSE:Factory
Hello community, here is the log from the commit of package azure-cli-cognitiveservices for openSUSE:Factory checked in at 2019-05-22 10:59:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/azure-cli-cognitiveservices (Old) and /work/SRC/openSUSE:Factory/.azure-cli-cognitiveservices.new.5148 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "azure-cli-cognitiveservices" Wed May 22 10:59:11 2019 rev:5 rq:696822 version:0.2.4 Changes: -------- --- /work/SRC/openSUSE:Factory/azure-cli-cognitiveservices/azure-cli-cognitiveservices.changes 2018-10-15 10:47:14.599146389 +0200 +++ /work/SRC/openSUSE:Factory/.azure-cli-cognitiveservices.new.5148/azure-cli-cognitiveservices.changes 2019-05-22 10:59:17.230824167 +0200 @@ -1,0 +2,16 @@ +Tue Apr 16 13:21:31 UTC 2019 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com> + +- New upstream release + + Version 0.2.4 + + For detailed information about changes see the + HISTORY.txt file provided with this package +- Bump minimum version for Python Azure SDK namespace + packages to 3.0.0 in BuildRequires and Requires +- Remove python3-devel package from BuildRequires +- Remove unzip package from BuildRequires +- Run fdupes to hardlink duplicate files + + Add fdupes to BuildRequires + + Add %fdupes invocation to %install +- Update Requires from setup.py + +------------------------------------------------------------------- Old: ---- azure-cli-cognitiveservices-0.2.1.tar.gz New: ---- azure-cli-cognitiveservices-0.2.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ azure-cli-cognitiveservices.spec ++++++ --- /var/tmp/diff_new_pack.mJsf1I/_old 2019-05-22 10:59:18.618822369 +0200 +++ /var/tmp/diff_new_pack.mJsf1I/_new 2019-05-22 10:59:18.658822317 +0200 @@ -1,7 +1,7 @@ # # spec file for package azure-cli-cognitiveservices # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: azure-cli-cognitiveservices -Version: 0.2.1 +Version: 0.2.4 Release: 0 Summary: Microsoft Azure CLI 'cognitiveservices' Command Module License: MIT @@ -27,15 +27,14 @@ Source1: LICENSE.txt BuildRequires: azure-cli-command-modules-nspkg BuildRequires: azure-cli-nspkg -BuildRequires: python3-azure-nspkg -BuildRequires: python3-devel +BuildRequires: fdupes +BuildRequires: python3-azure-nspkg >= 3.0.0 BuildRequires: python3-setuptools -BuildRequires: unzip Requires: azure-cli-command-modules-nspkg Requires: azure-cli-core Requires: azure-cli-nspkg -Requires: python3-azure-mgmt-cognitiveservices >= 1.0.0 -Requires: python3-azure-nspkg +Requires: python3-azure-mgmt-cognitiveservices >= 3.0.0 +Requires: python3-azure-nspkg >= 3.0.0 Conflicts: azure-cli < 2.0.0 BuildArch: noarch @@ -55,6 +54,7 @@ %install python3 setup.py install --root=%{buildroot} --prefix=%{_prefix} --install-lib=%{python3_sitelib} +%python_expand %fdupes %{buildroot}%{$python_sitelib} rm -rf %{buildroot}%{python3_sitelib}/azure/cli/command_modules/__init__.* rm -rf %{buildroot}%{python3_sitelib}/azure/cli/command_modules/__pycache__ rm -rf %{buildroot}%{python3_sitelib}/azure/cli/__init__.* ++++++ azure-cli-cognitiveservices-0.2.1.tar.gz -> azure-cli-cognitiveservices-0.2.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-cognitiveservices-0.2.1/HISTORY.rst new/azure-cli-cognitiveservices-0.2.4/HISTORY.rst --- old/azure-cli-cognitiveservices-0.2.1/HISTORY.rst 2018-08-23 01:07:57.000000000 +0200 +++ new/azure-cli-cognitiveservices-0.2.4/HISTORY.rst 2018-11-15 19:56:29.000000000 +0100 @@ -3,6 +3,22 @@ Release History =============== +0.2.4 ++++++ +* Minor fixes + +0.2.3 ++++++ +* Add completer for `--sku`, `--kind`, `--location` arguments + +0.2.2 ++++++ +* Add new command `az cognitiveservices account list-usage` +* Add new command `az cognitiveservices account list-kinds` +* Add new command `az cognitiveservices account list` +* Deprecate `az cognitiveservices list` +* --name is now optional for `az cognitiveservices account list-skus` + 0.2.1 +++++ * Add new parameter --api-properties, which is required for creating some of the services. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-cognitiveservices-0.2.1/PKG-INFO new/azure-cli-cognitiveservices-0.2.4/PKG-INFO --- old/azure-cli-cognitiveservices-0.2.1/PKG-INFO 2018-08-23 01:09:51.000000000 +0200 +++ new/azure-cli-cognitiveservices-0.2.4/PKG-INFO 2018-11-15 19:56:47.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: azure-cli-cognitiveservices -Version: 0.2.1 +Version: 0.2.4 Summary: Microsoft Azure Command-Line Tools Cognitive Services Command Module Home-page: https://github.com/azure/azure-cli Author: Microsoft Corporation @@ -20,6 +20,22 @@ Release History =============== + 0.2.4 + +++++ + * Minor fixes + + 0.2.3 + +++++ + * Add completer for `--sku`, `--kind`, `--location` arguments + + 0.2.2 + +++++ + * Add new command `az cognitiveservices account list-usage` + * Add new command `az cognitiveservices account list-kinds` + * Add new command `az cognitiveservices account list` + * Deprecate `az cognitiveservices list` + * --name is now optional for `az cognitiveservices account list-skus` + 0.2.1 +++++ * Add new parameter --api-properties, which is required for creating some of the services. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/__init__.py new/azure-cli-cognitiveservices-0.2.4/azure/cli/command_modules/cognitiveservices/__init__.py --- old/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/__init__.py 2018-08-23 01:07:57.000000000 +0200 +++ new/azure-cli-cognitiveservices-0.2.4/azure/cli/command_modules/cognitiveservices/__init__.py 2018-11-15 19:56:29.000000000 +0100 @@ -7,7 +7,7 @@ import azure.cli.command_modules.cognitiveservices._help # pylint: disable=unused-import -from azure.cli.command_modules.cognitiveservices._client_factory import cf_cognitive_service_accounts +from azure.cli.command_modules.cognitiveservices._client_factory import cf_accounts class CognitiveServicesCommandsLoader(AzCommandsLoader): @@ -16,7 +16,7 @@ from azure.cli.core.commands import CliCommandType custom_type = CliCommandType( operations_tmpl='azure.cli.command_modules.cognitiveservices.custom#{}', - client_factory=cf_cognitive_service_accounts) + client_factory=cf_accounts) super(CognitiveServicesCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=custom_type, min_profile='2017-03-10-profile') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/_client_factory.py new/azure-cli-cognitiveservices-0.2.4/azure/cli/command_modules/cognitiveservices/_client_factory.py --- old/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/_client_factory.py 2018-08-23 01:07:57.000000000 +0200 +++ new/azure-cli-cognitiveservices-0.2.4/azure/cli/command_modules/cognitiveservices/_client_factory.py 2018-11-15 19:56:29.000000000 +0100 @@ -7,12 +7,12 @@ def get_cognitiveservices_management_client(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - return get_mgmt_service_client(cli_ctx, CognitiveServicesManagementClient, location='notused') - - -def cf_cognitive_service_accounts(cli_ctx, *_): - return get_cognitiveservices_management_client(cli_ctx).cognitive_services_accounts + return get_mgmt_service_client(cli_ctx, CognitiveServicesManagementClient) def cf_accounts(cli_ctx, *_): return get_cognitiveservices_management_client(cli_ctx).accounts + + +def cf_resource_skus(cli_ctx, *_): + return get_cognitiveservices_management_client(cli_ctx).resource_skus diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/_help.py new/azure-cli-cognitiveservices-0.2.4/azure/cli/command_modules/cognitiveservices/_help.py --- old/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/_help.py 2018-08-23 01:07:57.000000000 +0200 +++ new/azure-cli-cognitiveservices-0.2.4/azure/cli/command_modules/cognitiveservices/_help.py 2018-11-15 19:56:29.000000000 +0100 @@ -10,24 +10,37 @@ helps['cognitiveservices'] = """ type: group short-summary: Manage Azure Cognitive Services accounts. + long-summary: This article lists the Azure CLI commands for Azure Cognitive Services account and subscription management only. Refer to the documentation at https://docs.microsoft.com/azure/cognitive-services/ for individual services to learn how to use the APIs and supported SDKs. """ helps['cognitiveservices list'] = """ type: command - short-summary: List available Azure Cognitive Services accounts. + short-summary: Manage Azure Cognitive Services accounts. + long-summary: This article lists the Azure CLI commands for Azure Cognitive Services account and subscription management only. Refer to the documentation at https://docs.microsoft.com/azure/cognitive-services/ for individual services to learn how to use the APIs and supported SDKs. examples: - name: List all the Cognitive Services accounts in a resource group. text: az cognitiveservices list -g MyResourceGroup """ +helps['cognitiveservices account list'] = """ + type: command + short-summary: Manage Azure Cognitive Services accounts. + long-summary: This article lists the Azure CLI commands for Azure Cognitive Services account and subscription management only. Refer to the documentation at https://docs.microsoft.com/azure/cognitive-services/ for individual services to learn how to use the APIs and supported SDKs. + examples: + - name: List all the Cognitive Services accounts in a resource group. + text: az cognitiveservices account list -g MyResourceGroup +""" + helps['cognitiveservices account'] = """ type: group short-summary: Manage Azure Cognitive Services accounts. + long-summary: This article lists the Azure CLI commands for Azure Cognitive Services account and subscription management only. Refer to the documentation at https://docs.microsoft.com/azure/cognitive-services/ for individual services to learn how to use the APIs and supported SDKs. """ helps['cognitiveservices account delete'] = """ type: command - short-summary: Delete an Azure Cognitive Services account. + short-summary: Manage Azure Cognitive Services accounts. + long-summary: This article lists the Azure CLI commands for Azure Cognitive Services account and subscription management only. Refer to the documentation at https://docs.microsoft.com/azure/cognitive-services/ for individual services to learn how to use the APIs and supported SDKs. examples: - name: Delete account. text: az cognitiveservices account delete --name myresource-luis -g cognitive-services-resource-group @@ -35,7 +48,15 @@ helps['cognitiveservices account create'] = """ type: command - short-summary: Create an Azure Cognitive Services account. + short-summary: Manage Azure Cognitive Services accounts. + long-summary: This article lists the Azure CLI commands for Azure Cognitive Services account and subscription management only. Refer to the documentation at https://docs.microsoft.com/azure/cognitive-services/ for individual services to learn how to use the APIs and supported SDKs. + parameters: + - name: --kind + populator-commands: + - az cognitiveservices account list-kinds + - name: --sku + populator-commands: + - az cognitiveservices account list-skus examples: - name: Create an S0 face API Cognitive Services account in West Europe without confirmation required. text: az cognitiveservices account create -n myresource -g myResourceGroup --kind Face --sku S0 -l WestEurope --yes @@ -43,7 +64,8 @@ helps['cognitiveservices account show'] = """ type: command - short-summary: Get the details of an Azure Cognitive Services account. + short-summary: Manage Azure Cognitive Services accounts. + long-summary: This article lists the Azure CLI commands for Azure Cognitive Services account and subscription management only. Refer to the documentation at https://docs.microsoft.com/azure/cognitive-services/ for individual services to learn how to use the APIs and supported SDKs. examples: - name: Show account information. text: az cognitiveservices account show --name myresource --resource-group cognitive-services-resource-group @@ -51,7 +73,12 @@ helps['cognitiveservices account update'] = """ type: command - short-summary: Update the properties of an Azure Cognitive Services account. + short-summary: Manage Azure Cognitive Services accounts. + long-summary: This article lists the Azure CLI commands for Azure Cognitive Services account and subscription management only. Refer to the documentation at https://docs.microsoft.com/azure/cognitive-services/ for individual services to learn how to use the APIs and supported SDKs. + parameters: + - name: --sku + populator-commands: + - az cognitiveservices account list-skus examples: - name: Update sku and tags. text: az cognitiveservices account update --name myresource -g cognitive-services-resource-group --sku S0 --tags external-app=chatbot-HR azure-web-app-bot=HR-external azure-app-service=HR-external-app-service @@ -59,21 +86,35 @@ helps['cognitiveservices account list-skus'] = """ type: command - short-summary: List the SKUs avaiable for an Azure Cognitive Services account. + short-summary: Manage Azure Cognitive Services accounts. + long-summary: This article lists the Azure CLI commands for Azure Cognitive Services account and subscription management only. Refer to the documentation at https://docs.microsoft.com/azure/cognitive-services/ for individual services to learn how to use the APIs and supported SDKs. + parameters: + - name: --name -n + long-summary: | + --kind and --location will be ignored when --name is specified. + --resource-group is required when when --name is specified. + - name: --resource-group -g + long-summary: | + --resource-group is used when when --name is specified. In other cases it will be ignored. + - name: --kind + populator-commands: + - az cognitiveservices account list-kinds examples: - name: Show SKUs. - text: az cognitiveservices account list-skus --name myresource -g cognitive-services-resource-group + text: az cognitiveservices account list-skus --kind Face --location westus """ helps['cognitiveservices account keys'] = """ type: group - short-summary: Manage the keys of an Azure Cognitive Services account. + short-summary: Manage Azure Cognitive Services accounts. + long-summary: This article lists the Azure CLI commands for Azure Cognitive Services account and subscription management only. Refer to the documentation at https://docs.microsoft.com/azure/cognitive-services/ for individual services to learn how to use the APIs and supported SDKs. """ helps['cognitiveservices account keys regenerate'] = """ type: command - short-summary: Regenerate the keys of an Azure Cognitive Services account. + short-summary: Manage Azure Cognitive Services accounts. + long-summary: This article lists the Azure CLI commands for Azure Cognitive Services account and subscription management only. Refer to the documentation at https://docs.microsoft.com/azure/cognitive-services/ for individual services to learn how to use the APIs and supported SDKs. examples: - name: Get new keys for resource. text: az cognitiveservices account keys regenerate --name myresource -g cognitive-services-resource-group --key-name key1 @@ -81,7 +122,8 @@ helps['cognitiveservices account keys list'] = """ type: command - short-summary: List the keys of an Azure Cognitive Services account. + short-summary: Manage Azure Cognitive Services accounts. + long-summary: This article lists the Azure CLI commands for Azure Cognitive Services account and subscription management only. Refer to the documentation at https://docs.microsoft.com/azure/cognitive-services/ for individual services to learn how to use the APIs and supported SDKs. examples: - name: Get current resource keys. text: az cognitiveservices account keys list --name myresource -g cognitive-services-resource-group diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/_params.py new/azure-cli-cognitiveservices-0.2.4/azure/cli/command_modules/cognitiveservices/_params.py --- old/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/_params.py 2018-08-23 01:07:57.000000000 +0200 +++ new/azure-cli-cognitiveservices-0.2.4/azure/cli/command_modules/cognitiveservices/_params.py 2018-11-15 19:56:29.000000000 +0100 @@ -10,10 +10,14 @@ from azure.cli.core.commands.parameters import ( tags_type, resource_group_name_type, - get_resource_name_completion_list) + get_resource_name_completion_list, + get_location_type) from azure.cli.core.util import (shell_safe_json_parse, CLIError) from azure.cli.core.commands.validators import validate_tag +from azure.cli.core.decorators import Completer + +from azure.cli.command_modules.cognitiveservices._client_factory import cf_resource_skus logger = get_logger(__name__) name_arg_type = CLIArgumentType(options_list=['--name', '-n'], metavar='NAME') @@ -69,13 +73,58 @@ ) +def _sku_filter(cmd, namespace): + """ + Get a list of ResourceSku and filter by existing conditions: 'kind', 'location' and 'sku_name' + """ + kind = getattr(namespace, 'kind', None) + location = getattr(namespace, 'location', None) + sku_name = getattr(namespace, 'sku_name', None) + + def _filter_sku(_sku): + if sku_name is not None: + if _sku.name != sku_name: + return False + if kind is not None: + if _sku.kind != kind: + return False + if location is not None: + if location.lower() not in [x.lower() for x in _sku.locations]: + return False + return True + + return [x for x in cf_resource_skus(cmd.cli_ctx).list() if _filter_sku(x)] + + +@Completer +def sku_name_completer(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument + names = set([x.name for x in _sku_filter(cmd, namespace)]) + return sorted(list(names)) + + +@Completer +def kind_completer(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument + kinds = set([x.kind for x in _sku_filter(cmd, namespace)]) + return sorted(list(kinds)) + + +@Completer +def location_completer(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument + names = set([location for x in _sku_filter(cmd, namespace) for location in x.locations]) + return [x.lower() for x in sorted(list(names))] + + def load_arguments(self, _): with self.argument_context('cognitiveservices') as c: c.argument('account_name', arg_type=name_arg_type, help='cognitive service account name', completer=get_resource_name_completion_list('Microsoft.CognitiveServices/accounts')) + c.argument('location', arg_type=get_location_type(self.cli_ctx), + completer=location_completer) c.argument('resource_group_name', arg_type=resource_group_name_type) - c.argument('sku_name', options_list=['--sku'], help='the Sku of cognitive services account') - c.argument('kind', help='the API name of cognitive services account') + c.argument('sku_name', options_list=['--sku'], help='the Sku of cognitive services account', + completer=sku_name_completer) + c.argument('kind', help='the API name of cognitive services account', + completer=kind_completer) c.argument('tags', tags_type) c.argument('key_name', required=True, help='Key name to generate', choices=['key1', 'key2']) c.argument('api_properties', api_properties_type) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/commands.py new/azure-cli-cognitiveservices-0.2.4/azure/cli/command_modules/cognitiveservices/commands.py --- old/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/commands.py 2018-08-23 01:07:57.000000000 +0200 +++ new/azure-cli-cognitiveservices-0.2.4/azure/cli/command_modules/cognitiveservices/commands.py 2018-11-15 19:56:29.000000000 +0100 @@ -4,15 +4,13 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType -from azure.cli.command_modules.cognitiveservices._client_factory import ( - cf_cognitive_service_accounts, - cf_accounts) +from azure.cli.command_modules.cognitiveservices._client_factory import cf_accounts, cf_resource_skus def load_command_table(self, _): mgmt_type = CliCommandType( - operations_tmpl='azure.mgmt.cognitiveservices.operations.cognitive_services_accounts_operations#CognitiveServicesAccountsOperations.{}', # pylint: disable=line-too-long - client_factory=cf_cognitive_service_accounts + operations_tmpl='azure.mgmt.cognitiveservices.operations.accounts_operations#AccountsOperations.{}', + client_factory=cf_accounts ) with self.command_group('cognitiveservices account', mgmt_type) as g: @@ -20,11 +18,16 @@ g.command('delete', 'delete') g.show_command('show', 'get_properties') g.custom_command('update', 'update') - g.command('list-skus', 'list_skus') + g.custom_command('list', 'list_resources') + g.custom_command('list-skus', 'list_skus') + g.custom_command('list-usage', 'list_usages') + g.custom_command('list-kinds', 'list_kinds', client_factory=cf_resource_skus) with self.command_group('cognitiveservices account keys', mgmt_type) as g: g.command('regenerate', 'regenerate_key') g.command('list', 'list_keys') + # deprecating this with self.command_group('cognitiveservices') as g: - g.custom_command('list', 'list_resources', client_factory=cf_accounts) + g.custom_command('list', 'list_resources', + deprecate_info=g.deprecate(redirect='az cognitiveservices account list', hide=True)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/custom.py new/azure-cli-cognitiveservices-0.2.4/azure/cli/command_modules/cognitiveservices/custom.py --- old/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/custom.py 2018-08-23 01:07:57.000000000 +0200 +++ new/azure-cli-cognitiveservices-0.2.4/azure/cli/command_modules/cognitiveservices/custom.py 2018-11-15 19:56:29.000000000 +0100 @@ -7,6 +7,7 @@ from knack.util import CLIError from knack.log import get_logger +from azure.cli.command_modules.cognitiveservices._client_factory import cf_accounts, cf_resource_skus from azure.mgmt.cognitiveservices.models import CognitiveServicesAccountCreateParameters, Sku logger = get_logger(__name__) @@ -18,6 +19,49 @@ return client.list() +def list_usages(client, resource_group_name, account_name): + """ + List usages for Azure Cognitive Services account. + """ + return client.get_usages(resource_group_name, account_name).value + + +def list_kinds(client): + """ + List all valid kinds for Azure Cognitive Services account. + + :param client: the ResourceSkusOperations + :return: a list + """ + # The client should be ResourceSkusOperations, and list() should return a list of SKUs for all regions. + # The sku will have "kind" and we use that to extract full list of kinds. + kinds = set([x.kind for x in client.list()]) + return sorted(list(kinds)) + + +def list_skus(cmd, kind=None, location=None, resource_group_name=None, account_name=None): + if resource_group_name is not None or account_name is not None: + logger.warning( + 'list-skus with an existing account has been deprecated and will be removed in a future release.') + if resource_group_name is None: + # account_name must not be None + raise CLIError('--resource-group is required when --name is specified.') + # keep the original behavior to avoid breaking changes + return cf_accounts(cmd.cli_ctx).list_skus(resource_group_name, account_name) + + # in other cases, use kind and location to filter SKUs + def _filter_sku(_sku): + if kind is not None: + if _sku.kind != kind: + return False + if location is not None: + if location.lower() not in [x.lower() for x in _sku.locations]: + return False + return True + + return [x for x in cf_resource_skus(cmd.cli_ctx).list() if _filter_sku(x)] + + def create( client, resource_group_name, account_name, sku_name, kind, location, tags=None, api_properties=None, yes=None): @@ -42,16 +86,17 @@ option = prompt_y_n(hint) if not option: raise CLIError('Operation cancelled.') - sku = Sku(sku_name) + sku = Sku(name=sku_name) if api_properties is None: properties = {} else: properties = {"apiProperties": api_properties} - params = CognitiveServicesAccountCreateParameters(sku, kind, location, properties, tags) + params = CognitiveServicesAccountCreateParameters(sku=sku, kind=kind, location=location, + properties=properties, tags=tags) return client.create(resource_group_name, account_name, params) def update(client, resource_group_name, account_name, sku_name=None, tags=None): - sku = Sku(sku_name) + sku = Sku(name=sku_name) return client.update(resource_group_name, account_name, sku, tags) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-cognitiveservices-0.2.1/azure_cli_cognitiveservices.egg-info/PKG-INFO new/azure-cli-cognitiveservices-0.2.4/azure_cli_cognitiveservices.egg-info/PKG-INFO --- old/azure-cli-cognitiveservices-0.2.1/azure_cli_cognitiveservices.egg-info/PKG-INFO 2018-08-23 01:09:51.000000000 +0200 +++ new/azure-cli-cognitiveservices-0.2.4/azure_cli_cognitiveservices.egg-info/PKG-INFO 2018-11-15 19:56:47.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: azure-cli-cognitiveservices -Version: 0.2.1 +Version: 0.2.4 Summary: Microsoft Azure Command-Line Tools Cognitive Services Command Module Home-page: https://github.com/azure/azure-cli Author: Microsoft Corporation @@ -20,6 +20,22 @@ Release History =============== + 0.2.4 + +++++ + * Minor fixes + + 0.2.3 + +++++ + * Add completer for `--sku`, `--kind`, `--location` arguments + + 0.2.2 + +++++ + * Add new command `az cognitiveservices account list-usage` + * Add new command `az cognitiveservices account list-kinds` + * Add new command `az cognitiveservices account list` + * Deprecate `az cognitiveservices list` + * --name is now optional for `az cognitiveservices account list-skus` + 0.2.1 +++++ * Add new parameter --api-properties, which is required for creating some of the services. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-cognitiveservices-0.2.1/azure_cli_cognitiveservices.egg-info/requires.txt new/azure-cli-cognitiveservices-0.2.4/azure_cli_cognitiveservices.egg-info/requires.txt --- old/azure-cli-cognitiveservices-0.2.1/azure_cli_cognitiveservices.egg-info/requires.txt 2018-08-23 01:09:51.000000000 +0200 +++ new/azure-cli-cognitiveservices-0.2.4/azure_cli_cognitiveservices.egg-info/requires.txt 2018-11-15 19:56:47.000000000 +0100 @@ -1,2 +1,2 @@ -azure-mgmt-cognitiveservices==1.0.0 +azure-mgmt-cognitiveservices==3.0.0 azure-cli-core diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-cognitiveservices-0.2.1/setup.py new/azure-cli-cognitiveservices-0.2.4/setup.py --- old/azure-cli-cognitiveservices-0.2.1/setup.py 2018-08-23 01:07:57.000000000 +0200 +++ new/azure-cli-cognitiveservices-0.2.4/setup.py 2018-11-15 19:56:29.000000000 +0100 @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.2.1" +VERSION = "0.2.4" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ @@ -30,7 +30,7 @@ ] DEPENDENCIES = [ - 'azure-mgmt-cognitiveservices==1.0.0', + 'azure-mgmt-cognitiveservices==3.0.0', 'azure-cli-core', ]
participants (1)
-
root