Hello community,
here is the log from the commit of package azure-cli-eventgrid for
openSUSE:Factory checked in at 2019-10-31 18:16:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/azure-cli-eventgrid (Old)
and /work/SRC/openSUSE:Factory/.azure-cli-eventgrid.new.2990 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "azure-cli-eventgrid"
Thu Oct 31 18:16:04 2019 rev:7 rq:742689 version:0.2.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/azure-cli-eventgrid/azure-cli-eventgrid.changes
2019-06-05 11:43:23.347037624 +0200
+++
/work/SRC/openSUSE:Factory/.azure-cli-eventgrid.new.2990/azure-cli-eventgrid.changes
2019-10-31 18:16:05.906062883 +0100
@@ -1,0 +2,9 @@
+Thu Oct 24 12:10:12 UTC 2019 - John Paul Adrian Glaubitz
<[email protected]>
+
+- New upstream release
+ + Version 0.2.2
+ + For detailed information about changes see the
+ HISTORY.txt file provided with this package
+- Update Requires from setup.py
+
+-------------------------------------------------------------------
Old:
----
azure-cli-eventgrid-0.2.1.tar.gz
New:
----
azure-cli-eventgrid-0.2.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ azure-cli-eventgrid.spec ++++++
--- /var/tmp/diff_new_pack.h0EN3D/_old 2019-10-31 18:16:06.678063682 +0100
+++ /var/tmp/diff_new_pack.h0EN3D/_new 2019-10-31 18:16:06.682063687 +0100
@@ -17,7 +17,7 @@
Name: azure-cli-eventgrid
-Version: 0.2.1
+Version: 0.2.4
Release: 0
Summary: Microsoft Azure CLI 'eventgrid' Command Module
License: MIT
@@ -33,7 +33,7 @@
Requires: azure-cli-command-modules-nspkg
Requires: azure-cli-core
Requires: azure-cli-nspkg
-Requires: python3-azure-mgmt-eventgrid >= 2.0.0
+Requires: python3-azure-mgmt-eventgrid >= 2.2.0
Requires: python3-azure-nspkg >= 3.0.0
Requires: python3-six
Conflicts: azure-cli < 2.0.0
++++++ azure-cli-eventgrid-0.2.1.tar.gz -> azure-cli-eventgrid-0.2.4.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/azure-cli-eventgrid-0.2.1/HISTORY.rst
new/azure-cli-eventgrid-0.2.4/HISTORY.rst
--- old/azure-cli-eventgrid-0.2.1/HISTORY.rst 2019-01-25 20:43:40.000000000
+0100
+++ new/azure-cli-eventgrid-0.2.4/HISTORY.rst 2019-06-13 23:17:46.000000000
+0200
@@ -3,10 +3,27 @@
Release History
===============
+0.2.4
++++++
+* `domain create/update/delete/get/list`: Added new commands for the domain
CRUD operations.
+* `domain topic create/update/delete/get/list`: Added new commands for the
domain topics CRUD operations.
+* `topic list`: Added --odata-query for filtering the results using OData
syntax.
+* `event-subscription list`: Added --odata-query for filtering the results
using OData syntax.
+* `event-subscription create/update`: Added servicebusqueue as new values for
the `--endpoint-type` parameter.
+* `event-subscription create/update`: Disallow usage of All for
--included-event-types.
+
+0.2.3
++++++
+* Minor fixes.
+
+0.2.2
++++++
+* Minor fixes.
+
0.2.1
+++++
* `event-subscription create/update`: Added `--deadletter-endpoint` parameter.
-* 'event-subscription create/update`: Added storagequeue and hybridconnection
as new values for the `--endpoint-type` parameter.
+* `event-subscription create/update`: Added storagequeue and hybridconnection
as new values for the `--endpoint-type` parameter.
* `event-subscription create`: Added `--max-delivery-attempts` and
`--event-ttl` parameters to specify the retry policy for events.
* `event-subscription create/update`: Added a warning message for manual
handshake validation when Webhook as destination is used for an event
subscription.
* Added source-resource-id parameter for all event subscription related
commands and mark all other source resource related parameters as deprecated.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/azure-cli-eventgrid-0.2.1/PKG-INFO
new/azure-cli-eventgrid-0.2.4/PKG-INFO
--- old/azure-cli-eventgrid-0.2.1/PKG-INFO 2019-01-25 20:44:06.000000000
+0100
+++ new/azure-cli-eventgrid-0.2.4/PKG-INFO 2019-06-13 23:18:17.000000000
+0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: azure-cli-eventgrid
-Version: 0.2.1
+Version: 0.2.4
Summary: Microsoft Azure Command-Line Tools EventGrid Command Module
Home-page: https://github.com/Azure/azure-cli
Author: Microsoft Corporation
@@ -20,10 +20,27 @@
Release History
===============
+ 0.2.4
+ +++++
+ * `domain create/update/delete/get/list`: Added new commands for the
domain CRUD operations.
+ * `domain topic create/update/delete/get/list`: Added new commands for
the domain topics CRUD operations.
+ * `topic list`: Added --odata-query for filtering the results using
OData syntax.
+ * `event-subscription list`: Added --odata-query for filtering the
results using OData syntax.
+ * `event-subscription create/update`: Added servicebusqueue as new
values for the `--endpoint-type` parameter.
+ * `event-subscription create/update`: Disallow usage of All for
--included-event-types.
+
+ 0.2.3
+ +++++
+ * Minor fixes.
+
+ 0.2.2
+ +++++
+ * Minor fixes.
+
0.2.1
+++++
* `event-subscription create/update`: Added `--deadletter-endpoint`
parameter.
- * 'event-subscription create/update`: Added storagequeue and
hybridconnection as new values for the `--endpoint-type` parameter.
+ * `event-subscription create/update`: Added storagequeue and
hybridconnection as new values for the `--endpoint-type` parameter.
* `event-subscription create`: Added `--max-delivery-attempts` and
`--event-ttl` parameters to specify the retry policy for events.
* `event-subscription create/update`: Added a warning message for
manual handshake validation when Webhook as destination is used for an event
subscription.
* Added source-resource-id parameter for all event subscription
related commands and mark all other source resource related parameters as
deprecated.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/__init__.py
new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/__init__.py
---
old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/__init__.py
2019-01-25 20:43:40.000000000 +0100
+++
new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/__init__.py
2019-06-13 23:17:46.000000000 +0200
@@ -12,10 +12,11 @@
def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
+ from azure.cli.core.profiles import ResourceType
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')
+
resource_type=ResourceType.MGMT_EVENTGRID)
def load_command_table(self, args):
from azure.cli.command_modules.eventgrid.commands import
load_command_table
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/_client_factory.py
new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/_client_factory.py
---
old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/_client_factory.py
2019-01-25 20:43:40.000000000 +0100
+++
new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/_client_factory.py
2019-06-13 23:17:46.000000000 +0200
@@ -14,6 +14,14 @@
return cf_eventgrid(cli_ctx).topics
+def domains_factory(cli_ctx, _):
+ return cf_eventgrid(cli_ctx).domains
+
+
+def domain_topics_factory(cli_ctx, _):
+ return cf_eventgrid(cli_ctx).domain_topics
+
+
def event_subscriptions_factory(cli_ctx, _):
return cf_eventgrid(cli_ctx).event_subscriptions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/_help.py
new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/_help.py
--- old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/_help.py
2019-01-25 20:43:40.000000000 +0100
+++ new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/_help.py
2019-06-13 23:17:46.000000000 +0200
@@ -1,4 +1,3 @@
-# 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.
@@ -10,7 +9,7 @@
helps['eventgrid'] = """
type: group
- short-summary: Manage Azure Event Grid topics and subscriptions.
+ short-summary: Manage Azure Event Grid topics, event subscriptions,
domains and domain topics.
"""
helps['eventgrid topic'] = """
type: group
@@ -45,6 +44,10 @@
text: az eventgrid topic list
- name: List all topics in a resource group.
text: az eventgrid topic list -g rg1
+ - name: List all topics in a resource group whose name contains the
pattern "XYZ"
+ text: az eventgrid topic list -g rg1 --odata-query "Contains(name,
'XYZ')"
+ - name: List all topics in a resource group except the domain with
name "name1"
+ text: az eventgrid topic list -g rg1 --odata-query "NOT (name eq
'name1')"
"""
helps['eventgrid topic show'] = """
type: command
@@ -67,15 +70,127 @@
type: command
short-summary: Regenerate a shared access key of a topic.
"""
+helps['eventgrid domain'] = """
+ type: group
+ short-summary: Manage event domains.
+ """
+helps['eventgrid domain create'] = """
+ type: command
+ short-summary: Create a domain.
+ examples:
+ - name: Create a new domain.
+ text: az eventgrid domain create -g rg1 --name domain1 -l westus2
+ """
+helps['eventgrid domain update'] = """
+ type: command
+ short-summary: Update a domain.
+ examples:
+ - name: Update the properties of an existing domain.
+ text: az eventgrid domain update -g rg1 --name domain1 --tags Dept=IT
+ """
+helps['eventgrid domain delete'] = """
+ type: command
+ short-summary: Delete a domain.
+ examples:
+ - name: Delete a domain.
+ text: az eventgrid domain delete -g rg1 --name domain1
+ """
+helps['eventgrid domain list'] = """
+ type: command
+ short-summary: List available domains.
+ examples:
+ - name: List all domains in the current Azure subscription.
+ text: az eventgrid domain list
+ - name: List all domains in a resource group.
+ text: az eventgrid domain list -g rg1
+ - name: List all domains in a resource group whose name contains the
pattern "XYZ"
+ text: az eventgrid domain list -g rg1 --odata-query "Contains(name,
'XYZ')"
+ - name: List all domains in a resource group except the domain with
name "name1"
+ text: az eventgrid domain list -g rg1 --odata-query "NOT (name eq
'name1')"
+ """
+helps['eventgrid domain show'] = """
+ type: command
+ short-summary: Get the details of a domain.
+ examples:
+ - name: Show the details of a domain.
+ text: az eventgrid domain show -g rg1 -n domain1
+ - name: Show the details of a domain based on resource ID.
+ text: az eventgrid domain show --ids
/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1
+ """
+helps['eventgrid domain key'] = """
+ type: group
+ short-summary: Manage shared access keys of a domain.
+ """
+helps['eventgrid domain topic'] = """
+ type: group
+ short-summary: Manage event domain topics.
+ """
+helps['eventgrid domain topic create'] = """
+ type: command
+ short-summary: Create a domain topic under a domain.
+ examples:
+ - name: Create a new domain topic under domain.
+ text: az eventgrid domain topic create -g rg1 --domain-name domain1
--name domaintopic1
+ """
+helps['eventgrid domain topic delete'] = """
+ type: command
+ short-summary: Delete a domain topic under a domain.
+ examples:
+ - name: Delete a domain topic.
+ text: az eventgrid domain topic delete -g rg1 --domain-name domain1
--name domaintopic1
+ """
+helps['eventgrid domain key list'] = """
+ type: command
+ short-summary: List shared access keys of a domain.
+ """
+helps['eventgrid domain key regenerate'] = """
+ type: command
+ short-summary: Regenerate a shared access key of a domain.
+ """
+helps['eventgrid domain topic list'] = """
+ type: command
+ short-summary: List available topics in a domain.
+ examples:
+ - name: List all topics in a domain.
+ text: az eventgrid domain topic list -g rg1 --domain-name domain1
+ - name: List all domain topics in a domain whose name contains the
pattern "XYZ"
+ text: az eventgrid domain topic list -g rg1 --domain-name domain1
--odata-query "Contains(name, 'XYZ')"
+ - name: List all domain topics in a domain except the domain topic
with name "name1"
+ text: az eventgrid domain topic list -g rg1 --domain-name domain1
--odata-query "NOT (name eq 'name1')"
+ """
+helps['eventgrid domain topic show'] = """
+ type: command
+ short-summary: Get the details of a domain topic.
+ examples:
+ - name: Show the details of a domain topic.
+ text: az eventgrid domain topic show -g rg1 --domain-name domain1
--name topic1
+ """
helps['eventgrid event-subscription'] = """
type: group
- short-summary: Manage event subscriptions for an Event Grid topic or for
an Azure resource.
- long-summary: Manage event subscriptions for an Event Grid topic, Azure
subscription, resource group or for any other Azure resource that supports
event notifications.
+ short-summary: Manage event subscriptions.
+ long-summary: Manage event subscriptions for an Event Grid topic, domain,
domain topic, Azure subscription, resource group or for any other Azure
resource that supports event notifications.
"""
helps['eventgrid event-subscription create'] = """
type: command
- short-summary: Create a new event subscription for an Event Grid topic or
for an Azure resource.
+ short-summary: Create a new event subscription.
parameters:
+ - name: --advanced-filter
+ short-summary: An advanced filter enables filtering of events based
on a specific event property.
+ long-summary: |
+ Usage: --advanced-filter KEY[.INNERKEY]
FILTEROPERATOR VALUE [VALUE ...]
+ StringIn: --advanced-filter data.Color StringIn
Blue Red Orange Yellow
+ StringNotIn: --advanced-filter data.Color
StringNotIn Blue Red Orange Yellow
+ StringContains: --advanced-filter subject
StringContains Blue Red
+ StringBeginsWith: --advanced-filter subject
StringBeginsWith Blue Red
+ StringEndsWith: --advanced-filter subject
StringEndsWith img png jpg
+ NumberIn: --advanced-filter data.property1
NumberIn 5 10 20
+ NumberNotIn: --advanced-filter data.property2
NumberNotIn 100 200 300
+ NumberLessThan: --advanced-filter data.property3
NumberLessThan 100
+ NumberLessThanOrEquals: --advanced-filter data.property2
NumberLessThanOrEquals 100
+ NumberGreaterThan: --advanced-filter data.property3
NumberGreaterThan 100
+ NumberGreaterThanOrEquals: --advanced-filter data.property2
NumberGreaterThanOrEquals 100
+ BoolEquals: --advanced-filter data.property3
BoolEquals true
+ Multiple advanced filters can be specified by using more than one
`--advanced-filter` argument.
- name: --source-resource-id
short-summary: Fully qualified identifier of the Azure resource to
which the event subscription needs to be created.
long-summary: |
@@ -84,12 +199,15 @@
For resource group: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1
For EventGrid topic: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1
For storage account: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageaccounts/sa1
+ For EventGrid domain: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1
+ For EventGrid domain topic: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1
- name: --deadletter-endpoint
short-summary: The Azure resource ID of an Azure Storage blob
container destination where EventGrid should deadletter undeliverable events
for this event subscription.
long-summary: |
Example: --deadletter-endpoint
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/containerName
- name: --endpoint-type
short-summary: The type of the destination endpoint.
+ long-summary: The type of the destination endpoint. It is expected
that the destination endpoint be created and available for use before executing
any Event Grid command.
examples:
- name: Create a new event subscription for an Event Grid topic, using
default filters.
text: |
@@ -111,6 +229,13 @@
az eventgrid event-subscription create --name es3 \\
--source-resource-id
"/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1"
\\
--endpoint https://contoso.azurewebsites.net/api/f1?code=code
+ - name: Create a new event subscription for a storage account, using
advanced filters.
+ text: |
+ az eventgrid event-subscription create --name es3 \\
+ --source-resource-id
"/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1"
\\
+ --endpoint https://contoso.azurewebsites.net/api/f1?code=code
+ --advanced-filter data.blobType StringIn BlockBlob
+ --advanced-filter data.url StringBeginsWith
https://myaccount.blob.core.windows.net
- name: Create a new event subscription for an Azure subscription,
with a filter specifying a subject prefix.
text: |
az eventgrid event-subscription create --name es4 \\
@@ -135,6 +260,12 @@
--source-resource-id /subscriptions/{SubID} \\
--endpoint-type storagequeue \\
--endpoint
/subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/queueservices/default/queues/q1
+ - name: Create a new event subscription for an Azure subscription,
using default filters, and an Azure ServiceBusQueue as a destination.
+ text: |
+ az eventgrid event-subscription create --name es2 \\
+ --source-resource-id /subscriptions/{SubID} \\
+ --endpoint-type servicebusqueue \\
+ --endpoint
/subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ns1/queues/queue1
- name: Create a new event subscription for a storage account, with a
deadletter destination and custom retry policy of maximum 10 delivery attempts
and an Event TTL of 2 hours (whichever happens earlier).
text: |
az eventgrid event-subscription create --name es2 \\
@@ -142,6 +273,17 @@
--endpoint https://contoso.azurewebsites.net/api/f1?code=code
\\
--deadletter-endpoint
/subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/s2/blobServices/default/containers/blobcontainer1
\\
--max-delivery-attempts 10 --event-ttl 120
+ - name: Create a new event subscription for a domain topic.
+ text: |
+ az eventgrid event-subscription create --name es2 \\
+ --source-resource-id
"/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1/topics/t1"
\\
+ --endpoint https://contoso.azurewebsites.net/api/f1?code=code
+ - name: Create a new event subscription (for a storage account) with
an expiration date.
+ text: |
+ az eventgrid event-subscription create --name es2 \\
+ --source-resource-id
"/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/sa1"
\\
+ --endpoint https://contoso.azurewebsites.net/api/f1?code=code
+ --expiration-date "2018-10-31"
"""
helps['eventgrid event-subscription update'] = """
type: command
@@ -155,6 +297,8 @@
For resource group: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1
For EventGrid topic: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1
For storage account: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageaccounts/sa1
+ For EventGrid domain: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1
+ For EventGrid domain topic: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1
- name: --endpoint-type
short-summary: The type of the destination endpoint.
examples:
@@ -197,11 +341,21 @@
For resource group: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1
For EventGrid topic: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1
For storage account: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageaccounts/sa1
+ For EventGrid domain: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1
+ For EventGrid domain topic: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1
examples:
- name: Delete an event subscription for an Event Grid topic.
text: |
az eventgrid event-subscription delete --name es1 \\
--source-resource-id
/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1
+ - name: Delete an event subscription for an Event Grid domain topic.
+ text: |
+ az eventgrid event-subscription delete --name es1 \\
+ --source-resource-id
/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1/topics/topic1
+ - name: Delete an event subscription for an Event Grid domain.
+ text: |
+ az eventgrid event-subscription delete --name es1 \\
+ --source-resource-id
/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1
- name: Delete an event subscription for an Azure subscription.
text: |
az eventgrid event-subscription delete --name es2 \\
@@ -241,6 +395,8 @@
For resource group: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1
For EventGrid topic: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1
For storage account: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageaccounts/sa1
+ For EventGrid domain: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1
+ For EventGrid domain topic: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1
examples:
- name: List all event subscriptions created for an Event Grid topic.
text: |
@@ -254,6 +410,12 @@
- name: List all event subscriptions created for a resource group.
text: |
az eventgrid event-subscription list --source-resource-id
/subscriptions/{SubID}/resourceGroups/{RG}
+ - name: List all event subscriptions for an Event Grid domain.
+ text: |
+ az eventgrid event-subscription list --source-resource-id
/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1
+ - name: List all event subscriptions for an Event Grid domain topic.
+ text: |
+ az eventgrid event-subscription list --source-resource-id
/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1/topics/topic1
- name: List all Storage event subscriptions (under the currently
selected Azure subscription) in westus2.
text: |
az eventgrid event-subscription list --topic-type
Microsoft.Storage.StorageAccounts --location westus2
@@ -268,6 +430,12 @@
text: |
az eventgrid event-subscription list --location westus2
--resource-group {RG}
az eventgrid event-subscription list --location global
--resource-group {RG}
+ - name: List all event subscriptions for an Event Grid domain whose
name contains the pattern "XYZ"
+ text: |
+ az eventgrid event-subscription list --source-resource-id
/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1
--odata-query "Contains(name, 'XYZ')"
+ - name: List all event subscriptions for an Event Grid domain except
the event subscription with name "name1"
+ text: |
+ az eventgrid event-subscription list --source-resource-id
/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1
--odata-query "NOT (name eq 'name1')"
"""
helps['eventgrid event-subscription show'] = """
type: command
@@ -281,6 +449,8 @@
For resource group: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1
For EventGrid topic: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1
For storage account: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageaccounts/sa1
+ For EventGrid domain: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1
+ For EventGrid domain topic: --source-resource-id
/subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1
examples:
- name: Show the details of an event subscription for an Event Grid
topic.
text: |
@@ -314,4 +484,8 @@
helps['eventgrid topic-type list-event-types'] = """
type: command
short-summary: List the event types supported by a topic type.
+ examples:
+ - name: List all event types supported by Azure Storage Accounts.
+ text: |
+ az eventgrid topic-type list-event-types -n
Microsoft.Storage.StorageAccounts
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/_params.py
new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/_params.py
---
old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/_params.py
2019-01-25 20:43:40.000000000 +0100
+++
new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/_params.py
2019-06-13 23:17:46.000000000 +0200
@@ -17,8 +17,10 @@
name_type
)
+from .advanced_filter import EventSubscriptionAddFilter
+
included_event_types_type = CLIArgumentType(
- help="A space-separated list of event types. Example:
Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted. To subscribe to
all event types, the string \"All\" should be specified.",
+ help="A space-separated list of event types (e.g.,
Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted). To subscribe to
all default event types, do not specify this argument. For event grid topics,
event types are customer defined. For Azure events, e.g., Storage Accounts, IoT
Hub, etc., you can query their event types using this CLI command 'az eventgrid
topic-type list-event-types'.",
nargs='+'
)
@@ -27,15 +29,32 @@
nargs='+'
)
+odata_query_type = CLIArgumentType(
+ help="The OData query used for filtering the list results. Filtering is
currently allowed on the Name property only. The supported operations include:
CONTAINS, eq (for equal), ne (for not equal), AND, OR and NOT.",
+ options_list=['--odata-query']
+)
+
-def load_arguments(self, _):
+domain_name_type = CLIArgumentType(
+ help='Name of the domain.',
+ arg_type=name_type,
+ options_list=['--domain-name'],
+ completer=get_resource_name_completion_list('Microsoft.EventGrid/domains'))
+
+domain_topic_name_type = CLIArgumentType(
+ help='Name of the domain topic.',
+ arg_type=name_type,
+ options_list=['--domain-topic-name'])
+
+
+def load_arguments(self, _): # pylint: disable=too-many-statements
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', 'storagequeue', 'hybridconnection'], default='webhook'))
+ c.argument('endpoint_type', arg_type=get_enum_type(['webhook',
'eventhub', 'storagequeue', 'hybridconnection', 'servicebusqueue'],
default='webhook'))
c.argument('source_resource_id', help="Fully qualified identifier of
the source Azure resource.")
c.argument('resource_id',
deprecate_info=c.deprecate(redirect="--source-resource-id", expiration='2.1.0',
hide=True), 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 other endpoint types, this should be the
Azure resource identifier of the endpoint.")
@@ -44,19 +63,44 @@
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.", )
+ c.argument('odata_query', arg_type=odata_query_type)
+ c.argument('domain_name', arg_type=domain_name_type)
+ c.argument('domain_topic_name', arg_type=domain_topic_name_type)
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'))
+ 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 topic key') as c:
+ c.argument('topic_name', arg_type=name_type, help='Name of the topic',
id_part=None,
completer=get_resource_name_completion_list('Microsoft.EventGrid/topics'))
- with self.argument_context('eventgrid topic key list') as c:
- c.argument('topic_name', id_part=None)
+ with self.argument_context('eventgrid topic list') as c:
+ c.argument('odata_query', arg_type=odata_query_type, id_part=None)
+
+ with self.argument_context('eventgrid domain') as c:
+ c.argument('domain_name', arg_type=domain_name_type,
options_list=['--name', '-n'], id_part='name')
+
+ with self.argument_context('eventgrid domain list') as c:
+ c.argument('odata_query', arg_type=odata_query_type, id_part=None)
+
+ with self.argument_context('eventgrid domain key') as c:
+ c.argument('domain_name', arg_type=domain_name_type,
options_list=['--name', '-n'], id_part=None)
+
+ with self.argument_context('eventgrid domain topic') as c:
+ c.argument('domain_name', arg_type=domain_name_type, id_part='name')
+ c.argument('domain_topic_name', arg_type=domain_topic_name_type,
options_list=['--name', '-n'], id_part='topics')
+
+ with self.argument_context('eventgrid domain topic list') as c:
+ c.argument('domain_name', arg_type=domain_name_type, id_part=None)
+ c.argument('odata_query', arg_type=odata_query_type, id_part=None)
with self.argument_context('eventgrid event-subscription') as c:
- c.argument('topic_name',
deprecate_info=c.deprecate(redirect="--source-resource-id", expiration='2.1.0',
hide=True), help='Name of 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')
+ c.argument('topic_name',
deprecate_info=c.deprecate(redirect="--source-resource-id", expiration='2.1.0',
hide=True), help='Name of 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.')
c.argument('max_delivery_attempts', help="Maximum number of delivery
attempts. Must be a number between 1 and 30.")
c.argument('event_ttl', help="Event time to live (in minutes). Must be
a number between 1 and 1440.")
c.argument('deadletter_endpoint', help="The Azure resource ID of an
Azure Storage blob container destination where EventGrid should deadletter
undeliverable events for this event subscription.")
+ c.argument('advanced_filter', action=EventSubscriptionAddFilter,
nargs='+')
+ c.argument('expiration_date', help="Date or datetime (in UTC, e.g.
'2018-11-30T11:59:59+00:00' or '2018-11-30') after which the event subscription
would expire. By default, there is no expiration for the event subscription.")
with self.argument_context('eventgrid event-subscription create') as c:
c.argument('resource_group_name',
deprecate_info=c.deprecate(redirect="--source-resource-id", expiration='2.1.0',
hide=True), arg_type=resource_group_name_type)
@@ -67,6 +111,9 @@
with self.argument_context('eventgrid event-subscription update') as c:
c.argument('resource_group_name',
deprecate_info=c.deprecate(redirect="--source-resource-id", expiration='2.1.0',
hide=True), arg_type=resource_group_name_type)
+ with self.argument_context('eventgrid event-subscription list') as c:
+ c.argument('odata_query', arg_type=odata_query_type, id_part=None)
+
with self.argument_context('eventgrid event-subscription show') as c:
c.argument('resource_group_name',
deprecate_info=c.deprecate(redirect="--source-resource-id", expiration='2.1.0',
hide=True), arg_type=resource_group_name_type)
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.", )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/advanced_filter.py
new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/advanced_filter.py
---
old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/advanced_filter.py
1970-01-01 01:00:00.000000000 +0100
+++
new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/advanced_filter.py
2019-06-13 23:17:46.000000000 +0200
@@ -0,0 +1,97 @@
+#
--------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
license information.
+#
--------------------------------------------------------------------------------------------
+
+import argparse
+from knack.util import CLIError
+
+from azure.mgmt.eventgrid.models import (
+ NumberGreaterThanAdvancedFilter,
+ NumberGreaterThanOrEqualsAdvancedFilter,
+ NumberInAdvancedFilter,
+ NumberLessThanAdvancedFilter,
+ NumberLessThanOrEqualsAdvancedFilter,
+ NumberNotInAdvancedFilter,
+ StringBeginsWithAdvancedFilter,
+ StringContainsAdvancedFilter,
+ StringEndsWithAdvancedFilter,
+ StringInAdvancedFilter,
+ StringNotInAdvancedFilter,
+ BoolEqualsAdvancedFilter)
+
+NUMBERIN = "NumberIn"
+NUMBERNOTIN = "NumberNotIn"
+STRINGIN = "StringIn"
+STRINGNOTIN = "StringNotIn"
+STRINGBEGINSWITH = "StringBeginsWith"
+STRINGCONTAINS = "StringContains"
+STRINGENDSWITH = "StringEndsWith"
+NUMBERGREATERTHAN = "NumberGreaterThan"
+NUMBERGREATERTHANOREQUALS = "NumberGreaterThanOrEquals"
+NUMBERLESSTHAN = "NumberLessThan"
+NUMBERLESSTHANOREQUALS = "NumberLessThanOrEquals"
+BOOLEQUALS = "BoolEquals"
+
+
+# pylint: disable=protected-access
+# pylint: disable=too-few-public-methods
+class EventSubscriptionAddFilter(argparse._AppendAction):
+ def __call__(self, parser, namespace, values, option_string=None):
+ if len(values) < 3:
+ raise CLIError('usage error: --advanced-filter KEY[.INNERKEY]
FILTEROPERATOR VALUE [VALUE ...]')
+
+ key = values[0]
+ operator = values[1]
+
+# operators that support single value
+ if operator.lower() == NUMBERLESSTHAN.lower():
+ _validate_only_single_value_is_specified(NUMBERLESSTHAN, values)
+ advanced_filter = NumberLessThanAdvancedFilter(key=key,
value=float(values[2]))
+ elif operator.lower() == NUMBERLESSTHANOREQUALS.lower():
+ _validate_only_single_value_is_specified(NUMBERLESSTHANOREQUALS,
values)
+ advanced_filter = NumberLessThanOrEqualsAdvancedFilter(key=key,
value=float(values[2]))
+ elif operator.lower() == NUMBERGREATERTHAN.lower():
+ _validate_only_single_value_is_specified(NUMBERGREATERTHAN, values)
+ advanced_filter = NumberGreaterThanAdvancedFilter(key=key,
value=float(values[2]))
+ elif operator.lower() == NUMBERGREATERTHANOREQUALS.lower():
+
_validate_only_single_value_is_specified(NUMBERGREATERTHANOREQUALS, values)
+ advanced_filter = NumberGreaterThanOrEqualsAdvancedFilter(key=key,
value=float(values[2]))
+ elif operator.lower() == BOOLEQUALS.lower():
+ _validate_only_single_value_is_specified(BOOLEQUALS, values)
+ advanced_filter = BoolEqualsAdvancedFilter(key=key,
value=bool(values[2]))
+
+# operators that support multiple values
+ elif operator.lower() == NUMBERIN.lower():
+ float_values = [float(i) for i in values[2:]]
+ advanced_filter = NumberInAdvancedFilter(key=key,
values=float_values)
+ elif operator.lower() == NUMBERNOTIN.lower():
+ float_values = [float(i) for i in values[2:]]
+ advanced_filter = NumberNotInAdvancedFilter(key=key,
values=float_values)
+ elif operator.lower() == STRINGIN.lower():
+ advanced_filter = StringInAdvancedFilter(key=key,
values=values[2:])
+ elif operator.lower() == STRINGNOTIN.lower():
+ advanced_filter = StringNotInAdvancedFilter(key=key,
values=values[2:])
+ elif operator.lower() == STRINGBEGINSWITH.lower():
+ advanced_filter = StringBeginsWithAdvancedFilter(key=key,
values=values[2:])
+ elif operator.lower() == STRINGENDSWITH.lower():
+ advanced_filter = StringEndsWithAdvancedFilter(key=key,
values=values[2:])
+ elif operator.lower() == STRINGCONTAINS.lower():
+ advanced_filter = StringContainsAdvancedFilter(key=key,
values=values[2:])
+ else:
+ raise CLIError("--advanced-filter: The specified filter operator
'{}' is not"
+ " a valid operator. Supported values are
".format(operator) +
+ NUMBERIN + "," + NUMBERNOTIN + "," + STRINGIN + ","
+
+ STRINGNOTIN + "," + STRINGBEGINSWITH + "," +
+ STRINGCONTAINS + "," + STRINGENDSWITH + "," +
+ NUMBERGREATERTHAN + "," + NUMBERGREATERTHANOREQUALS
+ "," +
+ NUMBERLESSTHAN + "," + NUMBERLESSTHANOREQUALS + ","
+ BOOLEQUALS + ".")
+ if namespace.advanced_filter is None:
+ namespace.advanced_filter = []
+ namespace.advanced_filter.append(advanced_filter)
+
+
+def _validate_only_single_value_is_specified(operator_type, values):
+ if len(values) != 3:
+ raise CLIError("--advanced-filter: For '{}' operator, only one filter
value "
+ "must be specified.".format(operator_type))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/commands.py
new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/commands.py
---
old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/commands.py
2019-01-25 20:43:40.000000000 +0100
+++
new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/commands.py
2019-06-13 23:17:46.000000000 +0200
@@ -6,18 +6,32 @@
# pylint: disable=line-too-long
from azure.cli.core.commands import CliCommandType
-from ._client_factory import (topics_factory, event_subscriptions_factory,
topic_types_factory)
+from ._client_factory import (topics_factory, domains_factory,
domain_topics_factory, event_subscriptions_factory, 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
+ operations_tmpl='azure.mgmt.eventgrid.operations#TopicsOperations.{}',
+ client_factory=topics_factory,
+ client_arg_name='self'
+ )
+
+ domains_mgmt_util = CliCommandType(
+ operations_tmpl='azure.mgmt.eventgrid.operations#DomainsOperations.{}',
+ client_factory=domains_factory,
+ client_arg_name='self'
+ )
+
+ domain_topics_mgmt_util = CliCommandType(
+
operations_tmpl='azure.mgmt.eventgrid.operations#DomainTopicsOperations.{}',
+ client_factory=domain_topics_factory,
+ client_arg_name='self'
)
topic_type_mgmt_util = CliCommandType(
-
operations_tmpl='azure.mgmt.eventgrid.operations.topic_types_operations#TopicTypesOperations.{}',
- client_factory=topic_types_factory
+
operations_tmpl='azure.mgmt.eventgrid.operations#TopicTypesOperations.{}',
+ client_factory=topic_types_factory,
+ client_arg_name='self'
)
with self.command_group('eventgrid topic', topics_mgmt_util,
client_factory=topics_factory) as g:
@@ -32,6 +46,24 @@
setter_name='update',
client_factory=topics_factory)
+ with self.command_group('eventgrid domain topic', domain_topics_mgmt_util,
client_factory=domain_topics_factory) as g:
+ g.show_command('show', 'get')
+ g.custom_command('list', 'cli_domain_topic_list')
+ g.custom_command('delete', 'cli_domain_topic_delete')
+ g.custom_command('create', 'cli_domain_topic_create_or_update')
+
+ with self.command_group('eventgrid domain', domains_mgmt_util,
client_factory=domains_factory) as g:
+ g.show_command('show', 'get')
+ g.command('key list', 'list_shared_access_keys')
+ g.command('key regenerate', 'regenerate_key')
+ g.custom_command('list', 'cli_domain_list')
+ g.custom_command('create', 'cli_domain_create_or_update')
+ g.command('delete', 'delete')
+ g.generic_update_command('update',
+ getter_name='get',
+ setter_name='update',
+ client_factory=domains_factory)
+
custom_tmpl = 'azure.cli.command_modules.eventgrid.custom#{}'
eventgrid_custom = CliCommandType(operations_tmpl=custom_tmpl)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/custom.py
new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/custom.py
--- old/azure-cli-eventgrid-0.2.1/azure/cli/command_modules/eventgrid/custom.py
2019-01-25 20:43:40.000000000 +0100
+++ new/azure-cli-eventgrid-0.2.4/azure/cli/command_modules/eventgrid/custom.py
2019-06-13 23:17:46.000000000 +0200
@@ -4,20 +4,24 @@
#
--------------------------------------------------------------------------------------------
import re
-from six.moves.urllib.parse import quote # pylint: disable=import-error
+from six.moves.urllib.parse import quote # pylint:
disable=import-error,relative-import
from knack.log import get_logger
from knack.util import CLIError
from msrestazure.tools import parse_resource_id
+from dateutil.parser import parse # pylint:
disable=import-error,relative-import
from azure.cli.core.commands.client_factory import get_subscription_id
from azure.mgmt.eventgrid.models import (
EventSubscription,
EventSubscriptionUpdateParameters,
WebHookEventSubscriptionDestination,
+ Topic,
+ Domain,
RetryPolicy,
EventHubEventSubscriptionDestination,
StorageQueueEventSubscriptionDestination,
HybridConnectionEventSubscriptionDestination,
+ ServiceBusQueueEventSubscriptionDestination,
StorageBlobDeadLetterDestination,
EventSubscriptionFilter)
@@ -27,21 +31,35 @@
RESOURCES_NAMESPACE = "Microsoft.Resources"
SUBSCRIPTIONS = "subscriptions"
RESOURCE_GROUPS = "resourcegroups"
+EVENTGRID_DOMAINS = "domains"
EVENTGRID_TOPICS = "topics"
+EVENTGRID_DOMAIN_TOPICS = "domaintopics"
WEBHOOK_DESTINATION = "webhook"
EVENTHUB_DESTINATION = "eventhub"
STORAGEQUEUE_DESTINATION = "storagequeue"
HYBRIDCONNECTION_DESTINATION = "hybridconnection"
+SERVICEBUSQUEUE_DESTINATION = "servicebusqueue"
GLOBAL = "global"
+# Constants for the target field names of the mapping
+TOPIC = "topic"
+SUBJECT = "subject"
+ID = "id"
+EVENTTIME = "eventtime"
+EVENTTYPE = "eventtype"
+DATAVERSION = "dataversion"
+DEFAULT_TOP = 100
+
def cli_topic_list(
client,
- resource_group_name=None):
+ resource_group_name=None,
+ odata_query=None):
+
if resource_group_name:
- return client.list_by_resource_group(resource_group_name)
+ return client.list_by_resource_group(resource_group_name, odata_query,
DEFAULT_TOP)
- return client.list_by_subscription()
+ return client.list_by_subscription(odata_query, DEFAULT_TOP)
def cli_topic_create_or_update(
@@ -50,15 +68,70 @@
topic_name,
location,
tags=None):
- async_topic_create = client.create_or_update(
+ topic_info = Topic(
+ location=location,
+ tags=tags)
+ return client.create_or_update(
resource_group_name,
topic_name,
+ topic_info)
+
+
+def cli_domain_list(
+ client,
+ resource_group_name=None,
+ odata_query=None):
+
+ if resource_group_name:
+ return client.list_by_resource_group(resource_group_name, odata_query,
DEFAULT_TOP)
+
+ return client.list_by_subscription(odata_query, DEFAULT_TOP)
+
+
+def cli_domain_create_or_update(
+ client,
+ resource_group_name,
+ domain_name,
location,
- tags)
+ tags=None):
+ domain_info = Domain(
+ location=location,
+ tags=tags)
+
+ return client.create_or_update(
+ resource_group_name,
+ domain_name,
+ domain_info)
+
+
+def cli_domain_topic_create_or_update(
+ client,
+ resource_group_name,
+ domain_name,
+ domain_topic_name):
+ return client.create_or_update(
+ resource_group_name,
+ domain_name,
+ domain_topic_name)
- created_topic = async_topic_create.result()
- return created_topic
+def cli_domain_topic_delete(
+ client,
+ resource_group_name,
+ domain_name,
+ domain_topic_name):
+ return client.delete(
+ resource_group_name,
+ domain_name,
+ domain_topic_name)
+
+
+def cli_domain_topic_list(
+ client,
+ resource_group_name,
+ domain_name,
+ odata_query=None):
+ return client.list_by_domain(resource_group_name, domain_name,
odata_query, DEFAULT_TOP)
def cli_eventgrid_event_subscription_create( # pylint:
disable=too-many-locals
@@ -78,7 +151,18 @@
max_delivery_attempts=30,
event_ttl=1440,
deadletter_endpoint=None,
- labels=None):
+ labels=None,
+ expiration_date=None,
+ advanced_filter=None):
+
+ if included_event_types is not None and len(included_event_types) == 1 and
included_event_types[0].lower() == 'all':
+ logger.warning('The usage of \"All\" for --included-event-types is not
allowed starting from Azure Event Grid'
+ ' API Version 2019-02-01-preview. However, the call
here is still permitted by replacing'
+ ' \"All\" with None in order to return all the event
types (for the custom topics and'
+ ' domains case) or default event types (for other topic
types case). In any future calls,'
+ ' please consider leaving --included-event-types
unspecified or use None instead.')
+ included_event_types = None
+
scope = _get_scope_for_event_subscription(
cli_ctx=cmd.cli_ctx,
source_resource_id=source_resource_id,
@@ -98,17 +182,22 @@
subject_begins_with=subject_begins_with,
subject_ends_with=subject_ends_with,
included_event_types=included_event_types,
- is_subject_case_sensitive=is_subject_case_sensitive)
+ is_subject_case_sensitive=is_subject_case_sensitive,
+ advanced_filters=advanced_filter)
deadletter_destination = None
if deadletter_endpoint is not None:
deadletter_destination =
_get_deadletter_destination(deadletter_endpoint)
+ if expiration_date is not None:
+ expiration_date = parse(expiration_date)
+
event_subscription_info = EventSubscription(
destination=destination,
filter=event_subscription_filter,
labels=labels,
retry_policy=retry_policy,
+ expiration_time_utc=expiration_date,
dead_letter_destination=deadletter_destination)
_warn_if_manual_handshake_needed(endpoint_type, endpoint)
@@ -116,7 +205,7 @@
return client.create_or_update(
scope,
event_subscription_name,
- event_subscription_info).result()
+ event_subscription_info)
def cli_eventgrid_event_subscription_delete(
@@ -133,10 +222,9 @@
resource_id=resource_id,
topic_name=topic_name,
resource_group_name=resource_group_name)
- async_event_subscription_delete = client.delete(
+ return client.delete(
scope,
event_subscription_name)
- return async_event_subscription_delete.result()
def event_subscription_setter(
@@ -154,13 +242,10 @@
resource_id=resource_id,
topic_name=topic_name,
resource_group_name=resource_group_name)
-
- async_event_subscription_update = client.update(
+ return client.update(
scope,
event_subscription_name,
parameters)
- updated_event_subscription = async_event_subscription_update.result()
- return updated_event_subscription
def cli_eventgrid_event_subscription_get(
@@ -195,7 +280,8 @@
topic_name=None,
resource_group_name=None,
location=None,
- topic_type_name=None):
+ topic_type_name=None,
+ odata_query=None):
if source_resource_id is not None:
# If Source Resource ID is specified, we need to list event
subscriptions for that particular resource.
# Since a full resource ID is specified, it should override all other
defaults such as default location and RG
@@ -204,7 +290,7 @@
raise CLIError('usage error: Since --source-resource-id is
specified, none of the other parameters must '
'be specified.')
- return _list_event_subscriptions_by_resource_id(client,
source_resource_id)
+ return _list_event_subscriptions_by_resource_id(client,
source_resource_id, odata_query, DEFAULT_TOP)
if resource_id is not None:
# DEPRECATED
@@ -215,7 +301,7 @@
raise CLIError('usage error: Since --resource-id is specified,
none of the other parameters must '
'be specified.')
- return _list_event_subscriptions_by_resource_id(client, resource_id)
+ return _list_event_subscriptions_by_resource_id(client, resource_id,
odata_query, DEFAULT_TOP)
if topic_name:
# DEPRECATED
@@ -226,10 +312,13 @@
resource_group_name,
EVENTGRID_NAMESPACE,
EVENTGRID_TOPICS,
- topic_name)
+ topic_name,
+ odata_query,
+ DEFAULT_TOP)
if location is None:
- # Since resource-id was not specified, location must be specified:
e.g. "westus2" or "global". If not error OUT.
+ # Since resource-id was not specified, location must be specified:
e.g. "westus2" or "global". If not error
+ # OUT.
raise CLIError('usage error: --source-resource-id ID | --location
LOCATION'
' [--resource-group RG] [--topic-type-name
TOPIC_TYPE_NAME]')
@@ -237,12 +326,12 @@
# No topic-type is specified: return event subscriptions across all
topic types for this location.
if location.lower() == GLOBAL.lower():
if resource_group_name:
- return
client.list_global_by_resource_group(resource_group_name)
- return client.list_global_by_subscription()
+ return
client.list_global_by_resource_group(resource_group_name, odata_query,
DEFAULT_TOP)
+ return client.list_global_by_subscription(odata_query, DEFAULT_TOP)
if resource_group_name:
- return client.list_regional_by_resource_group(resource_group_name,
location)
- return client.list_regional_by_subscription(location)
+ return client.list_regional_by_resource_group(resource_group_name,
location, odata_query, DEFAULT_TOP)
+ return client.list_regional_by_subscription(location, odata_query,
DEFAULT_TOP)
# Topic type name is specified
if location.lower() == GLOBAL.lower():
@@ -253,12 +342,25 @@
'as westus. Global can be used only for global
topic types: '
'Microsoft.Resources.Subscriptions and
Microsoft.Resources.ResourceGroups.')
if resource_group_name:
- return
client.list_global_by_resource_group_for_topic_type(resource_group_name,
topic_type_name)
- return
client.list_global_by_subscription_for_topic_type(topic_type_name)
+ return client.list_global_by_resource_group_for_topic_type(
+ resource_group_name,
+ topic_type_name,
+ odata_query,
+ DEFAULT_TOP)
+ return
client.list_global_by_subscription_for_topic_type(topic_type_name, odata_query,
DEFAULT_TOP)
if resource_group_name:
- return
client.list_regional_by_resource_group_for_topic_type(resource_group_name,
location, topic_type_name)
- return client.list_regional_by_subscription_for_topic_type(location,
topic_type_name)
+ return client.list_regional_by_resource_group_for_topic_type(
+ resource_group_name,
+ location,
+ topic_type_name,
+ odata_query,
+ DEFAULT_TOP)
+ return client.list_regional_by_subscription_for_topic_type(
+ location,
+ topic_type_name,
+ odata_query,
+ DEFAULT_TOP)
def _get_scope(
@@ -409,6 +511,8 @@
destination =
HybridConnectionEventSubscriptionDestination(resource_id=endpoint)
elif endpoint_type.lower() == STORAGEQUEUE_DESTINATION.lower():
destination = _get_storage_queue_destination(endpoint)
+ elif endpoint_type.lower() == SERVICEBUSQUEUE_DESTINATION.lower():
+ destination =
ServiceBusQueueEventSubscriptionDestination(resource_id=endpoint)
return destination
@@ -426,7 +530,10 @@
'/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' +
'storageAccounts/sa1/queueServices/default/queues/queueName')
- return
StorageQueueEventSubscriptionDestination(resource_id=queue_items[0],
queue_name=queue_items[1])
+ destination = StorageQueueEventSubscriptionDestination(
+ resource_id=queue_items[0], queue_name=queue_items[1])
+
+ return destination
def _get_deadletter_destination(deadletter_endpoint):
@@ -466,7 +573,7 @@
'please visit http://aka.ms/esvalidation')
-def _list_event_subscriptions_by_resource_id(client, resource_id):
+def _list_event_subscriptions_by_resource_id(client, resource_id, oDataQuery,
top):
# parse_resource_id doesn't handle resource_ids for Azure subscriptions
and RGs
# so, first try to look for those two patterns.
if resource_id is not None:
@@ -483,7 +590,10 @@
provided_subscription_id=subscription_id)
if len(id_parts) == 2:
- return
client.list_global_by_subscription_for_topic_type("Microsoft.Resources.Subscriptions")
+ return client.list_global_by_subscription_for_topic_type(
+ "Microsoft.Resources.Subscriptions",
+ oDataQuery,
+ top)
if len(id_parts) == 4 and id_parts[2].lower() == "resourcegroups":
resource_group_name = id_parts[3]
@@ -493,7 +603,9 @@
' resource group must be provided.')
return client.list_global_by_resource_group_for_topic_type(
resource_group_name,
- "Microsoft.Resources.ResourceGroups")
+ "Microsoft.Resources.ResourceGroups",
+ oDataQuery,
+ top)
id_parts = parse_resource_id(resource_id)
subscription_id = id_parts.get('subscription')
@@ -511,12 +623,23 @@
raise CLIError('The specified value for resource-id is not'
' in the expected format.')
- # Invoke the standard list_by_resource
+ # If this is for a domain topic, invoke the appropriate operation
+ if (namespace.lower() == EVENTGRID_NAMESPACE.lower() and
resource_type.lower() == EVENTGRID_DOMAINS.lower()):
+ child_resource_type = id_parts.get('child_type_1')
+ child_resource_name = id_parts.get('child_name_1')
+
+ if (child_resource_type is not None and child_resource_type.lower() ==
EVENTGRID_TOPICS.lower() and
+ child_resource_name is not None):
+ return client.list_by_domain_topic(rg_name, resource_name,
child_resource_name, oDataQuery, top)
+
+ # Not a domain topic, invoke the standard list_by_resource
return client.list_by_resource(
rg_name,
namespace,
resource_type,
- resource_name)
+ resource_name,
+ oDataQuery,
+ top)
def _is_topic_type_global_resource(topic_type_name):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-eventgrid-0.2.1/azure_cli_eventgrid.egg-info/PKG-INFO
new/azure-cli-eventgrid-0.2.4/azure_cli_eventgrid.egg-info/PKG-INFO
--- old/azure-cli-eventgrid-0.2.1/azure_cli_eventgrid.egg-info/PKG-INFO
2019-01-25 20:44:06.000000000 +0100
+++ new/azure-cli-eventgrid-0.2.4/azure_cli_eventgrid.egg-info/PKG-INFO
2019-06-13 23:18:17.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: azure-cli-eventgrid
-Version: 0.2.1
+Version: 0.2.4
Summary: Microsoft Azure Command-Line Tools EventGrid Command Module
Home-page: https://github.com/Azure/azure-cli
Author: Microsoft Corporation
@@ -20,10 +20,27 @@
Release History
===============
+ 0.2.4
+ +++++
+ * `domain create/update/delete/get/list`: Added new commands for the
domain CRUD operations.
+ * `domain topic create/update/delete/get/list`: Added new commands for
the domain topics CRUD operations.
+ * `topic list`: Added --odata-query for filtering the results using
OData syntax.
+ * `event-subscription list`: Added --odata-query for filtering the
results using OData syntax.
+ * `event-subscription create/update`: Added servicebusqueue as new
values for the `--endpoint-type` parameter.
+ * `event-subscription create/update`: Disallow usage of All for
--included-event-types.
+
+ 0.2.3
+ +++++
+ * Minor fixes.
+
+ 0.2.2
+ +++++
+ * Minor fixes.
+
0.2.1
+++++
* `event-subscription create/update`: Added `--deadletter-endpoint`
parameter.
- * 'event-subscription create/update`: Added storagequeue and
hybridconnection as new values for the `--endpoint-type` parameter.
+ * `event-subscription create/update`: Added storagequeue and
hybridconnection as new values for the `--endpoint-type` parameter.
* `event-subscription create`: Added `--max-delivery-attempts` and
`--event-ttl` parameters to specify the retry policy for events.
* `event-subscription create/update`: Added a warning message for
manual handshake validation when Webhook as destination is used for an event
subscription.
* Added source-resource-id parameter for all event subscription
related commands and mark all other source resource related parameters as
deprecated.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-eventgrid-0.2.1/azure_cli_eventgrid.egg-info/SOURCES.txt
new/azure-cli-eventgrid-0.2.4/azure_cli_eventgrid.egg-info/SOURCES.txt
--- old/azure-cli-eventgrid-0.2.1/azure_cli_eventgrid.egg-info/SOURCES.txt
2019-01-25 20:44:06.000000000 +0100
+++ new/azure-cli-eventgrid-0.2.4/azure_cli_eventgrid.egg-info/SOURCES.txt
2019-06-13 23:18:17.000000000 +0200
@@ -10,6 +10,7 @@
azure/cli/command_modules/eventgrid/_client_factory.py
azure/cli/command_modules/eventgrid/_help.py
azure/cli/command_modules/eventgrid/_params.py
+azure/cli/command_modules/eventgrid/advanced_filter.py
azure/cli/command_modules/eventgrid/commands.py
azure/cli/command_modules/eventgrid/custom.py
azure_cli_eventgrid.egg-info/PKG-INFO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-eventgrid-0.2.1/azure_cli_eventgrid.egg-info/requires.txt
new/azure-cli-eventgrid-0.2.4/azure_cli_eventgrid.egg-info/requires.txt
--- old/azure-cli-eventgrid-0.2.1/azure_cli_eventgrid.egg-info/requires.txt
2019-01-25 20:44:06.000000000 +0100
+++ new/azure-cli-eventgrid-0.2.4/azure_cli_eventgrid.egg-info/requires.txt
2019-06-13 23:18:17.000000000 +0200
@@ -1,3 +1,3 @@
azure-cli-core
six
-azure-mgmt-eventgrid==2.0.0
+azure-mgmt-eventgrid==2.2.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/azure-cli-eventgrid-0.2.1/setup.py
new/azure-cli-eventgrid-0.2.4/setup.py
--- old/azure-cli-eventgrid-0.2.1/setup.py 2019-01-25 20:43:40.000000000
+0100
+++ new/azure-cli-eventgrid-0.2.4/setup.py 2019-06-13 23:17:46.000000000
+0200
@@ -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
@@ -33,7 +33,7 @@
DEPENDENCIES = [
'azure-cli-core',
'six',
- 'azure-mgmt-eventgrid==2.0.0',
+ 'azure-mgmt-eventgrid==2.2.0',
]
with open('README.rst', 'r', encoding='utf-8') as f: