Hello community,

here is the log from the commit of package azure-cli-cognitiveservices for 
openSUSE:Factory checked in at 2018-10-15 10:47:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/azure-cli-cognitiveservices (Old)
 and      /work/SRC/openSUSE:Factory/.azure-cli-cognitiveservices.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "azure-cli-cognitiveservices"

Mon Oct 15 10:47:14 2018 rev:4 rq:641216 version:0.2.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/azure-cli-cognitiveservices/azure-cli-cognitiveservices.changes
  2018-05-13 16:01:42.897665254 +0200
+++ 
/work/SRC/openSUSE:Factory/.azure-cli-cognitiveservices.new/azure-cli-cognitiveservices.changes
     2018-10-15 10:47:14.599146389 +0200
@@ -1,0 +2,8 @@
+Mon Sep 17 09:19:15 UTC 2018 - John Paul Adrian Glaubitz 
<[email protected]>
+
+- New upstream release
+  + Version 0.2.1
+  + For detailed information about changes see the
+    HISTORY.txt file provided with this package
+
+-------------------------------------------------------------------

Old:
----
  azure-cli-cognitiveservices-0.1.12.tar.gz

New:
----
  azure-cli-cognitiveservices-0.2.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ azure-cli-cognitiveservices.spec ++++++
--- /var/tmp/diff_new_pack.OsmefQ/_old  2018-10-15 10:47:15.027145931 +0200
+++ /var/tmp/diff_new_pack.OsmefQ/_new  2018-10-15 10:47:15.027145931 +0200
@@ -12,12 +12,12 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 Name:           azure-cli-cognitiveservices
-Version:        0.1.12
+Version:        0.2.1
 Release:        0
 Summary:        Microsoft Azure CLI 'cognitiveservices' Command Module
 License:        MIT

++++++ azure-cli-cognitiveservices-0.1.12.tar.gz -> 
azure-cli-cognitiveservices-0.2.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-cognitiveservices-0.1.12/HISTORY.rst 
new/azure-cli-cognitiveservices-0.2.1/HISTORY.rst
--- old/azure-cli-cognitiveservices-0.1.12/HISTORY.rst  2018-04-06 
19:33:13.000000000 +0200
+++ new/azure-cli-cognitiveservices-0.2.1/HISTORY.rst   2018-08-23 
01:07:57.000000000 +0200
@@ -3,6 +3,22 @@
 Release History
 ===============
 
+0.2.1
++++++
+* Add new parameter --api-properties, which is required for creating some of 
the services.
+
+0.2.0
++++++
+* BREAKING CHANGE: 'show' commands log error message and fail with exit code 
of 3 upon a missing resource.
+
+0.1.14
+++++++
+* Minor fixes.
+
+0.1.13
+++++++
+* Fix typo with example for `az cognitiveservices account create` 
[#5603](https://github.com/Azure/azure-cli/issues/5603)
+
 0.1.12
 ++++++
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-cognitiveservices-0.1.12/PKG-INFO 
new/azure-cli-cognitiveservices-0.2.1/PKG-INFO
--- old/azure-cli-cognitiveservices-0.1.12/PKG-INFO     2018-04-06 
19:33:28.000000000 +0200
+++ new/azure-cli-cognitiveservices-0.2.1/PKG-INFO      2018-08-23 
01:09:51.000000000 +0200
@@ -1,12 +1,11 @@
 Metadata-Version: 1.1
 Name: azure-cli-cognitiveservices
-Version: 0.1.12
+Version: 0.2.1
 Summary: Microsoft Azure Command-Line Tools Cognitive Services Command Module
 Home-page: https://github.com/azure/azure-cli
 Author: Microsoft Corporation
 Author-email: [email protected]
 License: MIT
-Description-Content-Type: UNKNOWN
 Description: Microsoft Azure CLI 'cognitive services' Command Module
         =======================================================
         
@@ -21,6 +20,22 @@
         Release History
         ===============
         
+        0.2.1
+        +++++
+        * Add new parameter --api-properties, which is required for creating 
some of the services.
+        
+        0.2.0
+        +++++
+        * BREAKING CHANGE: 'show' commands log error message and fail with 
exit code of 3 upon a missing resource.
+        
+        0.1.14
+        ++++++
+        * Minor fixes.
+        
+        0.1.13
+        ++++++
+        * Fix typo with example for `az cognitiveservices account create` 
[#5603](https://github.com/Azure/azure-cli/issues/5603)
+        
         0.1.12
         ++++++
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cognitiveservices-0.1.12/azure/cli/command_modules/cognitiveservices/_help.py
 
new/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/_help.py
--- 
old/azure-cli-cognitiveservices-0.1.12/azure/cli/command_modules/cognitiveservices/_help.py
 2018-04-06 19:33:13.000000000 +0200
+++ 
new/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/_help.py
  2018-08-23 01:07:57.000000000 +0200
@@ -1,3 +1,4 @@
+# coding=utf-8
 # 
--------------------------------------------------------------------------------------------
 # Copyright (c) Microsoft Corporation. All rights reserved.
 # Licensed under the MIT License. See License.txt in the project root for 
license information.
@@ -27,6 +28,9 @@
 helps['cognitiveservices account delete'] = """
     type: command
     short-summary: Delete an Azure Cognitive Services account.
+    examples:
+        - name: Delete account.
+          text: az cognitiveservices account delete --name myresource-luis -g 
cognitive-services-resource-group
 """
 
 helps['cognitiveservices account create'] = """
@@ -34,22 +38,31 @@
     short-summary: Create an Azure Cognitive Services account.
     examples:
         - name: Create an S0 face API Cognitive Services account in West 
Europe without confirmation required.
-          text: az cognitiveservices create -n myresource -g myResourceGroup 
--kind Face --sku S0 -l WestEurope --yes
+          text: az cognitiveservices account create -n myresource -g 
myResourceGroup --kind Face --sku S0 -l WestEurope --yes
 """
 
 helps['cognitiveservices account show'] = """
     type: command
     short-summary: Get the details of an Azure Cognitive Services account.
+    examples:
+        - name: Show account information.
+          text: az cognitiveservices account show --name myresource 
--resource-group cognitive-services-resource-group
 """
 
 helps['cognitiveservices account update'] = """
     type: command
     short-summary: Update the properties of an Azure Cognitive Services 
account.
+    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
 """
 
 helps['cognitiveservices account list-skus'] = """
     type: command
     short-summary: List the SKUs avaiable for an Azure Cognitive Services 
account.
+    examples:
+        - name: Show SKUs.
+          text: az cognitiveservices account list-skus --name myresource -g 
cognitive-services-resource-group
 """
 
 
@@ -61,9 +74,15 @@
 helps['cognitiveservices account keys regenerate'] = """
     type: command
     short-summary: Regenerate the keys of an Azure Cognitive Services account.
+    examples:
+        - name: Get new keys for resource.
+          text: az cognitiveservices account keys regenerate --name myresource 
-g cognitive-services-resource-group --key-name key1
 """
 
 helps['cognitiveservices account keys list'] = """
     type: command
     short-summary: List the keys of an Azure Cognitive Services account.
+    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.1.12/azure/cli/command_modules/cognitiveservices/_params.py
 
new/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/_params.py
--- 
old/azure-cli-cognitiveservices-0.1.12/azure/cli/command_modules/cognitiveservices/_params.py
       2018-04-06 19:33:13.000000000 +0200
+++ 
new/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/_params.py
        2018-08-23 01:07:57.000000000 +0200
@@ -3,17 +3,72 @@
 # Licensed under the MIT License. See License.txt in the project root for 
license information.
 # 
--------------------------------------------------------------------------------------------
 
+import re
 from knack.arguments import CLIArgumentType
+from knack.log import get_logger
 
 from azure.cli.core.commands.parameters import (
     tags_type,
     resource_group_name_type,
     get_resource_name_completion_list)
+from azure.cli.core.util import (shell_safe_json_parse, CLIError)
 
+from azure.cli.core.commands.validators import validate_tag
 
+logger = get_logger(__name__)
 name_arg_type = CLIArgumentType(options_list=['--name', '-n'], metavar='NAME')
 
 
+def extract_key_values_pairs(api_properties):
+    api_properties_dict = {}
+    for item in api_properties:
+        api_properties_dict.update(validate_tag(item))
+    return api_properties_dict
+
+
+def validate_api_properties(ns):
+    """ Extracts JSON format or 'a=b c=d' format as api properties """
+    api_properties = ns.api_properties
+
+    if api_properties is None:
+        return
+
+    if len(api_properties) > 1:
+        ns.api_properties = extract_key_values_pairs(api_properties)
+    else:
+        string = api_properties[0]
+        try:
+            ns.api_properties = shell_safe_json_parse(string)
+            return
+        except CLIError:
+            result = extract_key_values_pairs([string])
+            if _is_suspected_json(string):
+                logger.warning('Api properties looks like a JSON format but 
not valid, interpreted as key=value pairs:'
+                               ' %s', str(result))
+            ns.api_properties = result
+            return
+
+
+def _is_suspected_json(string):
+    """ If the string looks like a JSON """
+    if string.startswith('{') or string.startswith('\'{') or 
string.startswith('\"{'):
+        return True
+    if string.startswith('[') or string.startswith('\'[') or 
string.startswith('\"['):
+        return True
+    if re.match(r"^['\"\s]*{.+}|\[.+\]['\"\s]*$", string):
+        return True
+
+    return False
+
+
+api_properties_type = CLIArgumentType(
+    validator=validate_api_properties,
+    help="Api properties in JSON format or a=b c=d format. Some cognitive 
services (i.e. QnA Maker) "
+         "require extra api properties to create the account.",
+    nargs='*'
+)
+
+
 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',
@@ -23,6 +78,7 @@
         c.argument('kind', help='the API name of cognitive services account')
         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)
 
     with self.argument_context('cognitiveservices account create') as c:
         c.argument('yes', action='store_true', help='Do not prompt for terms 
confirmation')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cognitiveservices-0.1.12/azure/cli/command_modules/cognitiveservices/commands.py
 
new/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/commands.py
--- 
old/azure-cli-cognitiveservices-0.1.12/azure/cli/command_modules/cognitiveservices/commands.py
      2018-04-06 19:33:13.000000000 +0200
+++ 
new/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/commands.py
       2018-08-23 01:07:57.000000000 +0200
@@ -18,7 +18,7 @@
     with self.command_group('cognitiveservices account', mgmt_type) as g:
         g.custom_command('create', 'create')
         g.command('delete', 'delete')
-        g.command('show', 'get_properties')
+        g.show_command('show', 'get_properties')
         g.custom_command('update', 'update')
         g.command('list-skus', 'list_skus')
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cognitiveservices-0.1.12/azure/cli/command_modules/cognitiveservices/custom.py
 
new/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/custom.py
--- 
old/azure-cli-cognitiveservices-0.1.12/azure/cli/command_modules/cognitiveservices/custom.py
        2018-04-06 19:33:13.000000000 +0200
+++ 
new/azure-cli-cognitiveservices-0.2.1/azure/cli/command_modules/cognitiveservices/custom.py
 2018-08-23 01:07:57.000000000 +0200
@@ -19,7 +19,7 @@
 
 
 def create(
-        client, resource_group_name, account_name, sku_name, kind, location, 
tags=None, yes=None):
+        client, resource_group_name, account_name, sku_name, kind, location, 
tags=None, api_properties=None, yes=None):
 
     terms = 'Notice\nMicrosoft will use data you send to Bing Search Services'\
         ' or the Translator Speech API to improve Microsoft products and 
services.'\
@@ -43,7 +43,11 @@
         if not option:
             raise CLIError('Operation cancelled.')
     sku = Sku(sku_name)
-    properties = {}
+
+    if api_properties is None:
+        properties = {}
+    else:
+        properties = {"apiProperties": api_properties}
     params = CognitiveServicesAccountCreateParameters(sku, kind, location, 
properties, tags)
     return client.create(resource_group_name, account_name, params)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cognitiveservices-0.1.12/azure_cli_cognitiveservices.egg-info/PKG-INFO
 
new/azure-cli-cognitiveservices-0.2.1/azure_cli_cognitiveservices.egg-info/PKG-INFO
--- 
old/azure-cli-cognitiveservices-0.1.12/azure_cli_cognitiveservices.egg-info/PKG-INFO
        2018-04-06 19:33:28.000000000 +0200
+++ 
new/azure-cli-cognitiveservices-0.2.1/azure_cli_cognitiveservices.egg-info/PKG-INFO
 2018-08-23 01:09:51.000000000 +0200
@@ -1,12 +1,11 @@
 Metadata-Version: 1.1
 Name: azure-cli-cognitiveservices
-Version: 0.1.12
+Version: 0.2.1
 Summary: Microsoft Azure Command-Line Tools Cognitive Services Command Module
 Home-page: https://github.com/azure/azure-cli
 Author: Microsoft Corporation
 Author-email: [email protected]
 License: MIT
-Description-Content-Type: UNKNOWN
 Description: Microsoft Azure CLI 'cognitive services' Command Module
         =======================================================
         
@@ -21,6 +20,22 @@
         Release History
         ===============
         
+        0.2.1
+        +++++
+        * Add new parameter --api-properties, which is required for creating 
some of the services.
+        
+        0.2.0
+        +++++
+        * BREAKING CHANGE: 'show' commands log error message and fail with 
exit code of 3 upon a missing resource.
+        
+        0.1.14
+        ++++++
+        * Minor fixes.
+        
+        0.1.13
+        ++++++
+        * Fix typo with example for `az cognitiveservices account create` 
[#5603](https://github.com/Azure/azure-cli/issues/5603)
+        
         0.1.12
         ++++++
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-cognitiveservices-0.1.12/setup.py 
new/azure-cli-cognitiveservices-0.2.1/setup.py
--- old/azure-cli-cognitiveservices-0.1.12/setup.py     2018-04-06 
19:33:13.000000000 +0200
+++ new/azure-cli-cognitiveservices-0.2.1/setup.py      2018-08-23 
01:07:57.000000000 +0200
@@ -13,7 +13,7 @@
     logger.warn("Wheel is not available, disabling bdist_wheel hook")
     cmdclass = {}
 
-VERSION = "0.1.12"
+VERSION = "0.2.1"
 # The full list of classifiers is available at
 # https://pypi.python.org/pypi?%3Aaction=list_classifiers
 CLASSIFIERS = [


Reply via email to