Hello community,

here is the log from the commit of package azure-cli-eventgrid for 
openSUSE:Factory checked in at 2018-02-14 09:30:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/azure-cli-eventgrid (Old)
 and      /work/SRC/openSUSE:Factory/.azure-cli-eventgrid.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "azure-cli-eventgrid"

Wed Feb 14 09:30:50 2018 rev:2 rq:574810 version:0.1.9

Changes:
--------
--- /work/SRC/openSUSE:Factory/azure-cli-eventgrid/azure-cli-eventgrid.changes  
2017-11-10 14:53:41.784109604 +0100
+++ 
/work/SRC/openSUSE:Factory/.azure-cli-eventgrid.new/azure-cli-eventgrid.changes 
    2018-02-14 09:30:51.465141626 +0100
@@ -1,0 +2,10 @@
+Wed Feb  7 16:06:37 UTC 2018 - adrian.glaub...@suse.com
+
+- New upstream release
+  + Version 0.1.9
+  + For detailed information about changes see the
+    HISTORY.rst file provided with this package
+- Install HISTORY.rst into doc directory
+- Update Requires from setup.py
+
+-------------------------------------------------------------------

Old:
----
  azure-cli-eventgrid-0.1.4.tar.gz

New:
----
  azure-cli-eventgrid-0.1.9.tar.gz

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

Other differences:
------------------
++++++ azure-cli-eventgrid.spec ++++++
--- /var/tmp/diff_new_pack.2oQfg8/_old  2018-02-14 09:30:52.793093505 +0100
+++ /var/tmp/diff_new_pack.2oQfg8/_new  2018-02-14 09:30:52.797093360 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package azure-cli-eventgrid
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 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
@@ -15,8 +15,9 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
+
 Name:           azure-cli-eventgrid
-Version:        0.1.4
+Version:        0.1.9
 Release:        0
 Summary:        Microsoft Azure CLI 'eventgrid' Command Module
 License:        MIT
@@ -24,18 +25,18 @@
 Url:            https://github.com/Azure/azure-cli
 Source:         
https://files.pythonhosted.org/packages/source/a/azure-cli-eventgrid/azure-cli-eventgrid-%{version}.tar.gz
 Source1:        LICENSE.txt
-BuildRequires:  python3-devel
-BuildRequires:  python3-setuptools
-BuildRequires:  unzip
 BuildRequires:  azure-cli-command-modules-nspkg
 BuildRequires:  azure-cli-nspkg
 BuildRequires:  python3-azure-nspkg
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+BuildRequires:  unzip
 Requires:       azure-cli-command-modules-nspkg
+Requires:       azure-cli-core
 Requires:       azure-cli-nspkg
+Requires:       python3-azure-mgmt-eventgrid >= 0.4.0
 Requires:       python3-azure-nspkg
-Requires:       azure-cli-core
 Requires:       python3-six
-Requires:       python3-azure-mgmt-eventgrid >= 0.2.0
 Conflicts:      azure-cli < 2.0.0
 
 BuildArch:      noarch
@@ -64,7 +65,8 @@
 
 %files
 %defattr(-,root,root,-)
-%doc LICENSE.txt README.rst
+%doc HISTORY.rst LICENSE.txt README.rst
 %{python3_sitelib}/azure/cli/command_modules/eventgrid
 %{python3_sitelib}/azure_cli_eventgrid-*.egg-info
+
 %changelog

++++++ azure-cli-eventgrid-0.1.4.tar.gz -> azure-cli-eventgrid-0.1.9.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-eventgrid-0.1.4/HISTORY.rst 
new/azure-cli-eventgrid-0.1.9/HISTORY.rst
--- old/azure-cli-eventgrid-0.1.4/HISTORY.rst   2017-09-23 01:47:00.000000000 
+0200
+++ new/azure-cli-eventgrid-0.1.9/HISTORY.rst   2018-01-26 17:12:23.000000000 
+0100
@@ -2,6 +2,33 @@
 
 Release History
 ===============
+
+0.1.9
++++++
+* Minor fixes.
+
+0.1.8
++++++
+* Minor fixes.
+
+0.1.7
++++++
+* BC: Removed the `az eventgrid topic event-subscription` commands. The 
corresponding `az eventgrid event-subscription` commands can now be used to 
manage event subscriptions for topics.
+* BC: Removed the `az eventgrid resource event-subscription` commands. The 
corresponding `az eventgrid event-subscription` commands can now be used to 
manage event subscriptions for Azure resources.
+* BC: Removed the `az eventgrid event-subscription show-endpoint-url` command. 
This can now be achieved using `az eventgrid event-subscription show` command 
with the --include-full-endpoint-url parameter.
+* Added a new command `az eventgrid topic update`.
+* Added a new command `az eventgrid event-subscription update`.
+* Added --ids parameter for `az eventgrid topic` commands.
+* Added tab completion support for topic names.
+
+0.1.6
++++++
+* minor fixes
+
+0.1.5
++++++
+* minor fixes
+
 0.1.4 (2017-09-22)
 ++++++++++++++++++
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-eventgrid-0.1.4/PKG-INFO 
new/azure-cli-eventgrid-0.1.9/PKG-INFO
--- old/azure-cli-eventgrid-0.1.4/PKG-INFO      2017-09-23 01:49:08.000000000 
+0200
+++ new/azure-cli-eventgrid-0.1.9/PKG-INFO      2018-01-26 17:12:43.000000000 
+0100
@@ -1,12 +1,11 @@
 Metadata-Version: 1.1
 Name: azure-cli-eventgrid
-Version: 0.1.4
+Version: 0.1.9
 Summary: Microsoft Azure Command-Line Tools EventGrid Command Module
 Home-page: https://github.com/Azure/azure-cli
 Author: Microsoft Corporation
 Author-email: azpy...@microsoft.com
 License: MIT
-Description-Content-Type: UNKNOWN
 Description: Microsoft Azure CLI 'eventgrid' Command Module
         =======================================================
         
@@ -20,6 +19,33 @@
         
         Release History
         ===============
+        
+        0.1.9
+        +++++
+        * Minor fixes.
+        
+        0.1.8
+        +++++
+        * Minor fixes.
+        
+        0.1.7
+        +++++
+        * BC: Removed the `az eventgrid topic event-subscription` commands. 
The corresponding `az eventgrid event-subscription` commands can now be used to 
manage event subscriptions for topics.
+        * BC: Removed the `az eventgrid resource event-subscription` commands. 
The corresponding `az eventgrid event-subscription` commands can now be used to 
manage event subscriptions for Azure resources.
+        * BC: Removed the `az eventgrid event-subscription show-endpoint-url` 
command. This can now be achieved using `az eventgrid event-subscription show` 
command with the --include-full-endpoint-url parameter.
+        * Added a new command `az eventgrid topic update`.
+        * Added a new command `az eventgrid event-subscription update`.
+        * Added --ids parameter for `az eventgrid topic` commands.
+        * Added tab completion support for topic names.
+        
+        0.1.6
+        +++++
+        * minor fixes
+        
+        0.1.5
+        +++++
+        * minor fixes
+        
         0.1.4 (2017-09-22)
         ++++++++++++++++++
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-eventgrid-0.1.4/azure/cli/command_modules/eventgrid/__init__.py 
new/azure-cli-eventgrid-0.1.9/azure/cli/command_modules/eventgrid/__init__.py
--- 
old/azure-cli-eventgrid-0.1.4/azure/cli/command_modules/eventgrid/__init__.py   
    2017-09-23 01:47:00.000000000 +0200
+++ 
new/azure-cli-eventgrid-0.1.9/azure/cli/command_modules/eventgrid/__init__.py   
    2018-01-26 17:12:23.000000000 +0100
@@ -3,12 +3,28 @@
 # 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.eventgrid._help  # pylint: 
disable=unused-import
 
 
-def load_params(_):
-    import azure.cli.command_modules.eventgrid._params  # pylint: 
disable=redefined-outer-name, unused-variable
+class EventGridCommandsLoader(AzCommandsLoader):
+
+    def __init__(self, cli_ctx=None):
+        from azure.cli.core.commands import CliCommandType
+        eventgrid_custom = 
CliCommandType(operations_tmpl='azure.cli.command_modules.eventgrid.custom#{}')
+        super(EventGridCommandsLoader, self).__init__(cli_ctx=cli_ctx,
+                                                      
custom_command_type=eventgrid_custom,
+                                                      
min_profile='2017-03-10-profile')
+
+    def load_command_table(self, args):
+        from azure.cli.command_modules.eventgrid.commands import 
load_command_table
+        load_command_table(self, args)
+        return self.command_table
+
+    def load_arguments(self, command):
+        from azure.cli.command_modules.eventgrid._params import load_arguments
+        load_arguments(self, command)
 
 
-def load_commands():
-    import azure.cli.command_modules.eventgrid.commands  # pylint: 
disable=redefined-outer-name, unused-variable
+COMMAND_LOADER_CLS = EventGridCommandsLoader
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-eventgrid-0.1.4/azure/cli/command_modules/eventgrid/_client_factory.py
 
new/azure-cli-eventgrid-0.1.9/azure/cli/command_modules/eventgrid/_client_factory.py
--- 
old/azure-cli-eventgrid-0.1.4/azure/cli/command_modules/eventgrid/_client_factory.py
        2017-09-23 01:47:00.000000000 +0200
+++ 
new/azure-cli-eventgrid-0.1.9/azure/cli/command_modules/eventgrid/_client_factory.py
        2018-01-26 17:12:23.000000000 +0100
@@ -4,19 +4,19 @@
 # 
--------------------------------------------------------------------------------------------
 
 
-def cf_eventgrid(**_):
+def cf_eventgrid(cli_ctx, **_):
     from azure.cli.core.commands.client_factory import get_mgmt_service_client
     from azure.mgmt.eventgrid import EventGridManagementClient
-    return get_mgmt_service_client(EventGridManagementClient)
+    return get_mgmt_service_client(cli_ctx, EventGridManagementClient)
 
 
-def topics_factory(_):
-    return cf_eventgrid().topics
+def topics_factory(cli_ctx, _):
+    return cf_eventgrid(cli_ctx).topics
 
 
-def event_subscriptions_factory(_):
-    return cf_eventgrid().event_subscriptions
+def event_subscriptions_factory(cli_ctx, _):
+    return cf_eventgrid(cli_ctx).event_subscriptions
 
 
-def topic_types_factory(_):
-    return cf_eventgrid().topic_types
+def topic_types_factory(cli_ctx, _):
+    return cf_eventgrid(cli_ctx).topic_types
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-eventgrid-0.1.4/azure/cli/command_modules/eventgrid/_help.py 
new/azure-cli-eventgrid-0.1.9/azure/cli/command_modules/eventgrid/_help.py
--- old/azure-cli-eventgrid-0.1.4/azure/cli/command_modules/eventgrid/_help.py  
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-eventgrid-0.1.9/azure/cli/command_modules/eventgrid/_help.py  
2018-01-26 17:12:23.000000000 +0100
@@ -4,7 +4,7 @@
 # 
--------------------------------------------------------------------------------------------
 # pylint: disable=line-too-long
 
-from azure.cli.core.help_files import helps
+from knack.help_files import helps  # pylint: disable=unused-import
 
 
 helps['eventgrid'] = """
@@ -20,19 +20,39 @@
     short-summary: Create a topic.
     examples:
         - name: Create a new topic.
-          text: az eventgrid topic create -g rg1 --name topic1
+          text: az eventgrid topic create -g rg1 --name topic1 -l westus2
+    """
+helps['eventgrid topic update'] = """
+    type: command
+    short-summary: Update a topic.
+    examples:
+        - name: Update the properties of an existing topic.
+          text: az eventgrid topic update -g rg1 --name topic1 --tags Dept=IT
     """
 helps['eventgrid topic delete'] = """
     type: command
     short-summary: Delete a topic.
+    examples:
+        - name: Delete a topic.
+          text: az eventgrid topic delete -g rg1 --name topic1
     """
 helps['eventgrid topic list'] = """
     type: command
     short-summary: List available topics.
+    examples:
+        - name: List all topics in the current Azure subscription.
+          text: az eventgrid topic list
+        - name: List all topics in a resource group.
+          text: az eventgrid topic list -g rg1
     """
 helps['eventgrid topic show'] = """
     type: command
     short-summary: Get the details of a topic.
+    examples:
+        - name: Show the details of a topic.
+          text: az eventgrid topic show -g rg1 -n topic1
+        - name: Show the details of a topic based on resource ID.
+          text: az eventgrid topic show --ids 
/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/kalstest/providers/Microsoft.EventGrid/topics/topic1
     """
 helps['eventgrid topic key'] = """
     type: group
@@ -46,59 +66,18 @@
     type: command
     short-summary: Regenerate a shared access key of a topic.
     """
-helps['eventgrid topic event-subscription'] = """
-    type: group
-    short-summary: Manage event subscriptions for a topic.
-    """
-helps['eventgrid topic event-subscription create'] = """
-    type: command
-    short-summary: Create a new event subscription to a topic.
-    examples:
-        - name: Create a new event subscription with default filters.
-          text: |
-            az eventgrid topic event-subscription create -g rg1 --topic-name 
topic1 --name es1 \\
-                --endpoint https://contoso.azurewebsites.net/api/f1?code=code
-        - name: Create a new event subscription with a filter specifying a 
subject prefix.
-          text: |
-            az eventgrid topic event-subscription create -g rg1 --topic-name 
topic1 --name es1 \\
-                --endpoint https://contoso.azurewebsites.net/api/f1?code=code 
\\
-                --subject-begins-with mysubject_prefix
-        - name: Create a new event subscription with default filters and 
additional labels.
-          text: |
-            az eventgrid topic event-subscription create -g rg1 --topic-name 
topic1 --name es1 \\
-                --endpoint https://contoso.azurewebsites.net/api/f1?code=code 
\\
-                --labels Finance HR
-        - name: Create a new event subscription with an EventHub as a 
destination.
-          text: |
-            az eventgrid topic event-subscription create -g rg1 --topic-name 
topic1 --name es1 \\
-                --endpoint-type eventhub \\
-                --endpoint 
/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1
 \\
-                --labels Finance HR
-    """
-helps['eventgrid topic event-subscription delete'] = """
-    type: command
-    short-summary: Delete an event subscription for a topic.
-    """
-helps['eventgrid topic event-subscription list'] = """
-    type: command
-    short-summary: List event subscriptions for a topic.
-    """
-helps['eventgrid topic event-subscription show'] = """
-    type: command
-    short-summary: Get the details of an event subscription for a topic.
-    """
-helps['eventgrid topic event-subscription show-endpoint-url'] = """
-    type: command
-    short-summary: Get the full endpoint URL of an event subscription for a 
topic.
-    """
 helps['eventgrid event-subscription'] = """
     type: group
-    short-summary: Manage event subscriptions.
+    short-summary: Manage event subscriptions for an Event Grid topic or for 
an Azure resource.
     """
 helps['eventgrid event-subscription create'] = """
     type: command
-    short-summary: Create a new event subscription for an Azure subscription 
or resource group.
+    short-summary: Create a new event subscription for an Event Grid topic or 
for an Azure resource.
     examples:
+        - name: Create a new event subscription for an Event Grid topic, using 
default filters.
+          text: |
+            az eventgrid event-subscription create -g rg1 --topic-name topic1 
--name es1 \\
+                --endpoint https://contoso.azurewebsites.net/api/f1?code=code
         - name: Create a new event subscription for a subscription, using 
default filters.
           text: |
             az eventgrid event-subscription create --name es2 \\
@@ -107,6 +86,10 @@
           text: |
             az eventgrid event-subscription create -g rg1 --name es3 \\
                 --endpoint https://contoso.azurewebsites.net/api/f1?code=code
+        - name: Create a new event subscription for a storage account, using 
default filters.
+          text: |
+            az eventgrid event-subscription create --resource-id 
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/kalstest/providers/Microsoft.Storage/storageaccounts/kalsegblob"
 --name es3 \\
+                --endpoint https://contoso.azurewebsites.net/api/f1?code=code
         - name: Create a new event subscription for a subscription, with a 
filter specifying a subject prefix.
           text: |
             az eventgrid event-subscription create --name es4 \\
@@ -122,60 +105,88 @@
             az eventgrid event-subscription create --name es2 --endpoint-type 
eventhub \\
                 --endpoint 
/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1
     """
+helps['eventgrid event-subscription update'] = """
+    type: command
+    short-summary: Update an event subscription.
+    examples:
+        - name: Update an event subscription for an Event Grid topic to 
specify a new endpoint.
+          text: |
+            az eventgrid event-subscription update -g rg1 --topic-name topic1 
--name es1 \\
+                --endpoint https://contoso.azurewebsites.net/api/f1?code=code
+        - name: Update an event subscription for a subscription to specify a 
new subject-ends-with filter.
+          text: |
+            az eventgrid event-subscription update --name es2 
--subject-ends-with .jpg
+        - name: Update an event subscription for a resource group to specify a 
new endpoint and a new subject-ends-with filter.
+          text: |
+            az eventgrid event-subscription update -g rg1 --name es3  
--subject-ends-with .png \\
+                --endpoint https://contoso.azurewebsites.net/api/f1?code=code
+        - name: Update an event subscription for a storage account to specify 
a new list of included event types.
+          text: |
+            az eventgrid event-subscription update --resource-id 
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/kalstest/providers/microsoft.storage/storageaccounts/kalsegblob"
 --name es3 \\
+                --included-event-types Microsoft.Storage.BlobCreated 
Microsoft.Storage.BlobDeleted
+    """
 helps['eventgrid event-subscription delete'] = """
     type: command
     short-summary: Delete an event subscription.
+    examples:
+        - name: Delete an event subscription for an Event Grid topic.
+          text: |
+            az eventgrid event-subscription delete -g rg1 --topic-name topic1 
--name es1
+        - name: Delete an event subscription for a subscription.
+          text: |
+            az eventgrid event-subscription delete --name es2
+        - name: Delete an event subscription for a resource group.
+          text: |
+            az eventgrid event-subscription delete -g rg1 --name es3
+        - name: Delete an event subscription for a storage account.
+          text: |
+            az eventgrid event-subscription delete --resource-id 
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/kalstest/providers/microsoft.storage/storageaccounts/kalsegblob"
 --name es3
     """
 helps['eventgrid event-subscription list'] = """
     type: command
     short-summary: List event subscriptions.
+    examples:
+        - name: List all event subscriptions for an Event Grid topic.
+          text: |
+            az eventgrid event-subscription list -g rg1 --topic-name topic1
+        - name: List all event subscriptions for a storage account.
+          text: |
+            az eventgrid event-subscription list --resource-id 
/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/kalstest/providers/Microsoft.Storage/storageaccounts/kalsegblob
+        - name: List all event subscriptions for a topic-type in a specific 
location (under the currently selected Azure subscription).
+          text: |
+            az eventgrid event-subscription list --topic-type 
Microsoft.Storage.StorageAccounts --location westus2
+        - name: List all event subscriptions for a topic-type in a specific 
location under a specified resource group.
+          text: |
+            az eventgrid event-subscription list --topic-type 
Microsoft.Storage.StorageAccounts --location westus2 --resource-group kalstest
+        - name: List all regional event subscriptions in a specific location 
(under the currently selected Azure subscription).
+          text: |
+            az eventgrid event-subscription list --location westus2
+        - name: List all event subscriptions in a specific location under a 
specified resource group.
+          text: |
+            az eventgrid event-subscription list --location westus2 
--resource-group kalstest
+        - name: List all global event subscriptions (under the currently 
selected Azure subscription).
+          text: |
+            az eventgrid event-subscription list
+        - name: List all global event subscriptions under the currently 
selected resource group.
+          text: |
+            az eventgrid event-subscription list --resource-group kalstest
     """
 helps['eventgrid event-subscription show'] = """
     type: command
     short-summary: Get the details of an event subscription.
-    """
-helps['eventgrid event-subscription show-endpoint-url'] = """
-    type: command
-    short-summary: Get the full endpoint URL of an event subscription.
-    """
-helps['eventgrid resource'] = """
-    type: group
-    short-summary: Manage Azure Event Grid resources.
-    """
-helps['eventgrid resource event-subscription'] = """
-    type: group
-    short-summary: Manage event subscriptions for a resource.
-    """
-helps['eventgrid resource event-subscription create'] = """
-    type: command
-    short-summary: Create a new event subscription for a resource.
     examples:
-        - name: Create a new event subscription to subscribe to events from an 
Azure Event Hubs namespace, using default filters.
+        - name: Show the details of an event subscription for an Event Grid 
topic.
           text: |
-            az eventgrid resource event-subscription create -g rg1 
--provider-namespace Microsoft.EventHub --resource-type namespaces \\
-                --resource-name EHNamespace1 --name es1 --endpoint 
https://contoso.azurewebsites.net/api/f1?code=code
-        - name: Create a new event subscription to subscribe to events from an 
Azure Storage account, using a filter specifying a subject prefix.
-          text: az eventgrid resource event-subscription create -g rg1 
--provider-namespace Microsoft.Storage --resource-type storageAccounts \\
-                --resource-name sa1 --name es1 --endpoint 
https://contoso.azurewebsites.net/api/f1?code=code --subject-begins-with 
mysubject_prefix
-        - name: Create a new event subscription to subscribe to events from an 
Azure Event Hubs namespace, using default filters and additional labels.
-          text: az eventgrid resource event-subscription create -g rg1 
--provider-namespace Microsoft.EventHub --resource-type namespaces \\
-                --resource-name EHNamespace1 --name es1 --endpoint 
https://contoso.azurewebsites.net/api/f1?code=code --labels Finance HR
-    """
-helps['eventgrid resource event-subscription delete'] = """
-    type: command
-    short-summary: Delete an event subscription from a resource.
-    """
-helps['eventgrid resource event-subscription list'] = """
-    type: command
-    short-summary: List the event subscriptions for a resource.
-    """
-helps['eventgrid resource event-subscription show'] = """
-    type: command
-    short-summary: Get the details of an event subscription for a resource.
-    """
-helps['eventgrid resource event-subscription show-endpoint-url'] = """
-    type: command
-    short-summary: Get the full endpoint URL of an event subscription for a 
resource.
+            az eventgrid event-subscription show -g rg1 --topic-name topic1 
--name es1
+        - name: Show the details of an event subscription for a subscription.
+          text: |
+            az eventgrid event-subscription show --name es2
+        - name: Show the details of an event subscription for a resource group.
+          text: |
+            az eventgrid event-subscription show -g rg1 --name es3
+        - name: Show the details of an event subscription for a storage 
account.
+          text: |
+            az eventgrid event-subscription show --resource-id 
"/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/kalstest/providers/microsoft.storage/storageaccounts/kalsegblob"
 --name es3
     """
 helps['eventgrid topic-type'] = """
     type: group
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-eventgrid-0.1.4/azure/cli/command_modules/eventgrid/_params.py 
new/azure-cli-eventgrid-0.1.9/azure/cli/command_modules/eventgrid/_params.py
--- 
old/azure-cli-eventgrid-0.1.4/azure/cli/command_modules/eventgrid/_params.py    
    2017-09-23 01:47:00.000000000 +0200
+++ 
new/azure-cli-eventgrid-0.1.9/azure/cli/command_modules/eventgrid/_params.py    
    2018-01-26 17:12:23.000000000 +0100
@@ -5,52 +5,64 @@
 
 # pylint: disable=line-too-long
 
-from azure.cli.core.commands import register_cli_argument, CliArgumentType
+from knack.arguments import CLIArgumentType
 
 from azure.cli.core.commands.parameters import (
     resource_group_name_type,
-    location_type,
-    enum_choice_list,
-    three_state_flag,
+    get_resource_name_completion_list,
+    get_three_state_flag,
+    get_location_type,
+    get_enum_type,
     tags_type,
     name_type
 )
 
-included_event_types_type = CliArgumentType(
+included_event_types_type = CLIArgumentType(
     help="A space separated list of event types. To subscribe to all event 
types, the string \"All\" should be specified.",
     nargs='+'
 )
 
-labels_type = CliArgumentType(
+labels_type = CLIArgumentType(
     help="A space separated list of labels to associate with this event 
subscription.",
     nargs='+'
 )
 
-register_cli_argument('eventgrid', 'resource_group_name', 
resource_group_name_type)
-register_cli_argument('eventgrid', 'location', location_type)
-register_cli_argument('eventgrid', 'tags', tags_type, help="Space separated 
tags in 'key[=value]' format.")
-
-register_cli_argument('eventgrid', 'endpoint', help="Endpoint where EventGrid 
should deliver events matching this event subscription. For webhook endpoint 
type, this should be the corresponding webhook URL. For eventhub endpoint type, 
this should be the Azure ResourceID of the event hub.")
-register_cli_argument('eventgrid', 'event_subscription_name', help="Name of 
the event subscription.")
-register_cli_argument('eventgrid', 'subject_begins_with', help="An optional 
string to filter events for an event subscription based on a prefix. Wildcard 
characters are not supported.")
-register_cli_argument('eventgrid', 'subject_ends_with', help="An optional 
string to filter events for an event subscription based on a suffix. Wildcard 
characters are not supported.")
-register_cli_argument('eventgrid', 'topic_type_name', help="Name of the topic 
type.")
-
-
-register_cli_argument('eventgrid topic', 'topic_name', arg_type=name_type, 
help='Name of the topic', id_part="name")
-register_cli_argument('eventgrid topic event-subscription', 'topic_name', 
options_list=['--topic-name'])
-register_cli_argument('eventgrid topic event-subscription', 
'event_subscription_name', name_type, help='Name of the event subscription')
-register_cli_argument('eventgrid event-subscription', 
'event_subscription_name', name_type, help='Name of the event subscription')
-register_cli_argument('eventgrid resource event-subscription', 
'event_subscription_name', name_type, help='Name of the event subscription')
-
-register_cli_argument('eventgrid', 'is_subject_case_sensitive', 
options_list=['--subject-case-sensitive'], help="Specify to indicate whether 
the subject fields should be compared in a case sensitive manner. True if flag 
present.", **three_state_flag())
-
-register_cli_argument('eventgrid', 'included_event_types', 
included_event_types_type)
-register_cli_argument('eventgrid', 'labels', labels_type)
-register_cli_argument('eventgrid', 'endpoint_type', 
**enum_choice_list(['webhook', 'eventhub']))
-
-register_cli_argument('eventgrid', 'provider_namespace', help="Namespace of 
the provider owning the resource.")
-register_cli_argument('eventgrid', 'resource_type', help="Type of the 
resource.")
-register_cli_argument('eventgrid', 'resource_name', help="Name of the resource 
whose event subscription needs to be managed.")
 
-register_cli_argument('eventgrid topic-type', 'topic_type_name', name_type)
+def load_arguments(self, _):
+    with self.argument_context('eventgrid') as c:
+        c.argument('resource_group_name', arg_type=resource_group_name_type)
+        c.argument('location', arg_type=get_location_type(self.cli_ctx))
+        c.argument('tags', arg_type=tags_type)
+        c.argument('included_event_types', arg_type=included_event_types_type)
+        c.argument('labels', arg_type=labels_type)
+        c.argument('endpoint_type', arg_type=get_enum_type(['webhook', 
'eventhub'], default='webhook'))
+        c.argument('resource_id', help="Fully qualified identifier of the 
Azure resource.")
+        c.argument('endpoint', help="Endpoint where EventGrid should deliver 
events matching this event subscription. For webhook endpoint type, this should 
be the corresponding webhook URL. For eventhub endpoint type, this should be 
the Azure ResourceID of the event hub.")
+        c.argument('event_subscription_name', help="Name of the event 
subscription.")
+        c.argument('subject_begins_with', help="An optional string to filter 
events for an event subscription based on a prefix. Wildcard characters are not 
supported.")
+        c.argument('subject_ends_with', help="An optional string to filter 
events for an event subscription based on a suffix. Wildcard characters are not 
supported.")
+        c.argument('topic_type_name', help="Name of the topic type.")
+        c.argument('is_subject_case_sensitive', 
arg_type=get_three_state_flag(), options_list=['--subject-case-sensitive'], 
help="Specify to indicate whether the subject fields should be compared in a 
case sensitive manner. True if flag present.", )
+
+    with self.argument_context('eventgrid topic') as c:
+        c.argument('topic_name', arg_type=name_type, help='Name of the topic', 
id_part='name', 
completer=get_resource_name_completion_list('Microsoft.EventGrid/topics'))
+
+    with self.argument_context('eventgrid event-subscription') as c:
+        c.argument('topic_name', help='Name of the Event Grid topic', 
options_list=['--topic-name'], 
completer=get_resource_name_completion_list('Microsoft.EventGrid/topics'))
+        c.argument('event_subscription_name', arg_type=name_type, help='Name 
of the event subscription')
+
+    with self.argument_context('eventgrid event-subscription create') as c:
+        c.argument('topic_name', help='Name of the Event Grid topic to which 
the event subscription needs to be created.', options_list=['--topic-name'], 
completer=get_resource_name_completion_list('Microsoft.EventGrid/topics'))
+        c.argument('event_subscription_name', arg_type=name_type, help='Name 
of the new event subscription')
+        c.argument('resource_id', help="Fully qualified identifier of the 
Azure resource to which the event subscription needs to be created.")
+
+    with self.argument_context('eventgrid event-subscription delete') as c:
+        c.argument('topic_name', help='Name of the Event Grid topic whose 
event subscription needs to be deleted.', options_list=['--topic-name'], 
completer=get_resource_name_completion_list('Microsoft.EventGrid/topics'))
+        c.argument('event_subscription_name', arg_type=name_type, help='Name 
of the event subscription')
+        c.argument('resource_id', help="Fully qualified identifier of the 
Azure resource whose event subscription needs to be deleted.")
+
+    with self.argument_context('eventgrid event-subscription show') as c:
+        c.argument('include_full_endpoint_url', 
arg_type=get_three_state_flag(), options_list=['--include-full-endpoint-url'], 
help="Specify to indicate whether the full endpoint URL should be returned. 
True if flag present.", )
+
+    with self.argument_context('eventgrid topic-type') as c:
+        c.argument('topic_type_name', arg_type=name_type, help="Name of the 
topic type.", 
completer=get_resource_name_completion_list('Microsoft.EventGrid/topictypes'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-eventgrid-0.1.4/azure/cli/command_modules/eventgrid/commands.py 
new/azure-cli-eventgrid-0.1.9/azure/cli/command_modules/eventgrid/commands.py
--- 
old/azure-cli-eventgrid-0.1.4/azure/cli/command_modules/eventgrid/commands.py   
    2017-09-23 01:47:00.000000000 +0200
+++ 
new/azure-cli-eventgrid-0.1.9/azure/cli/command_modules/eventgrid/commands.py   
    2018-01-26 17:12:23.000000000 +0100
@@ -5,40 +5,49 @@
 
 # pylint: disable=line-too-long
 
-from azure.cli.core.commands import cli_command
-from azure.cli.core.profiles import supported_api_version, PROFILE_TYPE
+from azure.cli.core.commands import CliCommandType
 from ._client_factory import (topics_factory, event_subscriptions_factory, 
topic_types_factory)
 
-if not supported_api_version(PROFILE_TYPE, max_api='2017-03-09-profile'):
-    topics_mgmt_path = 'azure.mgmt.eventgrid.operations.topics_operations#'
-    topic_types_mgmt_path = 
'azure.mgmt.eventgrid.operations.topic_types_operations#'
-    custom_path = 'azure.cli.command_modules.eventgrid.custom#'
-
-    cli_command(__name__, 'eventgrid topic create', topics_mgmt_path + 
'TopicsOperations.create_or_update', topics_factory)
-    cli_command(__name__, 'eventgrid topic show', topics_mgmt_path + 
'TopicsOperations.get', topics_factory)
-    cli_command(__name__, 'eventgrid topic key list', topics_mgmt_path + 
'TopicsOperations.list_shared_access_keys', topics_factory)
-    cli_command(__name__, 'eventgrid topic key regenerate', topics_mgmt_path + 
'TopicsOperations.regenerate_key', topics_factory)
-    cli_command(__name__, 'eventgrid topic delete', topics_mgmt_path + 
'TopicsOperations.delete', topics_factory)
-    cli_command(__name__, 'eventgrid topic list', custom_path + 
'cli_topic_list', topics_factory)
-
-    cli_command(__name__, 'eventgrid event-subscription create', custom_path + 
'cli_eventgrid_event_subscription_arm_create', event_subscriptions_factory)
-    cli_command(__name__, 'eventgrid event-subscription show', custom_path + 
'cli_eventgrid_event_subscription_arm_get', event_subscriptions_factory)
-    cli_command(__name__, 'eventgrid event-subscription show-endpoint-url', 
custom_path + 'cli_eventgrid_event_subscription_arm_get_full_url', 
event_subscriptions_factory)
-    cli_command(__name__, 'eventgrid event-subscription delete', custom_path + 
'cli_eventgrid_event_subscription_arm_delete', event_subscriptions_factory)
-    cli_command(__name__, 'eventgrid event-subscription list', custom_path + 
'cli_event_subscription_list', event_subscriptions_factory)
-
-    cli_command(__name__, 'eventgrid topic event-subscription create', 
custom_path + 'cli_eventgrid_event_subscription_topic_create', 
event_subscriptions_factory)
-    cli_command(__name__, 'eventgrid topic event-subscription show', 
custom_path + 'cli_eventgrid_event_subscription_topic_get', 
event_subscriptions_factory)
-    cli_command(__name__, 'eventgrid topic event-subscription 
show-endpoint-url', custom_path + 
'cli_eventgrid_event_subscription_topic_get_full_url', 
event_subscriptions_factory)
-    cli_command(__name__, 'eventgrid topic event-subscription delete', 
custom_path + 'cli_eventgrid_event_subscription_topic_delete', 
event_subscriptions_factory)
-    cli_command(__name__, 'eventgrid topic event-subscription list', 
custom_path + 'cli_topic_event_subscription_list', event_subscriptions_factory)
-
-    cli_command(__name__, 'eventgrid resource event-subscription create', 
custom_path + 'cli_eventgrid_event_subscription_resource_create', 
event_subscriptions_factory)
-    cli_command(__name__, 'eventgrid resource event-subscription show', 
custom_path + 'cli_eventgrid_event_subscription_resource_get', 
event_subscriptions_factory)
-    cli_command(__name__, 'eventgrid resource event-subscription 
show-endpoint-url', custom_path + 
'cli_eventgrid_event_subscription_resource_get_full_url', 
event_subscriptions_factory)
-    cli_command(__name__, 'eventgrid resource event-subscription delete', 
custom_path + 'cli_eventgrid_event_subscription_resource_delete', 
event_subscriptions_factory)
-    cli_command(__name__, 'eventgrid resource event-subscription list', 
custom_path + 'cli_resource_event_subscription_list', 
event_subscriptions_factory)
-
-    cli_command(__name__, 'eventgrid topic-type list', topic_types_mgmt_path + 
'TopicTypesOperations.list', topic_types_factory)
-    cli_command(__name__, 'eventgrid topic-type show', topic_types_mgmt_path + 
'TopicTypesOperations.get', topic_types_factory)
-    cli_command(__name__, 'eventgrid topic-type list-event-types', 
topic_types_mgmt_path + 'TopicTypesOperations.list_event_types', 
topic_types_factory)
+
+def load_command_table(self, _):
+    topics_mgmt_util = CliCommandType(
+        
operations_tmpl='azure.mgmt.eventgrid.operations.topics_operations#TopicsOperations.{}',
+        client_factory=topics_factory
+    )
+
+    topic_type_mgmt_util = CliCommandType(
+        
operations_tmpl='azure.mgmt.eventgrid.operations.topic_types_operations#TopicTypesOperations.{}',
+        client_factory=topic_types_factory
+    )
+
+    with self.command_group('eventgrid topic', topics_mgmt_util, 
client_factory=topics_factory) as g:
+        g.command('create', 'create_or_update')
+        g.command('show', 'get')
+        g.command('key list', 'list_shared_access_keys')
+        g.command('key regenerate', 'regenerate_key')
+        g.command('delete', 'delete')
+        g.custom_command('list', 'cli_topic_list')
+        g.generic_update_command('update',
+                                 getter_name='get',
+                                 setter_name='update',
+                                 client_factory=topics_factory)
+
+    custom_tmpl = 'azure.cli.command_modules.eventgrid.custom#{}'
+    eventgrid_custom = CliCommandType(operations_tmpl=custom_tmpl)
+
+    with self.command_group('eventgrid event-subscription', 
client_factory=event_subscriptions_factory) as g:
+        g.custom_command('create', 'cli_eventgrid_event_subscription_create')
+        g.custom_command('show', 'cli_eventgrid_event_subscription_get')
+        g.custom_command('delete', 'cli_eventgrid_event_subscription_delete')
+        g.custom_command('list', 'cli_event_subscription_list')
+        g.generic_update_command('update',
+                                 getter_type=eventgrid_custom,
+                                 setter_type=eventgrid_custom,
+                                 getter_name='event_subscription_getter',
+                                 setter_name='event_subscription_setter',
+                                 custom_func_name='update_event_subscription')
+
+    with self.command_group('eventgrid topic-type', topic_type_mgmt_util) as g:
+        g.command('list', 'list')
+        g.command('show', 'get')
+        g.command('list-event-types', 'list_event_types')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-eventgrid-0.1.4/azure/cli/command_modules/eventgrid/custom.py 
new/azure-cli-eventgrid-0.1.9/azure/cli/command_modules/eventgrid/custom.py
--- old/azure-cli-eventgrid-0.1.4/azure/cli/command_modules/eventgrid/custom.py 
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-eventgrid-0.1.9/azure/cli/command_modules/eventgrid/custom.py 
2018-01-26 17:12:23.000000000 +0100
@@ -3,21 +3,25 @@
 # Licensed under the MIT License. See License.txt in the project root for 
license information.
 # 
--------------------------------------------------------------------------------------------
 
-import azure.cli.core.azlogging as azlogging
+from six.moves.urllib.parse import quote  # pylint: disable=import-error
+from knack.log import get_logger
+from knack.util import CLIError
+from msrestazure.tools import parse_resource_id
+
 from azure.cli.core.commands.client_factory import get_subscription_id
 from azure.mgmt.eventgrid.models import (
     EventSubscription,
+    EventSubscriptionUpdateParameters,
     WebHookEventSubscriptionDestination,
     EventHubEventSubscriptionDestination,
     EventSubscriptionFilter)
 
-from six.moves.urllib.parse import quote  # pylint: disable=import-error
+logger = get_logger(__name__)
 
-logger = azlogging.get_az_logger(__name__)
 EVENTGRID_NAMESPACE = "Microsoft.EventGrid"
 RESOURCES_NAMESPACE = "Microsoft.Resources"
-RESOURCE_TYPE_SUBSCRIPTIONS = "subscriptions"
-RESOURCE_TYPE_RESOURCE_GROUPS = "resourcegroups"
+SUBSCRIPTIONS = "subscriptions"
+RESOURCE_GROUPS = "resourcegroups"
 EVENTGRID_TOPICS = "topics"
 WEBHOOK_DESTINATION = "webhook"
 EVENTHUB_DESTINATION = "eventhub"
@@ -32,259 +36,123 @@
     return client.list_by_subscription()
 
 
-def cli_eventgrid_event_subscription_topic_create(
+def cli_eventgrid_event_subscription_create(
+        cmd,
         client,
-        resource_group_name,
-        topic_name,
         event_subscription_name,
         endpoint,
-        endpoint_type="WebHook",
+        resource_id=None,
+        resource_group_name=None,
+        topic_name=None,
+        endpoint_type=WEBHOOK_DESTINATION,
         included_event_types=None,
         subject_begins_with=None,
         subject_ends_with=None,
         is_subject_case_sensitive=False,
         labels=None):
-    return _event_subscription_create(
-        client,
-        resource_group_name,
-        EVENTGRID_NAMESPACE,
-        EVENTGRID_TOPICS,
-        topic_name,
-        event_subscription_name,
-        endpoint,
-        endpoint_type,
-        included_event_types,
-        subject_begins_with,
-        subject_ends_with,
-        is_subject_case_sensitive,
-        labels)
-
-
-def cli_eventgrid_event_subscription_topic_get(
-        client,
-        resource_group_name,
-        topic_name,
-        event_subscription_name):
-    return _event_subscription_get(
-        client,
-        resource_group_name,
-        EVENTGRID_NAMESPACE,
-        EVENTGRID_TOPICS,
-        topic_name,
-        event_subscription_name)
-
-
-def cli_eventgrid_event_subscription_topic_get_full_url(
-        client,
-        resource_group_name,
-        topic_name,
-        event_subscription_name):
-    return _event_subscription_get_full_url(
-        client,
-        resource_group_name,
-        EVENTGRID_NAMESPACE,
-        EVENTGRID_TOPICS,
-        topic_name,
-        event_subscription_name)
-
-
-def cli_eventgrid_event_subscription_topic_delete(
-        client,
-        resource_group_name,
-        topic_name,
-        event_subscription_name):
-    _event_subscription_delete(
-        client,
-        resource_group_name,
-        EVENTGRID_NAMESPACE,
-        EVENTGRID_TOPICS,
-        topic_name,
-        event_subscription_name)
+    scope = _get_scope_for_event_subscription(cmd.cli_ctx, resource_id, 
topic_name, resource_group_name)
 
+    if endpoint_type.lower() == WEBHOOK_DESTINATION.lower():
+        destination = WebHookEventSubscriptionDestination(endpoint)
+    elif endpoint_type.lower() == EVENTHUB_DESTINATION.lower():
+        destination = EventHubEventSubscriptionDestination(endpoint)
 
-def cli_eventgrid_event_subscription_resource_create(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name,
-        event_subscription_name,
-        endpoint,
-        endpoint_type="WebHook",
-        included_event_types=None,
-        subject_begins_with=None,
-        subject_ends_with=None,
-        is_subject_case_sensitive=False,
-        labels=None):
-    return _event_subscription_create(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name,
-        event_subscription_name,
-        endpoint,
-        endpoint_type,
-        included_event_types,
+    event_subscription_filter = EventSubscriptionFilter(
         subject_begins_with,
         subject_ends_with,
-        is_subject_case_sensitive,
-        labels)
-
-
-def cli_eventgrid_event_subscription_resource_get(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name,
-        event_subscription_name):
-    return _event_subscription_get(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name,
-        event_subscription_name)
-
-
-def cli_eventgrid_event_subscription_resource_get_full_url(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name,
-        event_subscription_name):
-    return _event_subscription_get_full_url(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name,
-        event_subscription_name)
-
+        included_event_types,
+        is_subject_case_sensitive)
+    event_subscription_info = EventSubscription(destination, 
event_subscription_filter, labels)
 
-def cli_eventgrid_event_subscription_resource_delete(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name,
-        event_subscription_name):
-    _event_subscription_delete(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name,
-        event_subscription_name)
+    async_event_subscription_create = client.create_or_update(
+        scope,
+        event_subscription_name,
+        event_subscription_info)
+    created_event_subscription = async_event_subscription_create.result()
+    return created_event_subscription
 
 
-def cli_eventgrid_event_subscription_arm_create(
+def event_subscription_setter(
+        cmd,
         client,
+        parameters,
         event_subscription_name,
-        endpoint,
+        resource_id=None,
         resource_group_name=None,
-        endpoint_type="WebHook",
-        included_event_types=None,
-        subject_begins_with=None,
-        subject_ends_with=None,
-        is_subject_case_sensitive=False,
-        labels=None):
-    resource_type, resource_name = _get_arm_resource_info(resource_group_name)
-
-    return _event_subscription_create(
-        client,
-        resource_group_name,
-        RESOURCES_NAMESPACE,
-        resource_type,
-        resource_name,
-        event_subscription_name,
-        endpoint,
-        endpoint_type,
-        included_event_types,
-        subject_begins_with,
-        subject_ends_with,
-        is_subject_case_sensitive,
-        labels)
-
+        topic_name=None):
+    scope = _get_scope_for_event_subscription(cmd.cli_ctx, resource_id, 
topic_name, resource_group_name)
 
-def cli_eventgrid_event_subscription_arm_get(
-        client,
+    async_event_subscription_update = client.update(
+        scope,
         event_subscription_name,
-        resource_group_name=None):
-    resource_type, resource_name = _get_arm_resource_info(resource_group_name)
-
-    return _event_subscription_get(
-        client,
-        resource_group_name,
-        RESOURCES_NAMESPACE,
-        resource_type,
-        resource_name,
-        event_subscription_name)
+        parameters)
+    updated_event_subscription = async_event_subscription_update.result()
+    return updated_event_subscription
 
 
-def cli_eventgrid_event_subscription_arm_get_full_url(
+def cli_eventgrid_event_subscription_get(
+        cmd,
         client,
         event_subscription_name,
-        resource_group_name=None):
-    resource_type, resource_name = _get_arm_resource_info(resource_group_name)
+        resource_id=None,
+        resource_group_name=None,
+        topic_name=None,
+        include_full_endpoint_url=False):
+    scope = _get_scope_for_event_subscription(cmd.cli_ctx, resource_id, 
topic_name, resource_group_name)
+    retrieved_event_subscription = client.get(scope, event_subscription_name)
+    destination = retrieved_event_subscription.destination
+    if include_full_endpoint_url and isinstance(destination, 
WebHookEventSubscriptionDestination):
+        full_endpoint_url = client.get_full_url(scope, event_subscription_name)
+        destination.endpoint_url = full_endpoint_url.endpoint_url
 
-    return _event_subscription_get_full_url(
-        client,
-        resource_group_name,
-        RESOURCES_NAMESPACE,
-        resource_type,
-        resource_name,
-        event_subscription_name)
+    return retrieved_event_subscription
 
 
-def cli_eventgrid_event_subscription_arm_delete(
+def cli_eventgrid_event_subscription_delete(
+        cmd,
         client,
         event_subscription_name,
-        resource_group_name=None):
-    resource_type, resource_name = _get_arm_resource_info(resource_group_name)
-
-    _event_subscription_delete(
-        client,
-        resource_group_name,
-        RESOURCES_NAMESPACE,
-        resource_type,
-        resource_name,
-        event_subscription_name)
-
-
-def cli_topic_event_subscription_list(
-        client,
-        resource_group_name,
-        topic_name):
-    return resource_event_subscription_list_internal(
-        client,
-        resource_group_name,
-        EVENTGRID_NAMESPACE,
-        EVENTGRID_TOPICS,
-        topic_name)
-
-
-def cli_resource_event_subscription_list(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name):
-    return resource_event_subscription_list_internal(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name)
+        resource_id=None,
+        resource_group_name=None,
+        topic_name=None):
+    scope = _get_scope_for_event_subscription(cmd.cli_ctx, resource_id, 
topic_name, resource_group_name)
+    client.delete(scope, event_subscription_name)
 
 
 def cli_event_subscription_list(   # pylint: disable=too-many-return-statements
         client,
+        resource_id=None,
         resource_group_name=None,
+        topic_name=None,
         location=None,
         topic_type_name=None):
+    if resource_id:
+        # Resource ID is specified, we need to list only for the particular 
resource.
+        if resource_group_name is not None or topic_name is not None:
+            raise CLIError('Since ResourceId is specified, topic-name and 
resource-group-name should not be specified.')
+
+        id_parts = parse_resource_id(resource_id)
+        rg_name = id_parts['resource_group']
+        resource_name = id_parts['name']
+        provider_namespace = id_parts['namespace']
+        resource_type = id_parts['resource_type']
+
+        return client.list_by_resource(
+            rg_name,
+            provider_namespace,
+            resource_type,
+            resource_name)
+
+    if topic_name:
+        if resource_group_name is None:
+            raise CLIError('Since topic-name is specified, resource-group-name 
must also be specified.')
+
+        return client.list_by_resource(
+            resource_group_name,
+            EVENTGRID_NAMESPACE,
+            EVENTGRID_TOPICS,
+            topic_name)
+
     if topic_type_name:
         if location:
             if resource_group_name:
@@ -318,95 +186,13 @@
     return client.list_global_by_subscription()
 
 
-def resource_event_subscription_list_internal(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name):
-    return client.list_by_resource(
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name)
-
-
-def _event_subscription_create(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name,
-        event_subscription_name,
-        endpoint,
-        endpoint_type,
-        included_event_types,
-        subject_begins_with,
-        subject_ends_with,
-        is_subject_case_sensitive,
-        labels):
-    scope = _get_scope(resource_group_name, provider_namespace, resource_type, 
resource_name)
-    if endpoint_type.lower() == WEBHOOK_DESTINATION.lower():
-        destination = WebHookEventSubscriptionDestination(endpoint)
-    elif endpoint_type.lower() == EVENTHUB_DESTINATION.lower():
-        destination = EventHubEventSubscriptionDestination(endpoint)
-
-    event_subscription_filter = EventSubscriptionFilter(
-        subject_begins_with,
-        subject_ends_with,
-        included_event_types,
-        is_subject_case_sensitive)
-    event_subscription_info = EventSubscription(destination, 
event_subscription_filter, labels)
-
-    async_event_subscription_create = client.create(
-        scope,
-        event_subscription_name,
-        event_subscription_info)
-    created_event_subscription = async_event_subscription_create.result()
-    return created_event_subscription
-
-
-def _event_subscription_get(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name,
-        event_subscription_name):
-    scope = _get_scope(resource_group_name, provider_namespace, resource_type, 
resource_name)
-    retrieved_event_subscription = client.get(scope, event_subscription_name)
-    return retrieved_event_subscription
-
-
-def _event_subscription_get_full_url(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name,
-        event_subscription_name):
-    scope = _get_scope(resource_group_name, provider_namespace, resource_type, 
resource_name)
-    full_endpoint_url = client.get_full_url(scope, event_subscription_name)
-    return full_endpoint_url
-
-
-def _event_subscription_delete(
-        client,
-        resource_group_name,
-        provider_namespace,
-        resource_type,
-        resource_name,
-        event_subscription_name):
-    scope = _get_scope(resource_group_name, provider_namespace, resource_type, 
resource_name)
-    client.delete(scope, event_subscription_name)
-
-
 def _get_scope(
+        cli_ctx,
         resource_group_name,
         provider_namespace,
         resource_type,
         resource_name):
-    subscription_id = get_subscription_id()
+    subscription_id = get_subscription_id(cli_ctx)
 
     if provider_namespace == RESOURCES_NAMESPACE:
         if resource_group_name:
@@ -430,12 +216,75 @@
     return scope
 
 
-def _get_arm_resource_info(resource_group_name):
-    if resource_group_name:
-        resource_type = RESOURCE_TYPE_RESOURCE_GROUPS
-        resource_name = resource_group_name
+def _get_scope_for_event_subscription(
+        cli_ctx,
+        resource_id,
+        topic_name,
+        resource_group_name):
+    if resource_id:
+        # Resource ID is provided, use that as the scope for the event 
subscription.
+        scope = resource_id
+    elif topic_name:
+        # Topic name is provided, use the topic and resource group to build a 
scope for the user topic
+        if resource_group_name is None:
+            raise CLIError("When topic name is specified, the resource group 
name must also be specified.")
+
+        scope = _get_scope(cli_ctx, resource_group_name, EVENTGRID_NAMESPACE, 
EVENTGRID_TOPICS, topic_name)
+    elif resource_group_name:
+        # Event subscription to a resource group.
+        scope = _get_scope(cli_ctx, resource_group_name, RESOURCES_NAMESPACE, 
RESOURCE_GROUPS, resource_group_name)
     else:
-        resource_type = RESOURCE_TYPE_SUBSCRIPTIONS
-        resource_name = get_subscription_id()
+        scope = _get_scope(cli_ctx, None, RESOURCES_NAMESPACE, SUBSCRIPTIONS, 
get_subscription_id(cli_ctx))
+
+    return scope
+
+
+def event_subscription_getter(
+        cmd,
+        client,
+        event_subscription_name,
+        resource_id=None,
+        resource_group_name=None,
+        topic_name=None):
+    scope = _get_scope_for_event_subscription(cmd.cli_ctx, resource_id, 
topic_name, resource_group_name)
+    retrieved_event_subscription = client.get(scope, event_subscription_name)
+    return retrieved_event_subscription
+
+
+def update_event_subscription(
+        instance,
+        endpoint=None,
+        endpoint_type=WEBHOOK_DESTINATION,
+        subject_begins_with=None,
+        subject_ends_with=None,
+        included_event_types=None,
+        labels=None):
+    event_subscription_destination = None
+    event_subscription_labels = instance.labels
+    event_subscription_filter = instance.filter
+
+    if endpoint is not None:
+        if endpoint_type.lower() == WEBHOOK_DESTINATION.lower():
+            event_subscription_destination = 
WebHookEventSubscriptionDestination(endpoint)
+        elif endpoint_type.lower() == EVENTHUB_DESTINATION.lower():
+            event_subscription_destination = 
EventHubEventSubscriptionDestination(endpoint)
+
+    if subject_begins_with is not None:
+        event_subscription_filter.subject_begins_with = subject_begins_with
+
+    if subject_ends_with is not None:
+        event_subscription_filter.subject_ends_with = subject_ends_with
+
+    if included_event_types is not None:
+        event_subscription_filter.included_event_types = included_event_types
+
+    if labels is not None:
+        event_subscription_labels = labels
+
+    params = EventSubscriptionUpdateParameters(
+        destination=event_subscription_destination,
+        filter=event_subscription_filter,
+        labels=event_subscription_labels
+    )
 
-    return resource_type, resource_name
+    return params
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-eventgrid-0.1.4/azure_cli_eventgrid.egg-info/PKG-INFO 
new/azure-cli-eventgrid-0.1.9/azure_cli_eventgrid.egg-info/PKG-INFO
--- old/azure-cli-eventgrid-0.1.4/azure_cli_eventgrid.egg-info/PKG-INFO 
2017-09-23 01:49:07.000000000 +0200
+++ new/azure-cli-eventgrid-0.1.9/azure_cli_eventgrid.egg-info/PKG-INFO 
2018-01-26 17:12:43.000000000 +0100
@@ -1,12 +1,11 @@
 Metadata-Version: 1.1
 Name: azure-cli-eventgrid
-Version: 0.1.4
+Version: 0.1.9
 Summary: Microsoft Azure Command-Line Tools EventGrid Command Module
 Home-page: https://github.com/Azure/azure-cli
 Author: Microsoft Corporation
 Author-email: azpy...@microsoft.com
 License: MIT
-Description-Content-Type: UNKNOWN
 Description: Microsoft Azure CLI 'eventgrid' Command Module
         =======================================================
         
@@ -20,6 +19,33 @@
         
         Release History
         ===============
+        
+        0.1.9
+        +++++
+        * Minor fixes.
+        
+        0.1.8
+        +++++
+        * Minor fixes.
+        
+        0.1.7
+        +++++
+        * BC: Removed the `az eventgrid topic event-subscription` commands. 
The corresponding `az eventgrid event-subscription` commands can now be used to 
manage event subscriptions for topics.
+        * BC: Removed the `az eventgrid resource event-subscription` commands. 
The corresponding `az eventgrid event-subscription` commands can now be used to 
manage event subscriptions for Azure resources.
+        * BC: Removed the `az eventgrid event-subscription show-endpoint-url` 
command. This can now be achieved using `az eventgrid event-subscription show` 
command with the --include-full-endpoint-url parameter.
+        * Added a new command `az eventgrid topic update`.
+        * Added a new command `az eventgrid event-subscription update`.
+        * Added --ids parameter for `az eventgrid topic` commands.
+        * Added tab completion support for topic names.
+        
+        0.1.6
+        +++++
+        * minor fixes
+        
+        0.1.5
+        +++++
+        * minor fixes
+        
         0.1.4 (2017-09-22)
         ++++++++++++++++++
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-eventgrid-0.1.4/azure_cli_eventgrid.egg-info/requires.txt 
new/azure-cli-eventgrid-0.1.9/azure_cli_eventgrid.egg-info/requires.txt
--- old/azure-cli-eventgrid-0.1.4/azure_cli_eventgrid.egg-info/requires.txt     
2017-09-23 01:49:07.000000000 +0200
+++ new/azure-cli-eventgrid-0.1.9/azure_cli_eventgrid.egg-info/requires.txt     
2018-01-26 17:12:43.000000000 +0100
@@ -1,4 +1,3 @@
 azure-cli-core
 six
-azure-mgmt-eventgrid==0.2.0
-azure-cli-command-modules-nspkg>=2.0.0
+azure-mgmt-eventgrid==0.4.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-eventgrid-0.1.4/setup.py 
new/azure-cli-eventgrid-0.1.9/setup.py
--- old/azure-cli-eventgrid-0.1.4/setup.py      2017-09-23 01:49:07.000000000 
+0200
+++ new/azure-cli-eventgrid-0.1.9/setup.py      2018-01-26 17:12:23.000000000 
+0100
@@ -13,7 +13,7 @@
     logger.warn("Wheel is not available, disabling bdist_wheel hook")
     cmdclass = {}
 
-VERSION = "0.1.4"
+VERSION = "0.1.9"
 
 # The full list of classifiers is available at
 # https://pypi.python.org/pypi?%3Aaction=list_classifiers
@@ -33,7 +33,7 @@
 DEPENDENCIES = [
     'azure-cli-core',
     'six',
-    'azure-mgmt-eventgrid==0.2.0',
+    'azure-mgmt-eventgrid==0.4.0',
 ]
 
 with open('README.rst', 'r', encoding='utf-8') as f:


Reply via email to