From b09ba7c855be67f4379bbbb4144784f8b3d60ab4 Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Thu, 19 Apr 2018 10:22:30 -0700 Subject: [PATCH 01/14] Initial commit based on current azure-cli-eventgrid version. --- src/eventgrid/azext_eventgrid/__init__.py | 30 + .../azext_eventgrid/_client_factory.py | 22 + src/eventgrid/azext_eventgrid/_help.py | 206 +++ src/eventgrid/azext_eventgrid/_params.py | 68 + .../azext_eventgrid/azext_metadata.json | 4 + src/eventgrid/azext_eventgrid/commands.py | 53 + src/eventgrid/azext_eventgrid/custom.py | 290 ++++ .../azext_eventgrid/mgmt/__init__.py | 1 + .../mgmt/eventgrid/__init__.py | 18 + .../eventgrid/event_grid_management_client.py | 100 ++ .../mgmt/eventgrid/models/__init__.py | 68 + .../event_grid_management_client_enums.py | 48 + ...vent_hub_event_subscription_destination.py | 37 + .../eventgrid/models/event_subscription.py | 69 + .../models/event_subscription_destination.py | 40 + .../models/event_subscription_filter.py | 50 + .../models/event_subscription_full_url.py | 29 + .../models/event_subscription_paged.py | 27 + .../event_subscription_update_parameters.py | 38 + .../mgmt/eventgrid/models/event_type.py | 54 + .../mgmt/eventgrid/models/event_type_paged.py | 27 + .../mgmt/eventgrid/models/operation.py | 40 + .../mgmt/eventgrid/models/operation_info.py | 40 + .../mgmt/eventgrid/models/operation_paged.py | 27 + .../mgmt/eventgrid/models/resource.py | 45 + .../mgmt/eventgrid/models/topic.py | 62 + .../mgmt/eventgrid/models/topic_paged.py | 27 + .../models/topic_regenerate_key_request.py | 32 + .../models/topic_shared_access_keys.py | 32 + .../mgmt/eventgrid/models/topic_type_info.py | 72 + .../eventgrid/models/topic_type_info_paged.py | 27 + .../models/topic_update_parameters.py | 28 + .../mgmt/eventgrid/models/tracked_resource.py | 51 + ...web_hook_event_subscription_destination.py | 46 + .../mgmt/eventgrid/operations/__init__.py | 22 + .../event_subscriptions_operations.py | 1215 +++++++++++++++++ .../mgmt/eventgrid/operations/operations.py | 101 ++ .../operations/topic_types_operations.py | 227 +++ .../eventgrid/operations/topics_operations.py | 803 +++++++++++ .../azext_eventgrid/mgmt/eventgrid/version.py | 13 + .../azext_eventgrid/tests/__init__.py | 4 + .../azext_eventgrid/tests/latest/__init__.py | 4 + ...t_subscriptions_to_arm_resource_group.yaml | 417 ++++++ ...reate_event_subscriptions_to_resource.yaml | 656 +++++++++ ...eate_event_subscriptions_with_filters.yaml | 359 +++++ .../latest/recordings/test_create_topic.yaml | 872 ++++++++++++ .../latest/recordings/test_topic_types.yaml | 100 ++ .../tests/latest/test_eventgrid_commands.py | 225 +++ src/eventgrid/setup.cfg | 2 + src/eventgrid/setup.py | 41 + 50 files changed, 6869 insertions(+) create mode 100644 src/eventgrid/azext_eventgrid/__init__.py create mode 100644 src/eventgrid/azext_eventgrid/_client_factory.py create mode 100644 src/eventgrid/azext_eventgrid/_help.py create mode 100644 src/eventgrid/azext_eventgrid/_params.py create mode 100644 src/eventgrid/azext_eventgrid/azext_metadata.json create mode 100644 src/eventgrid/azext_eventgrid/commands.py create mode 100644 src/eventgrid/azext_eventgrid/custom.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/__init__.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/__init__.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/event_grid_management_client.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/__init__.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_grid_management_client_enums.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_hub_event_subscription_destination.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_destination.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_filter.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_full_url.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_paged.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_update_parameters.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_type.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_type_paged.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation_info.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation_paged.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/resource.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_paged.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_regenerate_key_request.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_shared_access_keys.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info_paged.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_update_parameters.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/tracked_resource.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/web_hook_event_subscription_destination.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/__init__.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/event_subscriptions_operations.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/operations.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topic_types_operations.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topics_operations.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py create mode 100644 src/eventgrid/azext_eventgrid/tests/__init__.py create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/__init__.py create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_resource.yaml create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/recordings/test_topic_types.yaml create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py create mode 100644 src/eventgrid/setup.cfg create mode 100644 src/eventgrid/setup.py diff --git a/src/eventgrid/azext_eventgrid/__init__.py b/src/eventgrid/azext_eventgrid/__init__.py new file mode 100644 index 00000000000..930cefe1d64 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/__init__.py @@ -0,0 +1,30 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader + +import azext_eventgrid._help # pylint: disable=unused-import + + +class EventGridCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + eventgrid_custom = CliCommandType(operations_tmpl='azext_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 .commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from ._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = EventGridCommandsLoader diff --git a/src/eventgrid/azext_eventgrid/_client_factory.py b/src/eventgrid/azext_eventgrid/_client_factory.py new file mode 100644 index 00000000000..e31cdaf6971 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/_client_factory.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def cf_eventgrid(cli_ctx, **_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_eventgrid.mgmt.eventgrid import EventGridManagementClient + return get_mgmt_service_client(cli_ctx, EventGridManagementClient) + + +def topics_factory(cli_ctx, _): + return cf_eventgrid(cli_ctx).topics + + +def event_subscriptions_factory(cli_ctx, _): + return cf_eventgrid(cli_ctx).event_subscriptions + + +def topic_types_factory(cli_ctx, _): + return cf_eventgrid(cli_ctx).topic_types diff --git a/src/eventgrid/azext_eventgrid/_help.py b/src/eventgrid/azext_eventgrid/_help.py new file mode 100644 index 00000000000..dba37bb38ec --- /dev/null +++ b/src/eventgrid/azext_eventgrid/_help.py @@ -0,0 +1,206 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long + +from knack.help_files import helps # pylint: disable=unused-import + + +helps['eventgrid'] = """ + type: group + short-summary: Manage Azure Event Grid topics and subscriptions. + """ +helps['eventgrid topic'] = """ + type: group + short-summary: Manage Azure Event Grid topics. + """ +helps['eventgrid topic create'] = """ + type: command + short-summary: Create a topic. + examples: + - name: Create a new topic. + 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 + short-summary: Manage shared access keys of a topic. + """ +helps['eventgrid topic key list'] = """ + type: command + short-summary: List shared access keys of a topic. + """ +helps['eventgrid topic key regenerate'] = """ + type: command + short-summary: Regenerate a shared access key of a topic. + """ +helps['eventgrid event-subscription'] = """ + type: group + 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 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 \\ + --endpoint https://contoso.azurewebsites.net/api/f1?code=code + - name: Create a new event subscription for a resource group, using default filters. + 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 \\ + --endpoint https://contoso.azurewebsites.net/api/f1?code=code \\ + --subject-begins-with mysubject_prefix + - name: Create a new event subscription for a resource group, with a filter specifying a subject suffix. + text: | + az eventgrid event-subscription create -g rg2 --name es5 \\ + --endpoint https://contoso.azurewebsites.net/api/f1?code=code \\ + --subject-ends-with mysubject_suffix + - name: Create a new event subscription for a subscription, using default filters, and an EventHub as a destination. + text: | + 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. + examples: + - name: Show the details of an event subscription for an Event Grid topic. + text: | + 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 + short-summary: Get details for topic types. + """ +helps['eventgrid topic-type list'] = """ + type: command + short-summary: List registered topic types. + """ +helps['eventgrid topic-type show'] = """ + type: command + short-summary: Get the details for a topic type. + """ +helps['eventgrid topic-type list-event-types'] = """ + type: command + short-summary: List the event types supported by a topic type. + """ diff --git a/src/eventgrid/azext_eventgrid/_params.py b/src/eventgrid/azext_eventgrid/_params.py new file mode 100644 index 00000000000..e77608e5f28 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/_params.py @@ -0,0 +1,68 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long + +from knack.arguments import CLIArgumentType + +from azure.cli.core.commands.parameters import ( + resource_group_name_type, + get_resource_name_completion_list, + get_three_state_flag, + get_location_type, + get_enum_type, + tags_type, + name_type +) + +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( + help="A space-separated list of labels to associate with this event subscription.", + nargs='+' +) + + +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 --git a/src/eventgrid/azext_eventgrid/azext_metadata.json b/src/eventgrid/azext_eventgrid/azext_metadata.json new file mode 100644 index 00000000000..0805b25d581 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.minCliCoreVersion": "2.0.24", + "azext.isPreview": true +} \ No newline at end of file diff --git a/src/eventgrid/azext_eventgrid/commands.py b/src/eventgrid/azext_eventgrid/commands.py new file mode 100644 index 00000000000..eea0dc336df --- /dev/null +++ b/src/eventgrid/azext_eventgrid/commands.py @@ -0,0 +1,53 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long + +from azure.cli.core.commands import CliCommandType +from ._client_factory import (topics_factory, event_subscriptions_factory, topic_types_factory) + + +def load_command_table(self, _): + topics_mgmt_util = CliCommandType( + operations_tmpl='azext_eventgrid.mgmt.eventgrid.operations.topics_operations#TopicsOperations.{}', + client_factory=topics_factory + ) + + topic_type_mgmt_util = CliCommandType( + operations_tmpl='azext_eventgrid.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 = 'azext_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 --git a/src/eventgrid/azext_eventgrid/custom.py b/src/eventgrid/azext_eventgrid/custom.py new file mode 100644 index 00000000000..4b53931eebc --- /dev/null +++ b/src/eventgrid/azext_eventgrid/custom.py @@ -0,0 +1,290 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +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 azext_eventgrid.mgmt.eventgrid.models import ( + EventSubscription, + EventSubscriptionUpdateParameters, + WebHookEventSubscriptionDestination, + EventHubEventSubscriptionDestination, + EventSubscriptionFilter) + +logger = get_logger(__name__) + +EVENTGRID_NAMESPACE = "Microsoft.EventGrid" +RESOURCES_NAMESPACE = "Microsoft.Resources" +SUBSCRIPTIONS = "subscriptions" +RESOURCE_GROUPS = "resourcegroups" +EVENTGRID_TOPICS = "topics" +WEBHOOK_DESTINATION = "webhook" +EVENTHUB_DESTINATION = "eventhub" + + +def cli_topic_list( + client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name) + + return client.list_by_subscription() + + +def cli_eventgrid_event_subscription_create( + cmd, + client, + event_subscription_name, + endpoint, + 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): + 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) + + 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_or_update( + scope, + event_subscription_name, + event_subscription_info) + created_event_subscription = async_event_subscription_create.result() + return created_event_subscription + + +def event_subscription_setter( + cmd, + client, + parameters, + 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) + + async_event_subscription_update = 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( + cmd, + client, + event_subscription_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 retrieved_event_subscription + + +def cli_eventgrid_event_subscription_delete( + 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) + return 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: + 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) + + 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) + + if location: + if resource_group_name: + return client.list_regional_by_resource_group( + resource_group_name, + location) + + return client.list_regional_by_subscription(location) + + if resource_group_name: + return client.list_global_by_resource_group(resource_group_name) + + return client.list_global_by_subscription() + + +def _get_scope( + cli_ctx, + resource_group_name, + provider_namespace, + resource_type, + resource_name): + subscription_id = get_subscription_id(cli_ctx) + + if provider_namespace == RESOURCES_NAMESPACE: + if resource_group_name: + scope = ( + '/subscriptions/{}/resourceGroups/{}' + .format(quote(subscription_id), + quote(resource_group_name))) + else: + scope = ( + '/subscriptions/{}' + .format(quote(subscription_id))) + else: + scope = ( + '/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}' + .format(quote(subscription_id), + quote(resource_group_name), + quote(provider_namespace), + quote(resource_type), + quote(resource_name))) + + return scope + + +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: + 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 params diff --git a/src/eventgrid/azext_eventgrid/mgmt/__init__.py b/src/eventgrid/azext_eventgrid/mgmt/__init__.py new file mode 100644 index 00000000000..de40ea7ca05 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/__init__.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/__init__.py new file mode 100644 index 00000000000..4cb1d289dde --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/__init__.py @@ -0,0 +1,18 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .event_grid_management_client import EventGridManagementClient +from .version import VERSION + +__all__ = ['EventGridManagementClient'] + +__version__ = VERSION + diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/event_grid_management_client.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/event_grid_management_client.py new file mode 100644 index 00000000000..93140dd19ff --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/event_grid_management_client.py @@ -0,0 +1,100 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import ServiceClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.event_subscriptions_operations import EventSubscriptionsOperations +from .operations.operations import Operations +from .operations.topics_operations import TopicsOperations +from .operations.topic_types_operations import TopicTypesOperations +from . import models + + +class EventGridManagementClientConfiguration(AzureConfiguration): + """Configuration for EventGridManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials that uniquely identify a + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(EventGridManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-eventgrid/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class EventGridManagementClient(object): + """Azure EventGrid Management Client + + :ivar config: Configuration for client. + :vartype config: EventGridManagementClientConfiguration + + :ivar event_subscriptions: EventSubscriptions operations + :vartype event_subscriptions: azure.mgmt.eventgrid.operations.EventSubscriptionsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.eventgrid.operations.Operations + :ivar topics: Topics operations + :vartype topics: azure.mgmt.eventgrid.operations.TopicsOperations + :ivar topic_types: TopicTypes operations + :vartype topic_types: azure.mgmt.eventgrid.operations.TopicTypesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials that uniquely identify a + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = EventGridManagementClientConfiguration(credentials, subscription_id, base_url) + self._client = ServiceClient(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-01-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.event_subscriptions = EventSubscriptionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.topics = TopicsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.topic_types = TopicTypesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/__init__.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/__init__.py new file mode 100644 index 00000000000..5e5bd7c5520 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/__init__.py @@ -0,0 +1,68 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .event_subscription_destination import EventSubscriptionDestination +from .event_subscription_filter import EventSubscriptionFilter +from .resource import Resource +from .web_hook_event_subscription_destination import WebHookEventSubscriptionDestination +from .event_hub_event_subscription_destination import EventHubEventSubscriptionDestination +from .event_subscription import EventSubscription +from .event_subscription_update_parameters import EventSubscriptionUpdateParameters +from .event_subscription_full_url import EventSubscriptionFullUrl +from .operation_info import OperationInfo +from .operation import Operation +from .tracked_resource import TrackedResource +from .topic import Topic +from .topic_update_parameters import TopicUpdateParameters +from .topic_shared_access_keys import TopicSharedAccessKeys +from .topic_regenerate_key_request import TopicRegenerateKeyRequest +from .event_type import EventType +from .topic_type_info import TopicTypeInfo +from .event_subscription_paged import EventSubscriptionPaged +from .operation_paged import OperationPaged +from .topic_paged import TopicPaged +from .event_type_paged import EventTypePaged +from .topic_type_info_paged import TopicTypeInfoPaged +from .event_grid_management_client_enums import ( + EventSubscriptionProvisioningState, + TopicProvisioningState, + ResourceRegionType, + TopicTypeProvisioningState, +) + +__all__ = [ + 'EventSubscriptionDestination', + 'EventSubscriptionFilter', + 'Resource', + 'WebHookEventSubscriptionDestination', + 'EventHubEventSubscriptionDestination', + 'EventSubscription', + 'EventSubscriptionUpdateParameters', + 'EventSubscriptionFullUrl', + 'OperationInfo', + 'Operation', + 'TrackedResource', + 'Topic', + 'TopicUpdateParameters', + 'TopicSharedAccessKeys', + 'TopicRegenerateKeyRequest', + 'EventType', + 'TopicTypeInfo', + 'EventSubscriptionPaged', + 'OperationPaged', + 'TopicPaged', + 'EventTypePaged', + 'TopicTypeInfoPaged', + 'EventSubscriptionProvisioningState', + 'TopicProvisioningState', + 'ResourceRegionType', + 'TopicTypeProvisioningState', +] diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_grid_management_client_enums.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_grid_management_client_enums.py new file mode 100644 index 00000000000..63459ea3a5b --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_grid_management_client_enums.py @@ -0,0 +1,48 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class EventSubscriptionProvisioningState(Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + canceled = "Canceled" + failed = "Failed" + + +class TopicProvisioningState(Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + canceled = "Canceled" + failed = "Failed" + + +class ResourceRegionType(Enum): + + regional_resource = "RegionalResource" + global_resource = "GlobalResource" + + +class TopicTypeProvisioningState(Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + canceled = "Canceled" + failed = "Failed" diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_hub_event_subscription_destination.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_hub_event_subscription_destination.py new file mode 100644 index 00000000000..c8d1c03e447 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_hub_event_subscription_destination.py @@ -0,0 +1,37 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .event_subscription_destination import EventSubscriptionDestination + + +class EventHubEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the event hub destination for an event subscription. + + :param endpoint_type: Constant filled by server. + :type endpoint_type: str + :param resource_id: The Azure Resource Id that represents the endpoint of + an Event Hub destination of an event subscription. + :type resource_id: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + } + + def __init__(self, resource_id=None): + super(EventHubEventSubscriptionDestination, self).__init__() + self.resource_id = resource_id + self.endpoint_type = 'EventHub' diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription.py new file mode 100644 index 00000000000..c4e7552b76b --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription.py @@ -0,0 +1,69 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class EventSubscription(Resource): + """Event Subscription. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified identifier of the resource + :vartype id: str + :ivar name: Name of the resource + :vartype name: str + :ivar type: Type of the resource + :vartype type: str + :ivar topic: Name of the topic of the event subscription. + :vartype topic: str + :ivar provisioning_state: Provisioning state of the event subscription. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Canceled', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.eventgrid.models.EventSubscriptionProvisioningState + :param destination: Information about the destination where events have to + be delivered for the event subscription. + :type destination: + ~azure.mgmt.eventgrid.models.EventSubscriptionDestination + :param filter: Information about the filter for the event subscription. + :type filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter + :param labels: List of user defined labels. + :type labels: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'topic': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'topic': {'key': 'properties.topic', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'destination': {'key': 'properties.destination', 'type': 'EventSubscriptionDestination'}, + 'filter': {'key': 'properties.filter', 'type': 'EventSubscriptionFilter'}, + 'labels': {'key': 'properties.labels', 'type': '[str]'}, + } + + def __init__(self, destination=None, filter=None, labels=None): + super(EventSubscription, self).__init__() + self.topic = None + self.provisioning_state = None + self.destination = destination + self.filter = filter + self.labels = labels diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_destination.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_destination.py new file mode 100644 index 00000000000..52a10f15367 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_destination.py @@ -0,0 +1,40 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventSubscriptionDestination(Model): + """Information about the destination for an event subscription. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: WebHookEventSubscriptionDestination, + EventHubEventSubscriptionDestination + + :param endpoint_type: Constant filled by server. + :type endpoint_type: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + } + + _subtype_map = { + 'endpoint_type': {'WebHook': 'WebHookEventSubscriptionDestination', 'EventHub': 'EventHubEventSubscriptionDestination'} + } + + def __init__(self): + super(EventSubscriptionDestination, self).__init__() + self.endpoint_type = None diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_filter.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_filter.py new file mode 100644 index 00000000000..fb73b0f0d43 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_filter.py @@ -0,0 +1,50 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventSubscriptionFilter(Model): + """Filter for the Event Subscription. + + :param subject_begins_with: An optional string to filter events for an + event subscription based on a resource path prefix. + The format of this depends on the publisher of the events. + Wildcard characters are not supported in this path. + :type subject_begins_with: str + :param subject_ends_with: An optional string to filter events for an event + subscription based on a resource path suffix. + Wildcard characters are not supported in this path. + :type subject_ends_with: str + :param included_event_types: A list of applicable event types that need to + be part of the event subscription. + If it is desired to subscribe to all event types, the string "all" needs + to be specified as an element in this list. + :type included_event_types: list[str] + :param is_subject_case_sensitive: Specifies if the SubjectBeginsWith and + SubjectEndsWith properties of the filter + should be compared in a case sensitive manner. Default value: False . + :type is_subject_case_sensitive: bool + """ + + _attribute_map = { + 'subject_begins_with': {'key': 'subjectBeginsWith', 'type': 'str'}, + 'subject_ends_with': {'key': 'subjectEndsWith', 'type': 'str'}, + 'included_event_types': {'key': 'includedEventTypes', 'type': '[str]'}, + 'is_subject_case_sensitive': {'key': 'isSubjectCaseSensitive', 'type': 'bool'}, + } + + def __init__(self, subject_begins_with=None, subject_ends_with=None, included_event_types=None, is_subject_case_sensitive=False): + super(EventSubscriptionFilter, self).__init__() + self.subject_begins_with = subject_begins_with + self.subject_ends_with = subject_ends_with + self.included_event_types = included_event_types + self.is_subject_case_sensitive = is_subject_case_sensitive diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_full_url.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_full_url.py new file mode 100644 index 00000000000..948e1af2ee4 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_full_url.py @@ -0,0 +1,29 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventSubscriptionFullUrl(Model): + """Full endpoint url of an event subscription. + + :param endpoint_url: The URL that represents the endpoint of the + destination of an event subscription. + :type endpoint_url: str + """ + + _attribute_map = { + 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, + } + + def __init__(self, endpoint_url=None): + super(EventSubscriptionFullUrl, self).__init__() + self.endpoint_url = endpoint_url diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_paged.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_paged.py new file mode 100644 index 00000000000..4a4656c716b --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_paged.py @@ -0,0 +1,27 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class EventSubscriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`EventSubscription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EventSubscription]'} + } + + def __init__(self, *args, **kwargs): + + super(EventSubscriptionPaged, self).__init__(*args, **kwargs) diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_update_parameters.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_update_parameters.py new file mode 100644 index 00000000000..88d04382399 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_update_parameters.py @@ -0,0 +1,38 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventSubscriptionUpdateParameters(Model): + """Properties of the Event Subscription update. + + :param destination: Information about the destination where events have to + be delivered for the event subscription. + :type destination: + ~azure.mgmt.eventgrid.models.EventSubscriptionDestination + :param filter: Information about the filter for the event subscription. + :type filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter + :param labels: List of user defined labels. + :type labels: list[str] + """ + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'EventSubscriptionDestination'}, + 'filter': {'key': 'filter', 'type': 'EventSubscriptionFilter'}, + 'labels': {'key': 'labels', 'type': '[str]'}, + } + + def __init__(self, destination=None, filter=None, labels=None): + super(EventSubscriptionUpdateParameters, self).__init__() + self.destination = destination + self.filter = filter + self.labels = labels diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_type.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_type.py new file mode 100644 index 00000000000..b663dcb41a1 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_type.py @@ -0,0 +1,54 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class EventType(Resource): + """Event Type for a subject under a topic. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified identifier of the resource + :vartype id: str + :ivar name: Name of the resource + :vartype name: str + :ivar type: Type of the resource + :vartype type: str + :param display_name: Display name of the event type. + :type display_name: str + :param description: Description of the event type. + :type description: str + :param schema_url: Url of the schema for this event type. + :type schema_url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'schema_url': {'key': 'properties.schemaUrl', 'type': 'str'}, + } + + def __init__(self, display_name=None, description=None, schema_url=None): + super(EventType, self).__init__() + self.display_name = display_name + self.description = description + self.schema_url = schema_url diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_type_paged.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_type_paged.py new file mode 100644 index 00000000000..18fad1e1f3e --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_type_paged.py @@ -0,0 +1,27 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class EventTypePaged(Paged): + """ + A paging container for iterating over a list of :class:`EventType ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EventType]'} + } + + def __init__(self, *args, **kwargs): + + super(EventTypePaged, self).__init__(*args, **kwargs) diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation.py new file mode 100644 index 00000000000..85f9c40b7b3 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation.py @@ -0,0 +1,40 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Represents an operation returned by the GetOperations request. + + :param name: Name of the operation + :type name: str + :param display: Display name of the operation + :type display: ~azure.mgmt.eventgrid.models.OperationInfo + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationInfo'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, name=None, display=None, origin=None, properties=None): + super(Operation, self).__init__() + self.name = name + self.display = display + self.origin = origin + self.properties = properties diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation_info.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation_info.py new file mode 100644 index 00000000000..6f1e27d8e86 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation_info.py @@ -0,0 +1,40 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationInfo(Model): + """Information about an operation. + + :param provider: Name of the provider + :type provider: str + :param resource: Name of the resource type + :type resource: str + :param operation: Name of the operation + :type operation: str + :param description: Description of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, provider=None, resource=None, operation=None, description=None): + super(OperationInfo, self).__init__() + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation_paged.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation_paged.py new file mode 100644 index 00000000000..097349fa5db --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation_paged.py @@ -0,0 +1,27 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/resource.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/resource.py new file mode 100644 index 00000000000..f988e34eac0 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/resource.py @@ -0,0 +1,45 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Definition of a Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified identifier of the resource + :vartype id: str + :ivar name: Name of the resource + :vartype name: str + :ivar type: Type of the resource + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self): + super(Resource, self).__init__() + self.id = None + self.name = None + self.type = None diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic.py new file mode 100644 index 00000000000..d70dc4d6eac --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic.py @@ -0,0 +1,62 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource + + +class Topic(TrackedResource): + """EventGrid Topic. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified identifier of the resource + :vartype id: str + :ivar name: Name of the resource + :vartype name: str + :ivar type: Type of the resource + :vartype type: str + :param location: Location of the resource + :type location: str + :param tags: Tags of the resource + :type tags: dict[str, str] + :ivar provisioning_state: Provisioning state of the topic. Possible values + include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', + 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.eventgrid.models.TopicProvisioningState + :ivar endpoint: Endpoint for the topic. + :vartype endpoint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'endpoint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + } + + def __init__(self, location, tags=None): + super(Topic, self).__init__(location=location, tags=tags) + self.provisioning_state = None + self.endpoint = None diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_paged.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_paged.py new file mode 100644 index 00000000000..ff520ebd8f2 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_paged.py @@ -0,0 +1,27 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class TopicPaged(Paged): + """ + A paging container for iterating over a list of :class:`Topic ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Topic]'} + } + + def __init__(self, *args, **kwargs): + + super(TopicPaged, self).__init__(*args, **kwargs) diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_regenerate_key_request.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_regenerate_key_request.py new file mode 100644 index 00000000000..f02219905a1 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_regenerate_key_request.py @@ -0,0 +1,32 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopicRegenerateKeyRequest(Model): + """Topic regenerate share access key key request. + + :param key_name: Key name to regenerate key1 or key2 + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, key_name): + super(TopicRegenerateKeyRequest, self).__init__() + self.key_name = key_name diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_shared_access_keys.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_shared_access_keys.py new file mode 100644 index 00000000000..4d3a24f26f4 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_shared_access_keys.py @@ -0,0 +1,32 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopicSharedAccessKeys(Model): + """Shared access keys of the Topic. + + :param key1: Shared access key1 for the topic. + :type key1: str + :param key2: Shared access key2 for the topic. + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, key1=None, key2=None): + super(TopicSharedAccessKeys, self).__init__() + self.key1 = key1 + self.key2 = key2 diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info.py new file mode 100644 index 00000000000..d665793898e --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info.py @@ -0,0 +1,72 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class TopicTypeInfo(Resource): + """Properties of a topic type info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified identifier of the resource + :vartype id: str + :ivar name: Name of the resource + :vartype name: str + :ivar type: Type of the resource + :vartype type: str + :param provider: Namespace of the provider of the topic type. + :type provider: str + :param display_name: Display Name for the topic type. + :type display_name: str + :param description: Description of the topic type. + :type description: str + :param resource_region_type: Region type of the resource. Possible values + include: 'RegionalResource', 'GlobalResource' + :type resource_region_type: str or + ~azure.mgmt.eventgrid.models.ResourceRegionType + :param provisioning_state: Provisioning state of the topic type. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Canceled', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.eventgrid.models.TopicTypeProvisioningState + :param supported_locations: List of locations supported by this topic + type. + :type supported_locations: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'resource_region_type': {'key': 'properties.resourceRegionType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'supported_locations': {'key': 'properties.supportedLocations', 'type': '[str]'}, + } + + def __init__(self, provider=None, display_name=None, description=None, resource_region_type=None, provisioning_state=None, supported_locations=None): + super(TopicTypeInfo, self).__init__() + self.provider = provider + self.display_name = display_name + self.description = description + self.resource_region_type = resource_region_type + self.provisioning_state = provisioning_state + self.supported_locations = supported_locations diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info_paged.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info_paged.py new file mode 100644 index 00000000000..e66d5826938 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info_paged.py @@ -0,0 +1,27 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class TopicTypeInfoPaged(Paged): + """ + A paging container for iterating over a list of :class:`TopicTypeInfo ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TopicTypeInfo]'} + } + + def __init__(self, *args, **kwargs): + + super(TopicTypeInfoPaged, self).__init__(*args, **kwargs) diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_update_parameters.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_update_parameters.py new file mode 100644 index 00000000000..49eda00176d --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_update_parameters.py @@ -0,0 +1,28 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopicUpdateParameters(Model): + """Properties of the Topic update. + + :param tags: Tags of the resource + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, tags=None): + super(TopicUpdateParameters, self).__init__() + self.tags = tags diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/tracked_resource.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/tracked_resource.py new file mode 100644 index 00000000000..eca3f8999a6 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/tracked_resource.py @@ -0,0 +1,51 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class TrackedResource(Resource): + """Definition of a Tracked Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified identifier of the resource + :vartype id: str + :ivar name: Name of the resource + :vartype name: str + :ivar type: Type of the resource + :vartype type: str + :param location: Location of the resource + :type location: str + :param tags: Tags of the resource + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, location, tags=None): + super(TrackedResource, self).__init__() + self.location = location + self.tags = tags diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/web_hook_event_subscription_destination.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/web_hook_event_subscription_destination.py new file mode 100644 index 00000000000..7041aca86d1 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/web_hook_event_subscription_destination.py @@ -0,0 +1,46 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .event_subscription_destination import EventSubscriptionDestination + + +class WebHookEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the webhook destination for an event subscription. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param endpoint_type: Constant filled by server. + :type endpoint_type: str + :param endpoint_url: The URL that represents the endpoint of the + destination of an event subscription. + :type endpoint_url: str + :ivar endpoint_base_url: The base URL that represents the endpoint of the + destination of an event subscription. + :vartype endpoint_base_url: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + 'endpoint_base_url': {'readonly': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'endpoint_url': {'key': 'properties.endpointUrl', 'type': 'str'}, + 'endpoint_base_url': {'key': 'properties.endpointBaseUrl', 'type': 'str'}, + } + + def __init__(self, endpoint_url=None): + super(WebHookEventSubscriptionDestination, self).__init__() + self.endpoint_url = endpoint_url + self.endpoint_base_url = None + self.endpoint_type = 'WebHook' diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/__init__.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/__init__.py new file mode 100644 index 00000000000..db9b4311e47 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/__init__.py @@ -0,0 +1,22 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .event_subscriptions_operations import EventSubscriptionsOperations +from .operations import Operations +from .topics_operations import TopicsOperations +from .topic_types_operations import TopicTypesOperations + +__all__ = [ + 'EventSubscriptionsOperations', + 'Operations', + 'TopicsOperations', + 'TopicTypesOperations', +] diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/event_subscriptions_operations.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/event_subscriptions_operations.py new file mode 100644 index 00000000000..74e08405b33 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/event_subscriptions_operations.py @@ -0,0 +1,1215 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError +from msrestazure.azure_operation import AzureOperationPoller + +from .. import models + + +class EventSubscriptionsOperations(object): + """EventSubscriptionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def get( + self, scope, event_subscription_name, custom_headers=None, raw=False, **operation_config): + """Get an event subscription. + + Get properties of an event subscription. + + :param scope: The scope of the event subscription. The scope can be a + subscription, or a resource group, or a top level resource belonging + to a resource provider namespace, or an EventGrid topic. For example, + use '/subscriptions/{subscriptionId}/' for a subscription, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for a resource group, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + for a resource, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + for an EventGrid topic. + :type scope: str + :param event_subscription_name: Name of the event subscription + :type event_subscription_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EventSubscription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.EventSubscription or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EventSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + + def _create_or_update_initial( + self, scope, event_subscription_name, event_subscription_info, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(event_subscription_info, 'EventSubscription') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('EventSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, scope, event_subscription_name, event_subscription_info, custom_headers=None, raw=False, **operation_config): + """Create or update an event subscription. + + Asynchronously creates a new event subscription or updates an existing + event subscription based on the specified scope. + + :param scope: The identifier of the resource to which the event + subscription needs to be created or updated. The scope can be a + subscription, or a resource group, or a top level resource belonging + to a resource provider namespace, or an EventGrid topic. For example, + use '/subscriptions/{subscriptionId}/' for a subscription, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for a resource group, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + for a resource, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + for an EventGrid topic. + :type scope: str + :param event_subscription_name: Name of the event subscription. Event + subscription names must be between 3 and 64 characters in length and + should use alphanumeric letters only. + :type event_subscription_name: str + :param event_subscription_info: Event subscription properties + containing the destination and filter information + :type event_subscription_info: + ~azure.mgmt.eventgrid.models.EventSubscription + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns + EventSubscription or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.EventSubscription] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + scope=scope, + event_subscription_name=event_subscription_name, + event_subscription_info=event_subscription_info, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._deserialize('EventSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + + def _delete_initial( + self, scope, event_subscription_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, scope, event_subscription_name, custom_headers=None, raw=False, **operation_config): + """Delete an event subscription. + + Delete an existing event subscription. + + :param scope: The scope of the event subscription. The scope can be a + subscription, or a resource group, or a top level resource belonging + to a resource provider namespace, or an EventGrid topic. For example, + use '/subscriptions/{subscriptionId}/' for a subscription, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for a resource group, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + for a resource, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + for an EventGrid topic. + :type scope: str + :param event_subscription_name: Name of the event subscription + :type event_subscription_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + scope=scope, + event_subscription_name=event_subscription_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + + def _update_initial( + self, scope, event_subscription_name, event_subscription_update_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(event_subscription_update_parameters, 'EventSubscriptionUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('EventSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, scope, event_subscription_name, event_subscription_update_parameters, custom_headers=None, raw=False, **operation_config): + """Update an event subscription. + + Asynchronously updates an existing event subscription. + + :param scope: The scope of existing event subscription. The scope can + be a subscription, or a resource group, or a top level resource + belonging to a resource provider namespace, or an EventGrid topic. For + example, use '/subscriptions/{subscriptionId}/' for a subscription, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for a resource group, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + for a resource, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + for an EventGrid topic. + :type scope: str + :param event_subscription_name: Name of the event subscription to be + created + :type event_subscription_name: str + :param event_subscription_update_parameters: Updated event + subscription information + :type event_subscription_update_parameters: + ~azure.mgmt.eventgrid.models.EventSubscriptionUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns + EventSubscription or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.EventSubscription] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + scope=scope, + event_subscription_name=event_subscription_name, + event_subscription_update_parameters=event_subscription_update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._deserialize('EventSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + def get_full_url( + self, scope, event_subscription_name, custom_headers=None, raw=False, **operation_config): + """Get full URL of an event subscription. + + Get the full endpoint URL for an event subscription. + + :param scope: The scope of the event subscription. The scope can be a + subscription, or a resource group, or a top level resource belonging + to a resource provider namespace, or an EventGrid topic. For example, + use '/subscriptions/{subscriptionId}/' for a subscription, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for a resource group, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + for a resource, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + for an EventGrid topic. + :type scope: str + :param event_subscription_name: Name of the event subscription + :type event_subscription_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EventSubscriptionFullUrl or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.EventSubscriptionFullUrl or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl' + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EventSubscriptionFullUrl', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_global_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Get an aggregated list of all global event subscriptions under an Azure + subscription. + + List all aggregated global event subscriptions under a specific Azure + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list_global_by_subscription_for_topic_type( + self, topic_type_name, custom_headers=None, raw=False, **operation_config): + """List all global event subscriptions for a topic type. + + List all global event subscriptions under an Azure subscription for a + topic type. + + :param topic_type_name: Name of the topic type + :type topic_type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list_global_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List all global event subscriptions under an Azure subscription and + resource group. + + List all global event subscriptions under a specific Azure subscription + and resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list_global_by_resource_group_for_topic_type( + self, resource_group_name, topic_type_name, custom_headers=None, raw=False, **operation_config): + """List all global event subscriptions under a resource group for a topic + type. + + List all global event subscriptions under a resource group for a + specific topic type. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_type_name: Name of the topic type + :type topic_type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list_regional_by_subscription( + self, location, custom_headers=None, raw=False, **operation_config): + """List all regional event subscriptions under an Azure subscription. + + List all event subscriptions from the given location under a specific + Azure subscription. + + :param location: Name of the location + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list_regional_by_resource_group( + self, resource_group_name, location, custom_headers=None, raw=False, **operation_config): + """List all regional event subscriptions under an Azure subscription and + resource group. + + List all event subscriptions from the given location under a specific + Azure subscription and resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param location: Name of the location + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list_regional_by_subscription_for_topic_type( + self, location, topic_type_name, custom_headers=None, raw=False, **operation_config): + """List all regional event subscriptions under an Azure subscription for a + topic type. + + List all event subscriptions from the given location under a specific + Azure subscription and topic type. + + :param location: Name of the location + :type location: str + :param topic_type_name: Name of the topic type + :type topic_type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list_regional_by_resource_group_for_topic_type( + self, resource_group_name, location, topic_type_name, custom_headers=None, raw=False, **operation_config): + """List all regional event subscriptions under an Azure subscription and + resource group for a topic type. + + List all event subscriptions from the given location under a specific + Azure subscription and resource group and topic type. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param location: Name of the location + :type location: str + :param topic_type_name: Name of the topic type + :type topic_type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list_by_resource( + self, resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers=None, raw=False, **operation_config): + """List all event subscriptions for a specific topic. + + List all event subscriptions that have been created for a specific + topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param provider_namespace: Namespace of the provider of the topic + :type provider_namespace: str + :param resource_type_name: Name of the resource type + :type resource_type_name: str + :param resource_name: Name of the resource + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'providerNamespace': self._serialize.url("provider_namespace", provider_namespace, 'str'), + 'resourceTypeName': self._serialize.url("resource_type_name", resource_type_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/operations.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/operations.py new file mode 100644 index 00000000000..ab97c65dfad --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/operations.py @@ -0,0 +1,101 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List available operations. + + List the available operations supported by the Microsoft.EventGrid + resource provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.eventgrid.models.OperationPaged[~azure.mgmt.eventgrid.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/providers/Microsoft.EventGrid/operations' + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topic_types_operations.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topic_types_operations.py new file mode 100644 index 00000000000..3eceb2d0989 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topic_types_operations.py @@ -0,0 +1,227 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class TopicTypesOperations(object): + """TopicTypesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List topic types. + + List all registered topic types. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TopicTypeInfo + :rtype: + ~azure.mgmt.eventgrid.models.TopicTypeInfoPaged[~azure.mgmt.eventgrid.models.TopicTypeInfo] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/providers/Microsoft.EventGrid/topicTypes' + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TopicTypeInfoPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TopicTypeInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def get( + self, topic_type_name, custom_headers=None, raw=False, **operation_config): + """Get a topic type. + + Get information about a topic type. + + :param topic_type_name: Name of the topic type + :type topic_type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TopicTypeInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.TopicTypeInfo or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}' + path_format_arguments = { + 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TopicTypeInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_event_types( + self, topic_type_name, custom_headers=None, raw=False, **operation_config): + """List event types. + + List event types for a topic type. + + :param topic_type_name: Name of the topic type + :type topic_type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventType + :rtype: + ~azure.mgmt.eventgrid.models.EventTypePaged[~azure.mgmt.eventgrid.models.EventType] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes' + path_format_arguments = { + 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventTypePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventTypePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topics_operations.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topics_operations.py new file mode 100644 index 00000000000..06b6ee9677d --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topics_operations.py @@ -0,0 +1,803 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError +from msrestazure.azure_operation import AzureOperationPoller + +from .. import models + + +class TopicsOperations(object): + """TopicsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def get( + self, resource_group_name, topic_name, custom_headers=None, raw=False, **operation_config): + """Get a topic. + + Get properties of a topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_name: Name of the topic + :type topic_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Topic or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.Topic or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Topic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + + def _create_or_update_initial( + self, resource_group_name, topic_name, location, tags=None, custom_headers=None, raw=False, **operation_config): + topic_info = models.Topic(location=location, tags=tags) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(topic_info, 'Topic') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('Topic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, topic_name, location, tags=None, custom_headers=None, raw=False, **operation_config): + """Create a topic. + + Asynchronously creates a new topic with the specified parameters. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_name: Name of the topic + :type topic_name: str + :param location: Location of the resource + :type location: str + :param tags: Tags of the resource + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns Topic or + ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.Topic] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + topic_name=topic_name, + location=location, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._deserialize('Topic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + + def _delete_initial( + self, resource_group_name, topic_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, topic_name, custom_headers=None, raw=False, **operation_config): + """Delete a topic. + + Delete existing topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_name: Name of the topic + :type topic_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + topic_name=topic_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + + def _update_initial( + self, resource_group_name, topic_name, tags=None, custom_headers=None, raw=False, **operation_config): + topic_update_parameters = models.TopicUpdateParameters(tags=tags) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(topic_update_parameters, 'TopicUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('Topic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, topic_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Update a topic. + + Asynchronously updates a topic with the specified parameters. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_name: Name of the topic + :type topic_name: str + :param tags: Tags of the resource + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns Topic or + ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.Topic] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + topic_name=topic_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._deserialize('Topic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """List topics under an Azure subscription. + + List all the topics under an Azure subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Topic + :rtype: + ~azure.mgmt.eventgrid.models.TopicPaged[~azure.mgmt.eventgrid.models.Topic] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TopicPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TopicPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List topics under a resource group. + + List all the topics under a resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Topic + :rtype: + ~azure.mgmt.eventgrid.models.TopicPaged[~azure.mgmt.eventgrid.models.Topic] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TopicPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TopicPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list_shared_access_keys( + self, resource_group_name, topic_name, custom_headers=None, raw=False, **operation_config): + """List keys for a topic. + + List the two keys used to publish to a topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_name: Name of the topic + :type topic_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TopicSharedAccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.TopicSharedAccessKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TopicSharedAccessKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def regenerate_key( + self, resource_group_name, topic_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerate key for a topic. + + Regenerate a shared access key for a topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_name: Name of the topic + :type topic_name: str + :param key_name: Key name to regenerate key1 or key2 + :type key_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TopicSharedAccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.TopicSharedAccessKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key_request = models.TopicRegenerateKeyRequest(key_name=key_name) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(regenerate_key_request, 'TopicRegenerateKeyRequest') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TopicSharedAccessKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_event_types( + self, resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers=None, raw=False, **operation_config): + """List topic event types. + + List event types for a topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param provider_namespace: Namespace of the provider of the topic + :type provider_namespace: str + :param resource_type_name: Name of the topic type + :type resource_type_name: str + :param resource_name: Name of the topic + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventType + :rtype: + ~azure.mgmt.eventgrid.models.EventTypePaged[~azure.mgmt.eventgrid.models.EventType] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'providerNamespace': self._serialize.url("provider_namespace", provider_namespace, 'str'), + 'resourceTypeName': self._serialize.url("resource_type_name", resource_type_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventTypePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventTypePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py new file mode 100644 index 00000000000..85da2c00c1a --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py @@ -0,0 +1,13 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.4.0" + diff --git a/src/eventgrid/azext_eventgrid/tests/__init__.py b/src/eventgrid/azext_eventgrid/tests/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/__init__.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/src/eventgrid/azext_eventgrid/tests/latest/__init__.py b/src/eventgrid/azext_eventgrid/tests/latest/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/__init__.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml new file mode 100644 index 00000000000..f877234dcce --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml @@ -0,0 +1,417 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.29] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 17:39:51 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: '{"properties": {"destination": {"properties": {"endpointUrl": "https://requestb.in/18zmdhv1"}, + "endpointType": "WebHook"}, "filter": {"isSubjectCaseSensitive": false, "subjectBeginsWith": + "mysubject_prefix"}}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + Content-Length: ['209'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix"},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/17903B72-3870-4449-83CC-949CAD461326?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['682'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 17:39:53 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/17903B72-3870-4449-83CC-949CAD461326?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/17903B72-3870-4449-83CC-949CAD461326?api-version=2018-01-01","name":"17903b72-3870-4449-83cc-949cad461326","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['262'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 17:40:03 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['733'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 17:40:03 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['733'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 17:40:05 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['733'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 17:40:04 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2/getFullUrl?api-version=2018-01-01 + response: + body: {string: '{"endpointUrl":"https://requestb.in/18zmdhv1"}'} + headers: + cache-control: [no-cache] + content-length: ['46'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 17:40:05 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['733'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 17:40:06 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"destination": {"properties": {"endpointUrl": "https://requestb.in/18zmdhv2"}, + "endpointType": "WebHook"}, "filter": {"includedEventTypes": ["All"], "subjectEndsWith": + ".jpg", "subjectBeginsWith": "mysubject_prefix"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + Content-Length: ['218'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Updating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/97BAD5CC-6F54-4A59-B057-847DA1910BE0?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['736'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 17:40:07 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/97BAD5CC-6F54-4A59-B057-847DA1910BE0?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/97BAD5CC-6F54-4A59-B057-847DA1910BE0?api-version=2018-01-01","name":"97bad5cc-6f54-4a59-b057-847da1910be0","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['262'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 17:40:17 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['737'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 17:40:18 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} + headers: + cache-control: [no-cache] + content-length: ['749'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 17:40:19 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 28 Feb 2018 17:40:20 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/5E788857-4CD0-4040-B562-160F90F16DE9?api-version=2018-01-01'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1195'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/5E788857-4CD0-4040-B562-160F90F16DE9?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 28 Feb 2018 17:40:30 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.29] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 28 Feb 2018 17:40:32 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdMMlFUNlRYVUdFWEJQT1ZVQkxLUTUyQjZSM0hLRExHTzJUV3wwRkJEQjZDQjFEMjhBRkZFLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_resource.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_resource.yaml new file mode 100644 index 00000000000..9de29802b64 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_resource.yaml @@ -0,0 +1,656 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.29] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clieventgridrg000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001","name":"clieventgridrg000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:05:02 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1196'] + status: {code: 201, message: Created} +- request: + body: '{"sku": {"name": "Standard_LRS"}, "properties": {"supportsHttpsTrafficOnly": + false}, "kind": "Storage", "location": "westus"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account create] + Connection: [keep-alive] + Content-Length: ['125'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-storage/1.5.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002?api-version=2017-10-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + content-type: [text/plain; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:05:04 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westus/asyncoperations/3dd112ef-c66a-45ce-8266-a5d264293bdb?monitor=true&api-version=2017-10-01'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1196'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account create] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-storage/1.5.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westus/asyncoperations/3dd112ef-c66a-45ce-8266-a5d264293bdb?monitor=true&api-version=2017-10-01 + response: + body: {string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002","name":"clieventgrid000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"trustedDirectories":["54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"],"supportsHttpsTrafficOnly":false,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2018-02-28T18:05:04.6806944Z"},"blob":{"enabled":true,"lastEnabledTime":"2018-02-28T18:05:04.6806944Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2018-02-28T18:05:04.6025570Z","primaryEndpoints":{"blob":"https://clieventgrid000002.blob.core.windows.net/","queue":"https://clieventgrid000002.queue.core.windows.net/","table":"https://clieventgrid000002.table.core.windows.net/","file":"https://clieventgrid000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}'} + headers: + cache-control: [no-cache] + content-length: ['1231'] + content-type: [application/json] + date: ['Wed, 28 Feb 2018 18:05:22 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account keys list] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-storage/1.5.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/listKeys?api-version=2017-10-01 + response: + body: {string: '{"keys":[{"keyName":"key1","value":"5rj+3UqYkQ3KHvb/8bAHJ9ELuCRxHLtKKE4GrmMgeVNKfc+s6OBnR/zssvek62Vq3zJz09yl82ars8GLFoIgZg==","permissions":"FULL"},{"keyName":"key2","value":"VfcWCXVdBVHtIQ2ejZsscYwdqyGBo05aaDPeYAj4YqVTp/1o1bmM0Rym8WDRZnjczxy79C3dY+pzqVudmxoY7A==","permissions":"FULL"}]}'} + headers: + cache-control: [no-cache] + content-length: ['288'] + content-type: [application/json] + date: ['Wed, 28 Feb 2018 18:05:23 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: '{"sku": {"name": "Standard_LRS"}, "properties": {"supportsHttpsTrafficOnly": + false}, "kind": "Storage", "location": "westus"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account create] + Connection: [keep-alive] + Content-Length: ['125'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-storage/1.5.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002?api-version=2017-10-01 + response: + body: {string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002","name":"clieventgrid000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"trustedDirectories":["54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"],"supportsHttpsTrafficOnly":false,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2018-02-28T18:05:04.6806944Z"},"blob":{"enabled":true,"lastEnabledTime":"2018-02-28T18:05:04.6806944Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2018-02-28T18:05:04.6025570Z","primaryEndpoints":{"blob":"https://clieventgrid000002.blob.core.windows.net/","queue":"https://clieventgrid000002.queue.core.windows.net/","table":"https://clieventgrid000002.table.core.windows.net/","file":"https://clieventgrid000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}'} + headers: + cache-control: [no-cache] + content-length: ['1231'] + content-type: [application/json] + date: ['Wed, 28 Feb 2018 18:05:24 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account update] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-storage/1.5.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002?api-version=2017-10-01 + response: + body: {string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002","name":"clieventgrid000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"trustedDirectories":["54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"],"supportsHttpsTrafficOnly":false,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2018-02-28T18:05:04.6806944Z"},"blob":{"enabled":true,"lastEnabledTime":"2018-02-28T18:05:04.6806944Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2018-02-28T18:05:04.6025570Z","primaryEndpoints":{"blob":"https://clieventgrid000002.blob.core.windows.net/","queue":"https://clieventgrid000002.queue.core.windows.net/","table":"https://clieventgrid000002.table.core.windows.net/","file":"https://clieventgrid000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}'} + headers: + cache-control: [no-cache] + content-length: ['1231'] + content-type: [application/json] + date: ['Wed, 28 Feb 2018 18:05:24 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"sku": {"name": "Standard_LRS"}, "properties": {"networkAcls": {"virtualNetworkRules": + [], "bypass": "AzureServices", "ipRules": [], "defaultAction": "Allow"}, "supportsHttpsTrafficOnly": + false, "encryption": {"keySource": "Microsoft.Storage", "services": {"file": + {"enabled": true}, "blob": {"enabled": true}}}}, "kind": "StorageV2", "tags": + {}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account update] + Connection: [keep-alive] + Content-Length: ['347'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-storage/1.5.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002?api-version=2017-10-01 + response: + body: {string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002","name":"clieventgrid000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"trustedDirectories":["54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"],"supportsHttpsTrafficOnly":false,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2018-02-28T18:05:04.6806944Z"},"blob":{"enabled":true,"lastEnabledTime":"2018-02-28T18:05:04.6806944Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2018-02-28T18:05:04.6025570Z","primaryEndpoints":{"blob":"https://clieventgrid000002.blob.core.windows.net/","queue":"https://clieventgrid000002.queue.core.windows.net/","table":"https://clieventgrid000002.table.core.windows.net/","file":"https://clieventgrid000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}'} + headers: + cache-control: [no-cache] + content-length: ['1252'] + content-type: [application/json] + date: ['Wed, 28 Feb 2018 18:05:25 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: '{"properties": {"filter": {"isSubjectCaseSensitive": false}, "destination": + {"properties": {"endpointUrl": "https://requestb.in/18zmdhv1"}, "endpointType": + "WebHook"}}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + Content-Length: ['168'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/A49849E2-4AD0-4C44-88AB-30A7C7298FC3?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['826'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:05:27 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/A49849E2-4AD0-4C44-88AB-30A7C7298FC3?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/A49849E2-4AD0-4C44-88AB-30A7C7298FC3?api-version=2018-01-01","name":"a49849e2-4ad0-4c44-88ab-30a7c7298fc3","status":"InProgress"}'} + headers: + cache-control: [no-cache] + content-length: ['280'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:05:37 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/A49849E2-4AD0-4C44-88AB-30A7C7298FC3?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/A49849E2-4AD0-4C44-88AB-30A7C7298FC3?api-version=2018-01-01","name":"a49849e2-4ad0-4c44-88ab-30a7c7298fc3","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['279'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:06:07 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['899'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:06:07 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['899'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:06:07 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['899'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:06:09 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003/getFullUrl?api-version=2018-01-01 + response: + body: {string: '{"endpointUrl":"https://requestb.in/18zmdhv1"}'} + headers: + cache-control: [no-cache] + content-length: ['46'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:06:09 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['899'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:06:09 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"filter": {"subjectBeginsWith": "", "includedEventTypes": ["All"], "subjectEndsWith": + ".jpg"}, "destination": {"properties": {"endpointUrl": "https://requestb.in/18zmdhv2"}, + "endpointType": "WebHook"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + Content-Length: ['202'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Updating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/658023CA-7B83-449D-BD3E-242BCAB279E3?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['902'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:06:11 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/658023CA-7B83-449D-BD3E-242BCAB279E3?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/658023CA-7B83-449D-BD3E-242BCAB279E3?api-version=2018-01-01","name":"658023ca-7b83-449d-bd3e-242bcab279e3","status":"InProgress"}'} + headers: + cache-control: [no-cache] + content-length: ['280'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:06:20 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/658023CA-7B83-449D-BD3E-242BCAB279E3?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/658023CA-7B83-449D-BD3E-242BCAB279E3?api-version=2018-01-01","name":"658023ca-7b83-449d-bd3e-242bcab279e3","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['279'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:06:52 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['903'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:06:51 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} + headers: + cache-control: [no-cache] + content-length: ['915'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:06:52 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 28 Feb 2018 18:06:54 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationResults/9B2EB4B1-F6A3-492E-A6AC-FB58B0F89FDE?api-version=2018-01-01'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationResults/9B2EB4B1-F6A3-492E-A6AC-FB58B0F89FDE?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 28 Feb 2018 18:07:05 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.29] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clieventgridrg000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 28 Feb 2018 18:07:06 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElFVkVOVEdSSURSR0tNV0dRSlpGRktSN0s0T1NBUVQ1VExMR1NTQk02T1BTTnw3RTZDNzY3MTE4MzQzMjEyLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1195'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml new file mode 100644 index 00000000000..50d917d49fe --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml @@ -0,0 +1,359 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.29] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:10:01 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1194'] + status: {code: 201, message: Created} +- request: + body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": + {"endpointUrl": "https://requestb.in/18zmdhv1"}}, "labels": ["Finance", "HR"], + "filter": {"includedEventTypes": ["blobCreated", "blobUpdated"], "subjectEndsWith": + "mysubject_suffix", "isSubjectCaseSensitive": true}}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + Content-Length: ['289'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['773'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:10:07 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01","name":"d1a94534-bdd0-4da9-ab46-401ba0c5830f","status":"InProgress"}'} + headers: + cache-control: [no-cache] + content-length: ['263'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:10:17 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01","name":"d1a94534-bdd0-4da9-ab46-401ba0c5830f","status":"InProgress"}'} + headers: + cache-control: [no-cache] + content-length: ['263'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:10:48 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01","name":"d1a94534-bdd0-4da9-ab46-401ba0c5830f","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['262'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:11:18 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['797'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:11:18 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['797'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:11:19 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['797'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:11:19 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2/getFullUrl?api-version=2018-01-01 + response: + body: {string: '{"endpointUrl":"https://requestb.in/18zmdhv1"}'} + headers: + cache-control: [no-cache] + content-length: ['46'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:11:20 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} + headers: + cache-control: [no-cache] + content-length: ['809'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 28 Feb 2018 18:11:20 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 28 Feb 2018 18:11:22 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/B8AD08A1-C0B3-4137-A2DD-7675E6A7DD71?api-version=2018-01-01'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1195'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/B8AD08A1-C0B3-4137-A2DD-7675E6A7DD71?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 28 Feb 2018 18:11:33 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.29] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 28 Feb 2018 18:11:34 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdUTDRCU0M3TjRMN0ZZRkFTMlNUUUU2NUVVSE42M0JBT1RQT3w4NDczRTEyNTE4QTkwQkFCLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1189'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml new file mode 100644 index 00000000000..9b56c1a802f --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml @@ -0,0 +1,872 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:24 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: '{"location": "westus2"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + Content-Length: ['23'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provisioningState":"Creating","endpoint":null},"location":"westus2","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/3085124C-C601-40D4-BD4C-1879D9CE024F?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['410'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:25 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/E9B32DA7-DB73-4F12-83AE-49C284488F70?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 24 Jan 2018 19:16:31 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/3085124C-C601-40D4-BD4C-1879D9CE024F?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/3085124C-C601-40D4-BD4C-1879D9CE024F?api-version=2018-01-01","name":"3085124c-c601-40d4-bd4c-1879d9ce024f","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['280'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:36 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.westus2-1.eventgrid.azure.net/api/events"},"location":"westus2","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + cache-control: [no-cache] + content-length: ['498'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:36 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.westus2-1.eventgrid.azure.net/api/events"},"location":"westus2","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + cache-control: [no-cache] + content-length: ['498'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:37 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic update] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.westus2-1.eventgrid.azure.net/api/events"},"location":"westus2","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + cache-control: [no-cache] + content-length: ['498'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:37 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: '{"tags": {"Dept": "IT"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic update] + Connection: [keep-alive] + Content-Length: ['24'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provisioningState":"Updating","endpoint":"https://cli000002.westus2-1.eventgrid.azure.net/api/events"},"location":"westus2","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/42D2BD1E-6F20-44CC-B55C-512E6AACA621?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['506'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:38 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic update] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/42D2BD1E-6F20-44CC-B55C-512E6AACA621?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/42D2BD1E-6F20-44CC-B55C-512E6AACA621?api-version=2018-01-01","name":"42d2bd1e-6f20-44cc-b55c-512e6aaca621","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['280'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:48 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic update] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.westus2-1.eventgrid.azure.net/api/events"},"location":"westus2","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + cache-control: [no-cache] + content-length: ['507'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:49 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.westus2-1.eventgrid.azure.net/api/events"},"location":"westus2","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}]}'} + headers: + cache-control: [no-cache] + content-length: ['519'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:49 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic key list] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/listKeys?api-version=2018-01-01 + response: + body: {string: '{"key1":"7wmL9F7yQn+3EAo5Jec0S1v5KrPp67uzEESJ73vkcZQ=","key2":"aXPLwYZgRkBMYGBdDm4nh5QDo9r8iMiHj9ErN/6rgCc="}'} + headers: + cache-control: [no-cache] + content-length: ['109'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:49 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: '{"keyName": "key1"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic key regenerate] + Connection: [keep-alive] + Content-Length: ['19'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/regenerateKey?api-version=2018-01-01 + response: + body: {string: '{"key1":"6ctpQeWQ3bKmjIPhAJI5YKTZOTwYFIyhvcegiADG7KU=","key2":"aXPLwYZgRkBMYGBdDm4nh5QDo9r8iMiHj9ErN/6rgCc="}'} + headers: + cache-control: [no-cache] + content-length: ['109'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:50 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: '{"keyName": "key2"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic key regenerate] + Connection: [keep-alive] + Content-Length: ['19'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/regenerateKey?api-version=2018-01-01 + response: + body: {string: '{"key1":"6ctpQeWQ3bKmjIPhAJI5YKTZOTwYFIyhvcegiADG7KU=","key2":"fxdT5G9RbtU9/Dt3J/fsuP3QEEoigxVtJO50fj5X92g="}'} + headers: + cache-control: [no-cache] + content-length: ['109'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:50 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": + {"endpointUrl": "https://requestb.in/18zmdhv1"}}, "filter": {"isSubjectCaseSensitive": + false}}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + Content-Length: ['168'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/51BD9C4D-BD3E-45C4-A8A3-FF170E2CA549?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['844'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:16:51 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/51BD9C4D-BD3E-45C4-A8A3-FF170E2CA549?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/51BD9C4D-BD3E-45C4-A8A3-FF170E2CA549?api-version=2018-01-01","name":"51bd9c4d-bd3e-45c4-a8a3-ff170e2ca549","status":"InProgress"}'} + headers: + cache-control: [no-cache] + content-length: ['281'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:17:02 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/51BD9C4D-BD3E-45C4-A8A3-FF170E2CA549?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/51BD9C4D-BD3E-45C4-A8A3-FF170E2CA549?api-version=2018-01-01","name":"51bd9c4d-bd3e-45c4-a8a3-ff170e2ca549","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['280'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:17:31 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['917'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:17:32 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['917'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:17:32 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['917'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:17:33 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003/getFullUrl?api-version=2018-01-01 + response: + body: {string: '{"endpointUrl":"https://requestb.in/18zmdhv1"}'} + headers: + cache-control: [no-cache] + content-length: ['46'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:17:32 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['917'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:17:34 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: '{"destination": {"endpointType": "WebHook", "properties": {"endpointUrl": + "https://requestb.in/18zmdhv2"}}, "filter": {"subjectBeginsWith": "", "subjectEndsWith": + "", "includedEventTypes": ["All"]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + Content-Length: ['198'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Updating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['916'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:17:34 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01","name":"bdb1e8e1-0a72-4cc0-8d59-c19c6a93fe27","status":"InProgress"}'} + headers: + cache-control: [no-cache] + content-length: ['281'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:17:44 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01","name":"bdb1e8e1-0a72-4cc0-8d59-c19c6a93fe27","status":"InProgress"}'} + headers: + cache-control: [no-cache] + content-length: ['281'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:18:14 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01","name":"bdb1e8e1-0a72-4cc0-8d59-c19c6a93fe27","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['280'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:18:44 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['917'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:18:45 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} + headers: + cache-control: [no-cache] + content-length: ['929'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:18:45 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 24 Jan 2018 19:18:46 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationResults/7FD22F25-21F8-4D2A-91EC-2BADA4E10BD3?api-version=2018-01-01'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 24 Jan 2018 19:18:47 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationResults/F819FFA2-A9B2-4D2D-9F0D-D3D86712EA00?api-version=2018-01-01'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationResults/7FD22F25-21F8-4D2A-91EC-2BADA4E10BD3?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 24 Jan 2018 19:18:56 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic delete] + Connection: [keep-alive] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationResults/F819FFA2-A9B2-4D2D-9F0D-D3D86712EA00?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 24 Jan 2018 19:18:57 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.26] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 24 Jan 2018 19:18:59 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkc3TE5aTUFYVUtEQkFCTlRXSklFMlIyTEFIVEpRQVE0RUY2UXwzODFBMkU0OTRGNENDMDVDLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_topic_types.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_topic_types.yaml new file mode 100644 index 00000000000..e25414d5a2a --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_topic_types.yaml @@ -0,0 +1,100 @@ +interactions: +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic-type list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/providers/Microsoft.EventGrid/topicTypes?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"provider":"Microsoft.Eventhub","displayName":"EventHubs + Namespace","description":"Microsoft EventHubs service events.","resourceRegionType":"RegionalResource","provisioningState":"Succeeded","supportedLocations":["West + US 2","West Central US","East US 2 EUAP"]},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Eventhub.Namespaces","name":"Microsoft.Eventhub.Namespaces","type":"Microsoft.EventGrid/topicTypes"},{"properties":{"provider":"Microsoft.Storage","displayName":"Storage + Accounts","description":"Microsoft Storage service events.","resourceRegionType":"RegionalResource","provisioningState":"Succeeded","supportedLocations":["West + US 2","West Central US","East US 2 EUAP"]},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Storage.StorageAccounts","name":"Microsoft.Storage.StorageAccounts","type":"Microsoft.EventGrid/topicTypes"},{"properties":{"provider":"Microsoft.Resources","displayName":"Azure + Subscriptions","description":"Resource management events under an Azure subscription","resourceRegionType":"GlobalResource","provisioningState":"Succeeded"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions","name":"Microsoft.Resources.Subscriptions","type":"Microsoft.EventGrid/topicTypes"},{"properties":{"provider":"Microsoft.Resources","displayName":"Resource + Groups","description":"Resource management events under a resource group.","resourceRegionType":"GlobalResource","provisioningState":"Succeeded"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.ResourceGroups","name":"Microsoft.Resources.ResourceGroups","type":"Microsoft.EventGrid/topicTypes"},{"properties":{"provider":"Microsoft.Devices","displayName":"Microsoft + Devices IotHubs","description":"Microsoft Devices IotHubs","resourceRegionType":"RegionalResource","provisioningState":"Succeeded"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Devices.IotHubs","name":"Microsoft.Devices.IotHubs","type":"Microsoft.EventGrid/topicTypes"}]}'} + headers: + cache-control: [no-cache] + content-length: ['2016'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:19:00 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic-type show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provider":"Microsoft.Resources","displayName":"Azure + Subscriptions","description":"Resource management events under an Azure subscription","resourceRegionType":"GlobalResource","provisioningState":"Succeeded"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions","name":"Microsoft.Resources.Subscriptions","type":"Microsoft.EventGrid/topicTypes"}'} + headers: + cache-control: [no-cache] + content-length: ['391'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:19:00 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic-type list-event-types] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 + msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"displayName":"Resource Write Success","description":"Raised + when a resource create or update operation succeeds.","schemaUrl":"TBD"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes/Microsoft.Resources.ResourceWriteSuccess","name":"Microsoft.Resources.ResourceWriteSuccess","type":"Microsoft.EventGrid/topicTypes/eventTypes"},{"properties":{"displayName":"Resource + Write Failure","description":"Raised when a resource create or update operation + fails.","schemaUrl":"TBD"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes/Microsoft.Resources.ResourceWriteFailure","name":"Microsoft.Resources.ResourceWriteFailure","type":"Microsoft.EventGrid/topicTypes/eventTypes"},{"properties":{"displayName":"Resource + Write Cancel","description":"Raised when a resource create or update operation + is cancelled.","schemaUrl":"TBD"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes/Microsoft.Resources.ResourceWriteCancel","name":"Microsoft.Resources.ResourceWriteCancel","type":"Microsoft.EventGrid/topicTypes/eventTypes"},{"properties":{"displayName":"Resource + Delete Success","description":"Raised when a resource deletion operation succeeds.","schemaUrl":"TBD"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes/Microsoft.Resources.ResourceDeleteSuccess","name":"Microsoft.Resources.ResourceDeleteSuccess","type":"Microsoft.EventGrid/topicTypes/eventTypes"},{"properties":{"displayName":"Resource + Delete Failure","description":"Raised when a resource delete operation fails.","schemaUrl":"TBD"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes/Microsoft.Resources.ResourceDeleteFailure","name":"Microsoft.Resources.ResourceDeleteFailure","type":"Microsoft.EventGrid/topicTypes/eventTypes"},{"properties":{"displayName":"Resource + Delete Cancel","description":"Raised when a resource delete is cancelled. + This happens when template deployment is cancelled.","schemaUrl":"TBD"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes/Microsoft.Resources.ResourceDeleteCancel","name":"Microsoft.Resources.ResourceDeleteCancel","type":"Microsoft.EventGrid/topicTypes/eventTypes"}]}'} + headers: + cache-control: [no-cache] + content-length: ['2340'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 24 Jan 2018 19:19:00 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + status: {code: 200, message: OK} +version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py b/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py new file mode 100644 index 00000000000..18466ea4ec5 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py @@ -0,0 +1,225 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +import unittest +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer + + +class EventGridTests(ScenarioTest): + def test_topic_types(self): + + self.kwargs.update({ + 'topic_type_name': 'Microsoft.Resources.Subscriptions' + }) + + self.cmd('az eventgrid topic-type list', checks=[ + self.check('[0].type', 'Microsoft.EventGrid/topicTypes') + ]) + self.cmd('az eventgrid topic-type show --name {topic_type_name}', checks=[ + self.check('type', 'Microsoft.EventGrid/topicTypes'), + self.check('name', self.kwargs['topic_type_name']) + ]) + self.cmd('az eventgrid topic-type list-event-types --name {topic_type_name}', checks=[ + self.check('[0].type', 'Microsoft.EventGrid/topicTypes/eventTypes') + ]) + + @ResourceGroupPreparer() + def test_create_topic(self, resource_group): + topic_name = self.create_random_name(prefix='cli', length=40) + event_subscription_name = self.create_random_name(prefix='cli', length=40) + + self.kwargs.update({ + 'topic_name': topic_name, + 'location': 'westus2', + 'event_subscription_name': event_subscription_name + }) + + self.cmd('az eventgrid topic create --name {topic_name} --resource-group {rg} --location {location}', checks=[ + self.check('type', 'Microsoft.EventGrid/topics'), + self.check('name', self.kwargs['topic_name']), + self.check('provisioningState', 'Succeeded'), + ]) + + self.cmd('az eventgrid topic show --name {topic_name} --resource-group {rg}', checks=[ + self.check('type', 'Microsoft.EventGrid/topics'), + self.check('name', self.kwargs['topic_name']), + ]) + + self.cmd('az eventgrid topic update --name {topic_name} --resource-group {rg} --tags Dept=IT', checks=[ + self.check('name', self.kwargs['topic_name']), + self.check('tags', {'Dept': 'IT'}), + ]) + + self.cmd('az eventgrid topic list --resource-group {rg}', checks=[ + self.check('[0].type', 'Microsoft.EventGrid/topics'), + self.check('[0].name', self.kwargs['topic_name']), + ]) + + output = self.cmd('az eventgrid topic key list --name {topic_name} --resource-group {rg}').get_output_in_json() + self.assertIsNotNone(output['key1']) + self.assertIsNotNone(output['key2']) + + output = self.cmd('az eventgrid topic key regenerate --name {topic_name} --resource-group {rg} --key-name key1').get_output_in_json() + self.assertIsNotNone(output['key1']) + self.assertIsNotNone(output['key2']) + + self.cmd('az eventgrid topic key regenerate --name {topic_name} --resource-group {rg} --key-name key2').get_output_in_json() + self.assertIsNotNone(output['key1']) + self.assertIsNotNone(output['key2']) + + self.cmd('az eventgrid event-subscription create --topic-name {topic_name} -g {rg} --name {event_subscription_name} --endpoint https://requestb.in/18zmdhv1', checks=[ + self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('provisioningState', 'Succeeded'), + self.check('name', self.kwargs['event_subscription_name']), + self.check('destination.endpointBaseUrl', 'https://requestb.in/18zmdhv1') + ]) + + self.cmd('az eventgrid event-subscription show --topic-name {topic_name} -g {rg} --name {event_subscription_name}', checks=[ + self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('provisioningState', 'Succeeded'), + self.check('name', self.kwargs['event_subscription_name']), + ]) + + self.cmd('az eventgrid event-subscription show --topic-name {topic_name} -g {rg} --name {event_subscription_name} --include-full-endpoint-url', checks=[ + self.check('destination.endpointUrl', 'https://requestb.in/18zmdhv1'), + self.check('destination.endpointBaseUrl', 'https://requestb.in/18zmdhv1') + ]) + + self.cmd('az eventgrid event-subscription update --topic-name {topic_name} -g {rg} --name {event_subscription_name} --endpoint https://requestb.in/18zmdhv2', checks=[ + self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('provisioningState', 'Succeeded'), + self.check('name', self.kwargs['event_subscription_name']), + self.check('destination.endpointBaseUrl', 'https://requestb.in/18zmdhv2') + ]) + + self.cmd('az eventgrid event-subscription list --topic-name {topic_name} -g {rg}', checks=[ + self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('[0].provisioningState', 'Succeeded'), + ]) + self.cmd('az eventgrid event-subscription delete --topic-name {topic_name} -g {rg} --name {event_subscription_name}') + self.cmd('az eventgrid topic delete --name {topic_name} --resource-group {rg}') + + @ResourceGroupPreparer() + def test_create_event_subscriptions_to_arm_resource_group(self, resource_group): + event_subscription_name = 'eventsubscription2' + endpoint_url = 'https://requestb.in/18zmdhv1' + + self.kwargs.update({ + 'event_subscription_name': event_subscription_name, + 'endpoint_url': endpoint_url + }) + + self.cmd('az eventgrid event-subscription create -g {rg} --name {event_subscription_name} --endpoint {endpoint_url} --subject-begins-with mysubject_prefix', checks=[ + self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('provisioningState', 'Succeeded'), + self.check('name', self.kwargs['event_subscription_name']), + self.check('destination.endpointBaseUrl', self.kwargs['endpoint_url']) + ]) + + self.cmd('az eventgrid event-subscription show -g {rg} --name {event_subscription_name}', checks=[ + self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('filter.subjectBeginsWith', 'mysubject_prefix') + ]) + self.cmd('az eventgrid event-subscription show --include-full-endpoint-url --resource-group {rg} --name {event_subscription_name}', checks=[ + self.check('destination.endpointUrl', self.kwargs['endpoint_url']), + ]) + + self.cmd('az eventgrid event-subscription update -g {rg} --name {event_subscription_name} --endpoint https://requestb.in/18zmdhv2 --subject-ends-with .jpg', checks=[ + self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('provisioningState', 'Succeeded'), + self.check('name', self.kwargs['event_subscription_name']), + self.check('destination.endpointBaseUrl', 'https://requestb.in/18zmdhv2'), + self.check('filter.subjectEndsWith', '.jpg'), + ]) + + self.cmd('az eventgrid event-subscription list -g {rg}', checks=[ + self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('[0].provisioningState', 'Succeeded'), + ]) + + self.cmd('az eventgrid event-subscription delete --resource-group {rg} --name {event_subscription_name}') + + @ResourceGroupPreparer(name_prefix='clieventgridrg') + @StorageAccountPreparer(name_prefix='clieventgrid') + def test_create_event_subscriptions_to_resource(self, resource_group, resource_group_location, storage_account): + event_subscription_name = self.create_random_name(prefix='cli', length=40) + + self.kwargs.update({ + 'event_subscription_name': event_subscription_name, + 'location': resource_group_location + }) + + self.kwargs['resource_id'] = self.cmd('storage account create -g {rg} -n {sa} --sku Standard_LRS -l {location}').get_output_in_json()['id'] + self.cmd('az storage account update -g {rg} -n {sa} --set kind=StorageV2') + + self.cmd('az eventgrid event-subscription create --resource-id {resource_id} --name {event_subscription_name} --endpoint https://requestb.in/18zmdhv1', checks=[ + self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('provisioningState', 'Succeeded'), + self.check('name', self.kwargs['event_subscription_name']), + ]) + + self.cmd('az eventgrid event-subscription show --resource-id {resource_id} --name {event_subscription_name}', checks=[ + self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('provisioningState', 'Succeeded'), + self.check('name', self.kwargs['event_subscription_name']), + ]) + self.cmd('az eventgrid event-subscription show --include-full-endpoint-url --resource-id {resource_id} --name {event_subscription_name}', checks=[ + self.check('destination.endpointUrl', 'https://requestb.in/18zmdhv1'), + ]) + + self.cmd('az eventgrid event-subscription update --resource-id {resource_id} --name {event_subscription_name} --endpoint https://requestb.in/18zmdhv2 --subject-ends-with .jpg', checks=[ + self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('provisioningState', 'Succeeded'), + self.check('name', self.kwargs['event_subscription_name']), + self.check('destination.endpointBaseUrl', 'https://requestb.in/18zmdhv2'), + self.check('filter.subjectEndsWith', '.jpg'), + ]) + + self.cmd('az eventgrid event-subscription list --resource-id {resource_id}', checks=[ + self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('[0].provisioningState', 'Succeeded'), + ]) + self.cmd('az eventgrid event-subscription delete --resource-id {resource_id} --name {event_subscription_name}') + + @ResourceGroupPreparer() + def test_create_event_subscriptions_with_filters(self, resource_group): + event_subscription_name = 'eventsubscription2' + endpoint_url = 'https://requestb.in/18zmdhv1' + subject_ends_with = 'mysubject_suffix' + event_type_1 = 'blobCreated' + event_type_2 = 'blobUpdated' + label_1 = 'Finance' + label_2 = 'HR' + + self.kwargs.update({ + 'event_subscription_name': event_subscription_name, + 'endpoint_url': endpoint_url, + 'subject_ends_with': subject_ends_with, + 'event_type_1': event_type_1, + 'event_type_2': event_type_2, + 'label_1': label_1, + 'label_2': label_2 + }) + + self.cmd('az eventgrid event-subscription create -g {rg} --name {event_subscription_name} --endpoint {endpoint_url} --subject-ends-with {subject_ends_with} --included-event-types {event_type_1} {event_type_2} --subject-case-sensitive --labels {label_1} {label_2}') + + # TODO: Add a verification that filter.isSubjectCaseSensitive is true after resolving why it shows as null in the response + self.cmd('az eventgrid event-subscription show -g {rg} --name {event_subscription_name}', checks=[ + self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('filter.subjectEndsWith', self.kwargs['subject_ends_with']), + self.check('filter.includedEventTypes[0]', self.kwargs['event_type_1']), + self.check('filter.includedEventTypes[1]', self.kwargs['event_type_2']), + self.check('labels[0]', self.kwargs['label_1']), + self.check('labels[1]', self.kwargs['label_2']), + ]) + self.cmd('az eventgrid event-subscription show --include-full-endpoint-url --resource-group {rg} --name {event_subscription_name}', checks=[ + self.check('destination.endpointUrl', self.kwargs['endpoint_url']), + ]) + self.cmd('az eventgrid event-subscription list -g {rg}', checks=[ + self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('[0].provisioningState', 'Succeeded'), + ]) + self.cmd('az eventgrid event-subscription delete --resource-group {rg} --name {event_subscription_name}') diff --git a/src/eventgrid/setup.cfg b/src/eventgrid/setup.cfg new file mode 100644 index 00000000000..3480374bc2f --- /dev/null +++ b/src/eventgrid/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 \ No newline at end of file diff --git a/src/eventgrid/setup.py b/src/eventgrid/setup.py new file mode 100644 index 00000000000..bb87c47b82c --- /dev/null +++ b/src/eventgrid/setup.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from codecs import open +from setuptools import setup, find_packages + +VERSION = "0.2.0" + +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +setup( + name='eventgrid', + version=VERSION, + description='An Azure CLI Extension providing support for Azure EventGrid preview version.', + long_description='An Azure CLI Extension providing support for Azure EventGrid preview version.', + license='MIT', + author='J. Kalyana Sundaram', + author_email='kalyanaj@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions', + classifiers=CLASSIFIERS, + packages=find_packages(exclude=["tests"]), + install_requires=DEPENDENCIES +) From 3c79218df742ecfb09296695bb3c1f449822b6e0 Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Thu, 19 Apr 2018 10:44:39 -0700 Subject: [PATCH 02/14] Add new SDK based on 2018-05-01-preview version. --- .../eventgrid/event_grid_management_client.py | 12 +-- .../mgmt/eventgrid/models/__init__.py | 22 +++++ .../models/dead_letter_destination.py | 43 ++++++++++ .../event_grid_management_client_enums.py | 15 ++++ .../eventgrid/models/event_subscription.py | 29 +++++-- .../models/event_subscription_destination.py | 6 +- .../models/event_subscription_paged.py | 2 +- .../event_subscription_update_parameters.py | 25 +++++- .../mgmt/eventgrid/models/event_type_paged.py | 2 +- ...nnection_event_subscription_destination.py | 38 +++++++++ .../eventgrid/models/input_schema_mapping.py | 42 ++++++++++ .../mgmt/eventgrid/models/json_field.py | 32 ++++++++ .../models/json_field_with_default.py | 39 +++++++++ .../models/json_input_schema_mapping.py | 66 +++++++++++++++ .../mgmt/eventgrid/models/operation.py | 2 +- .../mgmt/eventgrid/models/operation_paged.py | 2 +- .../mgmt/eventgrid/models/retry_policy.py | 34 ++++++++ .../storage_blob_dead_letter_destination.py | 42 ++++++++++ ...ge_queue_event_subscription_destination.py | 42 ++++++++++ .../mgmt/eventgrid/models/topic.py | 19 ++++- .../mgmt/eventgrid/models/topic_paged.py | 2 +- .../models/topic_regenerate_key_request.py | 2 +- .../mgmt/eventgrid/models/topic_type_info.py | 4 +- .../eventgrid/models/topic_type_info_paged.py | 2 +- .../event_subscriptions_operations.py | 81 +++++++++++-------- .../mgmt/eventgrid/operations/operations.py | 11 +-- .../operations/topic_types_operations.py | 21 ++--- .../eventgrid/operations/topics_operations.py | 68 ++++++++-------- .../azext_eventgrid/mgmt/eventgrid/version.py | 2 +- 29 files changed, 600 insertions(+), 107 deletions(-) create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/dead_letter_destination.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/input_schema_mapping.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/json_field.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/json_field_with_default.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/json_input_schema_mapping.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/retry_policy.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/storage_blob_dead_letter_destination.py create mode 100644 src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/storage_queue_event_subscription_destination.py diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/event_grid_management_client.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/event_grid_management_client.py index 93140dd19ff..ff647ec69be 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/event_grid_management_client.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/event_grid_management_client.py @@ -47,7 +47,7 @@ def __init__( super(EventGridManagementClientConfiguration, self).__init__(base_url) - self.add_user_agent('azure-mgmt-eventgrid/{}'.format(VERSION)) + self.add_user_agent('azext_eventgrid-mgmt-eventgrid/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials @@ -61,13 +61,13 @@ class EventGridManagementClient(object): :vartype config: EventGridManagementClientConfiguration :ivar event_subscriptions: EventSubscriptions operations - :vartype event_subscriptions: azure.mgmt.eventgrid.operations.EventSubscriptionsOperations + :vartype event_subscriptions: azext_eventgrid.mgmt.eventgrid.operations.EventSubscriptionsOperations :ivar operations: Operations operations - :vartype operations: azure.mgmt.eventgrid.operations.Operations + :vartype operations: azext_eventgrid.mgmt.eventgrid.operations.Operations :ivar topics: Topics operations - :vartype topics: azure.mgmt.eventgrid.operations.TopicsOperations + :vartype topics: azext_eventgrid.mgmt.eventgrid.operations.TopicsOperations :ivar topic_types: TopicTypes operations - :vartype topic_types: azure.mgmt.eventgrid.operations.TopicTypesOperations + :vartype topic_types: azext_eventgrid.mgmt.eventgrid.operations.TopicTypesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -86,7 +86,7 @@ def __init__( self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-01-01' + self.api_version = '2018-05-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/__init__.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/__init__.py index 5e5bd7c5520..6d5522b310b 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/__init__.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/__init__.py @@ -11,14 +11,23 @@ from .event_subscription_destination import EventSubscriptionDestination from .event_subscription_filter import EventSubscriptionFilter +from .retry_policy import RetryPolicy +from .dead_letter_destination import DeadLetterDestination from .resource import Resource +from .storage_blob_dead_letter_destination import StorageBlobDeadLetterDestination from .web_hook_event_subscription_destination import WebHookEventSubscriptionDestination from .event_hub_event_subscription_destination import EventHubEventSubscriptionDestination +from .storage_queue_event_subscription_destination import StorageQueueEventSubscriptionDestination +from .hybrid_connection_event_subscription_destination import HybridConnectionEventSubscriptionDestination from .event_subscription import EventSubscription from .event_subscription_update_parameters import EventSubscriptionUpdateParameters from .event_subscription_full_url import EventSubscriptionFullUrl from .operation_info import OperationInfo from .operation import Operation +from .input_schema_mapping import InputSchemaMapping +from .json_field import JsonField +from .json_field_with_default import JsonFieldWithDefault +from .json_input_schema_mapping import JsonInputSchemaMapping from .tracked_resource import TrackedResource from .topic import Topic from .topic_update_parameters import TopicUpdateParameters @@ -33,7 +42,9 @@ from .topic_type_info_paged import TopicTypeInfoPaged from .event_grid_management_client_enums import ( EventSubscriptionProvisioningState, + EventDeliverySchema, TopicProvisioningState, + InputSchema, ResourceRegionType, TopicTypeProvisioningState, ) @@ -41,14 +52,23 @@ __all__ = [ 'EventSubscriptionDestination', 'EventSubscriptionFilter', + 'RetryPolicy', + 'DeadLetterDestination', 'Resource', + 'StorageBlobDeadLetterDestination', 'WebHookEventSubscriptionDestination', 'EventHubEventSubscriptionDestination', + 'StorageQueueEventSubscriptionDestination', + 'HybridConnectionEventSubscriptionDestination', 'EventSubscription', 'EventSubscriptionUpdateParameters', 'EventSubscriptionFullUrl', 'OperationInfo', 'Operation', + 'InputSchemaMapping', + 'JsonField', + 'JsonFieldWithDefault', + 'JsonInputSchemaMapping', 'TrackedResource', 'Topic', 'TopicUpdateParameters', @@ -62,7 +82,9 @@ 'EventTypePaged', 'TopicTypeInfoPaged', 'EventSubscriptionProvisioningState', + 'EventDeliverySchema', 'TopicProvisioningState', + 'InputSchema', 'ResourceRegionType', 'TopicTypeProvisioningState', ] diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/dead_letter_destination.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/dead_letter_destination.py new file mode 100644 index 00000000000..99944ac2efc --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/dead_letter_destination.py @@ -0,0 +1,43 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeadLetterDestination(Model): + """Information about the dead letter destination for an event subscription. To + configure a deadletter destination, do not directly instantiate an object + of this class. Instead, instantiate an object of a derived class. + Currently, StorageBlobDeadLetterDestination is the only class that derives + from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StorageBlobDeadLetterDestination + + :param endpoint_type: Constant filled by server. + :type endpoint_type: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + } + + _subtype_map = { + 'endpoint_type': {'StorageBlob': 'StorageBlobDeadLetterDestination'} + } + + def __init__(self): + super(DeadLetterDestination, self).__init__() + self.endpoint_type = None diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_grid_management_client_enums.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_grid_management_client_enums.py index 63459ea3a5b..475673ac48f 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_grid_management_client_enums.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_grid_management_client_enums.py @@ -20,6 +20,14 @@ class EventSubscriptionProvisioningState(Enum): succeeded = "Succeeded" canceled = "Canceled" failed = "Failed" + awaiting_manual_action = "AwaitingManualAction" + + +class EventDeliverySchema(Enum): + + event_grid_schema = "EventGridSchema" + input_event_schema = "InputEventSchema" + cloud_event_v01_schema = "CloudEventV01Schema" class TopicProvisioningState(Enum): @@ -32,6 +40,13 @@ class TopicProvisioningState(Enum): failed = "Failed" +class InputSchema(Enum): + + event_grid_schema = "EventGridSchema" + custom_event_schema = "CustomEventSchema" + cloud_event_v01_schema = "CloudEventV01Schema" + + class ResourceRegionType(Enum): regional_resource = "RegionalResource" diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription.py index c4e7552b76b..a9e58d8b874 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription.py @@ -28,17 +28,30 @@ class EventSubscription(Resource): :vartype topic: str :ivar provisioning_state: Provisioning state of the event subscription. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' + 'Canceled', 'Failed', 'AwaitingManualAction' :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.EventSubscriptionProvisioningState + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionProvisioningState :param destination: Information about the destination where events have to be delivered for the event subscription. :type destination: - ~azure.mgmt.eventgrid.models.EventSubscriptionDestination + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionDestination :param filter: Information about the filter for the event subscription. - :type filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter + :type filter: + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionFilter :param labels: List of user defined labels. :type labels: list[str] + :param event_delivery_schema: The event delivery schema for the event + subscription. Possible values include: 'EventGridSchema', + 'InputEventSchema', 'CloudEventV01Schema' + :type event_delivery_schema: str or + ~azext_eventgrid.mgmt.eventgrid.models.EventDeliverySchema + :param retry_policy: The retry policy for events. This can be used to + configure maximum number of delivery attempts and time to live for events. + :type retry_policy: ~azext_eventgrid.mgmt.eventgrid.models.RetryPolicy + :param dead_letter_destination: The DeadLetter destination of the event + subscription. + :type dead_letter_destination: + ~azext_eventgrid.mgmt.eventgrid.models.DeadLetterDestination """ _validation = { @@ -58,12 +71,18 @@ class EventSubscription(Resource): 'destination': {'key': 'properties.destination', 'type': 'EventSubscriptionDestination'}, 'filter': {'key': 'properties.filter', 'type': 'EventSubscriptionFilter'}, 'labels': {'key': 'properties.labels', 'type': '[str]'}, + 'event_delivery_schema': {'key': 'properties.eventDeliverySchema', 'type': 'str'}, + 'retry_policy': {'key': 'properties.retryPolicy', 'type': 'RetryPolicy'}, + 'dead_letter_destination': {'key': 'properties.deadLetterDestination', 'type': 'DeadLetterDestination'}, } - def __init__(self, destination=None, filter=None, labels=None): + def __init__(self, destination=None, filter=None, labels=None, event_delivery_schema=None, retry_policy=None, dead_letter_destination=None): super(EventSubscription, self).__init__() self.topic = None self.provisioning_state = None self.destination = destination self.filter = filter self.labels = labels + self.event_delivery_schema = event_delivery_schema + self.retry_policy = retry_policy + self.dead_letter_destination = dead_letter_destination diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_destination.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_destination.py index 52a10f15367..39a84a8da20 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_destination.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_destination.py @@ -17,7 +17,9 @@ class EventSubscriptionDestination(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: WebHookEventSubscriptionDestination, - EventHubEventSubscriptionDestination + EventHubEventSubscriptionDestination, + StorageQueueEventSubscriptionDestination, + HybridConnectionEventSubscriptionDestination :param endpoint_type: Constant filled by server. :type endpoint_type: str @@ -32,7 +34,7 @@ class EventSubscriptionDestination(Model): } _subtype_map = { - 'endpoint_type': {'WebHook': 'WebHookEventSubscriptionDestination', 'EventHub': 'EventHubEventSubscriptionDestination'} + 'endpoint_type': {'WebHook': 'WebHookEventSubscriptionDestination', 'EventHub': 'EventHubEventSubscriptionDestination', 'StorageQueue': 'StorageQueueEventSubscriptionDestination', 'HybridConnection': 'HybridConnectionEventSubscriptionDestination'} } def __init__(self): diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_paged.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_paged.py index 4a4656c716b..1983ed5632b 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_paged.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_paged.py @@ -14,7 +14,7 @@ class EventSubscriptionPaged(Paged): """ - A paging container for iterating over a list of :class:`EventSubscription ` object + A paging container for iterating over a list of :class:`EventSubscription ` object """ _attribute_map = { diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_update_parameters.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_update_parameters.py index 88d04382399..125de89b8ad 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_update_parameters.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_update_parameters.py @@ -18,21 +18,40 @@ class EventSubscriptionUpdateParameters(Model): :param destination: Information about the destination where events have to be delivered for the event subscription. :type destination: - ~azure.mgmt.eventgrid.models.EventSubscriptionDestination + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionDestination :param filter: Information about the filter for the event subscription. - :type filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter + :type filter: + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionFilter :param labels: List of user defined labels. :type labels: list[str] + :param event_delivery_schema: The event delivery schema for the event + subscription. Possible values include: 'EventGridSchema', + 'InputEventSchema', 'CloudEventV01Schema' + :type event_delivery_schema: str or + ~azext_eventgrid.mgmt.eventgrid.models.EventDeliverySchema + :param retry_policy: The retry policy for events. This can be used to + configure maximum number of delivery attempts and time to live for events. + :type retry_policy: ~azext_eventgrid.mgmt.eventgrid.models.RetryPolicy + :param dead_letter_destination: The DeadLetter destination of the event + subscription. + :type dead_letter_destination: + ~azext_eventgrid.mgmt.eventgrid.models.DeadLetterDestination """ _attribute_map = { 'destination': {'key': 'destination', 'type': 'EventSubscriptionDestination'}, 'filter': {'key': 'filter', 'type': 'EventSubscriptionFilter'}, 'labels': {'key': 'labels', 'type': '[str]'}, + 'event_delivery_schema': {'key': 'eventDeliverySchema', 'type': 'str'}, + 'retry_policy': {'key': 'retryPolicy', 'type': 'RetryPolicy'}, + 'dead_letter_destination': {'key': 'deadLetterDestination', 'type': 'DeadLetterDestination'}, } - def __init__(self, destination=None, filter=None, labels=None): + def __init__(self, destination=None, filter=None, labels=None, event_delivery_schema=None, retry_policy=None, dead_letter_destination=None): super(EventSubscriptionUpdateParameters, self).__init__() self.destination = destination self.filter = filter self.labels = labels + self.event_delivery_schema = event_delivery_schema + self.retry_policy = retry_policy + self.dead_letter_destination = dead_letter_destination diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_type_paged.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_type_paged.py index 18fad1e1f3e..036a77fcaf9 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_type_paged.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_type_paged.py @@ -14,7 +14,7 @@ class EventTypePaged(Paged): """ - A paging container for iterating over a list of :class:`EventType ` object + A paging container for iterating over a list of :class:`EventType ` object """ _attribute_map = { diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination.py new file mode 100644 index 00000000000..5566ea813d2 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination.py @@ -0,0 +1,38 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .event_subscription_destination import EventSubscriptionDestination + + +class HybridConnectionEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the HybridConnection destination for an event + subscription. + + :param endpoint_type: Constant filled by server. + :type endpoint_type: str + :param resource_id: The Azure Resource ID of an hybrid connection that is + the destination of an event subscription. + :type resource_id: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + } + + def __init__(self, resource_id=None): + super(HybridConnectionEventSubscriptionDestination, self).__init__() + self.resource_id = resource_id + self.endpoint_type = 'HybridConnection' diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/input_schema_mapping.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/input_schema_mapping.py new file mode 100644 index 00000000000..78ded4a27f0 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/input_schema_mapping.py @@ -0,0 +1,42 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InputSchemaMapping(Model): + """By default, Event Grid expects events to be in the Event Grid event schema. + Specifying an input schema mapping enables publishing to Event Grid using a + custom input schema. Currently, the only supported type of + InputSchemaMapping is 'JsonInputSchemaMapping'. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: JsonInputSchemaMapping + + :param input_schema_mapping_type: Constant filled by server. + :type input_schema_mapping_type: str + """ + + _validation = { + 'input_schema_mapping_type': {'required': True}, + } + + _attribute_map = { + 'input_schema_mapping_type': {'key': 'inputSchemaMappingType', 'type': 'str'}, + } + + _subtype_map = { + 'input_schema_mapping_type': {'Json': 'JsonInputSchemaMapping'} + } + + def __init__(self): + super(InputSchemaMapping, self).__init__() + self.input_schema_mapping_type = None diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/json_field.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/json_field.py new file mode 100644 index 00000000000..ff641d4cf70 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/json_field.py @@ -0,0 +1,32 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JsonField(Model): + """This is used to express the source of an input schema mapping for a single + target field in the Event Grid Event schema. This is currently used in the + mappings for the 'id','topic' and 'eventtime' properties. This represents a + field in the input event schema. + + :param source_field: Name of a field in the input event schema that's to + be used as the source of a mapping. + :type source_field: str + """ + + _attribute_map = { + 'source_field': {'key': 'sourceField', 'type': 'str'}, + } + + def __init__(self, source_field=None): + super(JsonField, self).__init__() + self.source_field = source_field diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/json_field_with_default.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/json_field_with_default.py new file mode 100644 index 00000000000..7fffa752c61 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/json_field_with_default.py @@ -0,0 +1,39 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JsonFieldWithDefault(Model): + """This is used to express the source of an input schema mapping for a single + target field in the Event Grid Event schema. This is currently used in the + mappings for the 'subject','eventtype' and 'dataversion' properties. This + represents a field in the input event schema along with a default value to + be used, and at least one of these two properties should be provided. + + :param source_field: Name of a field in the input event schema that's to + be used as the source of a mapping. + :type source_field: str + :param default_value: The default value to be used for mapping when a + SourceField is not provided or if there's no property with the specified + name in the published JSON event payload. + :type default_value: str + """ + + _attribute_map = { + 'source_field': {'key': 'sourceField', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__(self, source_field=None, default_value=None): + super(JsonFieldWithDefault, self).__init__() + self.source_field = source_field + self.default_value = default_value diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/json_input_schema_mapping.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/json_input_schema_mapping.py new file mode 100644 index 00000000000..b1f4f9d4f61 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/json_input_schema_mapping.py @@ -0,0 +1,66 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .input_schema_mapping import InputSchemaMapping + + +class JsonInputSchemaMapping(InputSchemaMapping): + """This enables publishing to Event Grid using a custom input schema. This can + be used to map properties from a custom input JSON schema to the Event Grid + event schema. + + :param input_schema_mapping_type: Constant filled by server. + :type input_schema_mapping_type: str + :param id: The mapping information for the Id property of the Event Grid + Event. + :type id: ~azext_eventgrid.mgmt.eventgrid.models.JsonField + :param topic: The mapping information for the Topic property of the Event + Grid Event. + :type topic: ~azext_eventgrid.mgmt.eventgrid.models.JsonField + :param event_time: The mapping information for the EventTime property of + the Event Grid Event. + :type event_time: ~azext_eventgrid.mgmt.eventgrid.models.JsonField + :param event_type: The mapping information for the EventType property of + the Event Grid Event. + :type event_type: + ~azext_eventgrid.mgmt.eventgrid.models.JsonFieldWithDefault + :param subject: The mapping information for the Subject property of the + Event Grid Event. + :type subject: ~azext_eventgrid.mgmt.eventgrid.models.JsonFieldWithDefault + :param data_version: The mapping information for the DataVersion property + of the Event Grid Event. + :type data_version: + ~azext_eventgrid.mgmt.eventgrid.models.JsonFieldWithDefault + """ + + _validation = { + 'input_schema_mapping_type': {'required': True}, + } + + _attribute_map = { + 'input_schema_mapping_type': {'key': 'inputSchemaMappingType', 'type': 'str'}, + 'id': {'key': 'properties.id', 'type': 'JsonField'}, + 'topic': {'key': 'properties.topic', 'type': 'JsonField'}, + 'event_time': {'key': 'properties.eventTime', 'type': 'JsonField'}, + 'event_type': {'key': 'properties.eventType', 'type': 'JsonFieldWithDefault'}, + 'subject': {'key': 'properties.subject', 'type': 'JsonFieldWithDefault'}, + 'data_version': {'key': 'properties.dataVersion', 'type': 'JsonFieldWithDefault'}, + } + + def __init__(self, id=None, topic=None, event_time=None, event_type=None, subject=None, data_version=None): + super(JsonInputSchemaMapping, self).__init__() + self.id = id + self.topic = topic + self.event_time = event_time + self.event_type = event_type + self.subject = subject + self.data_version = data_version + self.input_schema_mapping_type = 'Json' diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation.py index 85f9c40b7b3..81a1e88fe6e 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation.py @@ -18,7 +18,7 @@ class Operation(Model): :param name: Name of the operation :type name: str :param display: Display name of the operation - :type display: ~azure.mgmt.eventgrid.models.OperationInfo + :type display: ~azext_eventgrid.mgmt.eventgrid.models.OperationInfo :param origin: Origin of the operation :type origin: str :param properties: Properties of the operation diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation_paged.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation_paged.py index 097349fa5db..b1301775390 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation_paged.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/operation_paged.py @@ -14,7 +14,7 @@ class OperationPaged(Paged): """ - A paging container for iterating over a list of :class:`Operation ` object + A paging container for iterating over a list of :class:`Operation ` object """ _attribute_map = { diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/retry_policy.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/retry_policy.py new file mode 100644 index 00000000000..fe39559da34 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/retry_policy.py @@ -0,0 +1,34 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RetryPolicy(Model): + """Information about the retry policy for an event subscription. + + :param max_delivery_attempts: Maximum number of delivery retry attempts + for events. + :type max_delivery_attempts: int + :param event_time_to_live_in_minutes: Time To Live (in minutes) for + events. + :type event_time_to_live_in_minutes: int + """ + + _attribute_map = { + 'max_delivery_attempts': {'key': 'maxDeliveryAttempts', 'type': 'int'}, + 'event_time_to_live_in_minutes': {'key': 'eventTimeToLiveInMinutes', 'type': 'int'}, + } + + def __init__(self, max_delivery_attempts=None, event_time_to_live_in_minutes=None): + super(RetryPolicy, self).__init__() + self.max_delivery_attempts = max_delivery_attempts + self.event_time_to_live_in_minutes = event_time_to_live_in_minutes diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/storage_blob_dead_letter_destination.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/storage_blob_dead_letter_destination.py new file mode 100644 index 00000000000..14fe0d283a0 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/storage_blob_dead_letter_destination.py @@ -0,0 +1,42 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .dead_letter_destination import DeadLetterDestination + + +class StorageBlobDeadLetterDestination(DeadLetterDestination): + """Information about the storage blob based dead letter destination. + + :param endpoint_type: Constant filled by server. + :type endpoint_type: str + :param resource_id: The Azure Resource ID of the storage account that is + the destination of the deadletter events + :type resource_id: str + :param blob_container_name: The name of the Storage blob container that is + the destination of the deadletter events + :type blob_container_name: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'blob_container_name': {'key': 'properties.blobContainerName', 'type': 'str'}, + } + + def __init__(self, resource_id=None, blob_container_name=None): + super(StorageBlobDeadLetterDestination, self).__init__() + self.resource_id = resource_id + self.blob_container_name = blob_container_name + self.endpoint_type = 'StorageBlob' diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/storage_queue_event_subscription_destination.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/storage_queue_event_subscription_destination.py new file mode 100644 index 00000000000..5f5dcb3eb3e --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/storage_queue_event_subscription_destination.py @@ -0,0 +1,42 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .event_subscription_destination import EventSubscriptionDestination + + +class StorageQueueEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the storage queue destination for an event subscription. + + :param endpoint_type: Constant filled by server. + :type endpoint_type: str + :param resource_id: The Azure Resource ID of the storage account that + contains the queue that is the destination of an event subscription. + :type resource_id: str + :param queue_name: The name of the Storage queue under a storage account + that is the destination of an event subscription. + :type queue_name: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'queue_name': {'key': 'properties.queueName', 'type': 'str'}, + } + + def __init__(self, resource_id=None, queue_name=None): + super(StorageQueueEventSubscriptionDestination, self).__init__() + self.resource_id = resource_id + self.queue_name = queue_name + self.endpoint_type = 'StorageQueue' diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic.py index d70dc4d6eac..d3969752e79 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic.py @@ -32,9 +32,20 @@ class Topic(TrackedResource): include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed' :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.TopicProvisioningState + ~azext_eventgrid.mgmt.eventgrid.models.TopicProvisioningState :ivar endpoint: Endpoint for the topic. :vartype endpoint: str + :param input_schema: This determines the format that Event Grid should + expect for incoming events published to the topic. Possible values + include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema' + :type input_schema: str or + ~azext_eventgrid.mgmt.eventgrid.models.InputSchema + :param input_schema_mapping: This enables publishing using custom event + schemas. An InputSchemaMapping can be specified to map various properties + of a source schema to various required properties of the EventGridEvent + schema. + :type input_schema_mapping: + ~azext_eventgrid.mgmt.eventgrid.models.InputSchemaMapping """ _validation = { @@ -54,9 +65,13 @@ class Topic(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + 'input_schema': {'key': 'properties.inputSchema', 'type': 'str'}, + 'input_schema_mapping': {'key': 'properties.inputSchemaMapping', 'type': 'InputSchemaMapping'}, } - def __init__(self, location, tags=None): + def __init__(self, location, tags=None, input_schema=None, input_schema_mapping=None): super(Topic, self).__init__(location=location, tags=tags) self.provisioning_state = None self.endpoint = None + self.input_schema = input_schema + self.input_schema_mapping = input_schema_mapping diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_paged.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_paged.py index ff520ebd8f2..0b5bf2a7071 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_paged.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_paged.py @@ -14,7 +14,7 @@ class TopicPaged(Paged): """ - A paging container for iterating over a list of :class:`Topic ` object + A paging container for iterating over a list of :class:`Topic ` object """ _attribute_map = { diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_regenerate_key_request.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_regenerate_key_request.py index f02219905a1..4941af002f3 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_regenerate_key_request.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_regenerate_key_request.py @@ -13,7 +13,7 @@ class TopicRegenerateKeyRequest(Model): - """Topic regenerate share access key key request. + """Topic regenerate share access key request. :param key_name: Key name to regenerate key1 or key2 :type key_name: str diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info.py index d665793898e..2c26f9b0103 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info.py @@ -33,12 +33,12 @@ class TopicTypeInfo(Resource): :param resource_region_type: Region type of the resource. Possible values include: 'RegionalResource', 'GlobalResource' :type resource_region_type: str or - ~azure.mgmt.eventgrid.models.ResourceRegionType + ~azext_eventgrid.mgmt.eventgrid.models.ResourceRegionType :param provisioning_state: Provisioning state of the topic type. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed' :type provisioning_state: str or - ~azure.mgmt.eventgrid.models.TopicTypeProvisioningState + ~azext_eventgrid.mgmt.eventgrid.models.TopicTypeProvisioningState :param supported_locations: List of locations supported by this topic type. :type supported_locations: list[str] diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info_paged.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info_paged.py index e66d5826938..9da12fc0048 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info_paged.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic_type_info_paged.py @@ -14,7 +14,7 @@ class TopicTypeInfoPaged(Paged): """ - A paging container for iterating over a list of :class:`TopicTypeInfo ` object + A paging container for iterating over a list of :class:`TopicTypeInfo ` object """ _attribute_map = { diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/event_subscriptions_operations.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/event_subscriptions_operations.py index 74e08405b33..021e2d47943 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/event_subscriptions_operations.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/event_subscriptions_operations.py @@ -24,8 +24,8 @@ class EventSubscriptionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-05-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-01" + self.api_version = "2018-05-01-preview" self.config = config @@ -64,12 +64,12 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: EventSubscription or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.EventSubscription or + :rtype: ~azext_eventgrid.mgmt.eventgrid.models.EventSubscription or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + url = self.get.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') @@ -109,12 +109,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'} def _create_or_update_initial( self, scope, event_subscription_name, event_subscription_info, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') @@ -185,14 +186,14 @@ def create_or_update( :param event_subscription_info: Event subscription properties containing the destination and filter information :type event_subscription_info: - ~azure.mgmt.eventgrid.models.EventSubscription + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscription :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :return: An instance of AzureOperationPoller that returns EventSubscription or ClientRawResponse if raw=true :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.EventSubscription] + ~msrestazure.azure_operation.AzureOperationPoller[~azext_eventgrid.mgmt.eventgrid.models.EventSubscription] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -242,12 +243,13 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'} def _delete_initial( self, scope, event_subscription_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') @@ -350,12 +352,13 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + delete.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'} def _update_initial( self, scope, event_subscription_name, event_subscription_update_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + url = self.update.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') @@ -418,19 +421,19 @@ def update( for an EventGrid topic. :type scope: str :param event_subscription_name: Name of the event subscription to be - created + updated :type event_subscription_name: str :param event_subscription_update_parameters: Updated event subscription information :type event_subscription_update_parameters: - ~azure.mgmt.eventgrid.models.EventSubscriptionUpdateParameters + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionUpdateParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :return: An instance of AzureOperationPoller that returns EventSubscription or ClientRawResponse if raw=true :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.EventSubscription] + ~msrestazure.azure_operation.AzureOperationPoller[~azext_eventgrid.mgmt.eventgrid.models.EventSubscription] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -480,6 +483,7 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + update.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'} def get_full_url( self, scope, event_subscription_name, custom_headers=None, raw=False, **operation_config): @@ -506,12 +510,13 @@ def get_full_url( :param operation_config: :ref:`Operation configuration overrides`. :return: EventSubscriptionFullUrl or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.EventSubscriptionFullUrl or + :rtype: + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionFullUrl or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl' + url = self.get_full_url.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') @@ -551,6 +556,7 @@ def get_full_url( return client_raw_response return deserialized + get_full_url.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl'} def list_global_by_subscription( self, custom_headers=None, raw=False, **operation_config): @@ -567,14 +573,14 @@ def list_global_by_subscription( overrides`. :return: An iterator like instance of EventSubscription :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionPaged[~azext_eventgrid.mgmt.eventgrid.models.EventSubscription] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions' + url = self.list_global_by_subscription.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -619,6 +625,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_global_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions'} def list_global_by_subscription_for_topic_type( self, topic_type_name, custom_headers=None, raw=False, **operation_config): @@ -636,14 +643,14 @@ def list_global_by_subscription_for_topic_type( overrides`. :return: An iterator like instance of EventSubscription :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionPaged[~azext_eventgrid.mgmt.eventgrid.models.EventSubscription] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions' + url = self.list_global_by_subscription_for_topic_type.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') @@ -689,6 +696,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_global_by_subscription_for_topic_type.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions'} def list_global_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -708,14 +716,14 @@ def list_global_by_resource_group( overrides`. :return: An iterator like instance of EventSubscription :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionPaged[~azext_eventgrid.mgmt.eventgrid.models.EventSubscription] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions' + url = self.list_global_by_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') @@ -761,6 +769,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_global_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions'} def list_global_by_resource_group_for_topic_type( self, resource_group_name, topic_type_name, custom_headers=None, raw=False, **operation_config): @@ -782,14 +791,14 @@ def list_global_by_resource_group_for_topic_type( overrides`. :return: An iterator like instance of EventSubscription :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionPaged[~azext_eventgrid.mgmt.eventgrid.models.EventSubscription] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions' + url = self.list_global_by_resource_group_for_topic_type.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -836,6 +845,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_global_by_resource_group_for_topic_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions'} def list_regional_by_subscription( self, location, custom_headers=None, raw=False, **operation_config): @@ -853,14 +863,14 @@ def list_regional_by_subscription( overrides`. :return: An iterator like instance of EventSubscription :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionPaged[~azext_eventgrid.mgmt.eventgrid.models.EventSubscription] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions' + url = self.list_regional_by_subscription.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'location': self._serialize.url("location", location, 'str') @@ -906,6 +916,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_regional_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions'} def list_regional_by_resource_group( self, resource_group_name, location, custom_headers=None, raw=False, **operation_config): @@ -927,14 +938,14 @@ def list_regional_by_resource_group( overrides`. :return: An iterator like instance of EventSubscription :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionPaged[~azext_eventgrid.mgmt.eventgrid.models.EventSubscription] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions' + url = self.list_regional_by_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -981,6 +992,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_regional_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions'} def list_regional_by_subscription_for_topic_type( self, location, topic_type_name, custom_headers=None, raw=False, **operation_config): @@ -1001,14 +1013,14 @@ def list_regional_by_subscription_for_topic_type( overrides`. :return: An iterator like instance of EventSubscription :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionPaged[~azext_eventgrid.mgmt.eventgrid.models.EventSubscription] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions' + url = self.list_regional_by_subscription_for_topic_type.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'location': self._serialize.url("location", location, 'str'), @@ -1055,6 +1067,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_regional_by_subscription_for_topic_type.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions'} def list_regional_by_resource_group_for_topic_type( self, resource_group_name, location, topic_type_name, custom_headers=None, raw=False, **operation_config): @@ -1078,14 +1091,14 @@ def list_regional_by_resource_group_for_topic_type( overrides`. :return: An iterator like instance of EventSubscription :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionPaged[~azext_eventgrid.mgmt.eventgrid.models.EventSubscription] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions' + url = self.list_regional_by_resource_group_for_topic_type.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -1133,6 +1146,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_regional_by_resource_group_for_topic_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions'} def list_by_resource( self, resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers=None, raw=False, **operation_config): @@ -1157,14 +1171,14 @@ def list_by_resource( overrides`. :return: An iterator like instance of EventSubscription :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionPaged[~azext_eventgrid.mgmt.eventgrid.models.EventSubscription] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions' + url = self.list_by_resource.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -1213,3 +1227,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions'} diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/operations.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/operations.py index ab97c65dfad..2ef36b9c994 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/operations.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/operations.py @@ -22,8 +22,8 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-05-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-01" + self.api_version = "2018-05-01-preview" self.config = config @@ -51,14 +51,14 @@ def list( overrides`. :return: An iterator like instance of Operation :rtype: - ~azure.mgmt.eventgrid.models.OperationPaged[~azure.mgmt.eventgrid.models.Operation] + ~azext_eventgrid.mgmt.eventgrid.models.OperationPaged[~azext_eventgrid.mgmt.eventgrid.models.Operation] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.EventGrid/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -99,3 +99,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.EventGrid/operations'} diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topic_types_operations.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topic_types_operations.py index 3eceb2d0989..d3cb9a3e3ed 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topic_types_operations.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topic_types_operations.py @@ -22,8 +22,8 @@ class TopicTypesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-05-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-01" + self.api_version = "2018-05-01-preview" self.config = config @@ -50,14 +50,14 @@ def list( overrides`. :return: An iterator like instance of TopicTypeInfo :rtype: - ~azure.mgmt.eventgrid.models.TopicTypeInfoPaged[~azure.mgmt.eventgrid.models.TopicTypeInfo] + ~azext_eventgrid.mgmt.eventgrid.models.TopicTypeInfoPaged[~azext_eventgrid.mgmt.eventgrid.models.TopicTypeInfo] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.EventGrid/topicTypes' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -98,6 +98,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.EventGrid/topicTypes'} def get( self, topic_type_name, custom_headers=None, raw=False, **operation_config): @@ -113,12 +114,12 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: TopicTypeInfo or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.TopicTypeInfo or + :rtype: ~azext_eventgrid.mgmt.eventgrid.models.TopicTypeInfo or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}' + url = self.get.metadata['url'] path_format_arguments = { 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') } @@ -157,6 +158,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}'} def list_event_types( self, topic_type_name, custom_headers=None, raw=False, **operation_config): @@ -173,14 +175,14 @@ def list_event_types( overrides`. :return: An iterator like instance of EventType :rtype: - ~azure.mgmt.eventgrid.models.EventTypePaged[~azure.mgmt.eventgrid.models.EventType] + ~azext_eventgrid.mgmt.eventgrid.models.EventTypePaged[~azext_eventgrid.mgmt.eventgrid.models.EventType] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes' + url = self.list_event_types.metadata['url'] path_format_arguments = { 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') } @@ -225,3 +227,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_event_types.metadata = {'url': '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes'} diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topics_operations.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topics_operations.py index 06b6ee9677d..ea2c70c9fc8 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topics_operations.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topics_operations.py @@ -24,8 +24,8 @@ class TopicsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-05-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-01" + self.api_version = "2018-05-01-preview" self.config = config @@ -56,12 +56,12 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: Topic or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.Topic or + :rtype: ~azext_eventgrid.mgmt.eventgrid.models.Topic or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -102,14 +102,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} def _create_or_update_initial( - self, resource_group_name, topic_name, location, tags=None, custom_headers=None, raw=False, **operation_config): - topic_info = models.Topic(location=location, tags=tags) - + self, resource_group_name, topic_name, topic_info, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -156,7 +155,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, topic_name, location, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, topic_name, topic_info, custom_headers=None, raw=False, **operation_config): """Create a topic. Asynchronously creates a new topic with the specified parameters. @@ -166,25 +165,22 @@ def create_or_update( :type resource_group_name: str :param topic_name: Name of the topic :type topic_name: str - :param location: Location of the resource - :type location: str - :param tags: Tags of the resource - :type tags: dict[str, str] + :param topic_info: Topic information + :type topic_info: ~azext_eventgrid.mgmt.eventgrid.models.Topic :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :return: An instance of AzureOperationPoller that returns Topic or ClientRawResponse if raw=true :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.Topic] + ~msrestazure.azure_operation.AzureOperationPoller[~azext_eventgrid.mgmt.eventgrid.models.Topic] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, topic_name=topic_name, - location=location, - tags=tags, + topic_info=topic_info, custom_headers=custom_headers, raw=True, **operation_config @@ -227,12 +223,13 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} def _delete_initial( self, resource_group_name, topic_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -328,6 +325,7 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} def _update_initial( @@ -335,7 +333,7 @@ def _update_initial( topic_update_parameters = models.TopicUpdateParameters(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -400,7 +398,7 @@ def update( :return: An instance of AzureOperationPoller that returns Topic or ClientRawResponse if raw=true :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.Topic] + ~msrestazure.azure_operation.AzureOperationPoller[~azext_eventgrid.mgmt.eventgrid.models.Topic] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -450,6 +448,7 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} def list_by_subscription( self, custom_headers=None, raw=False, **operation_config): @@ -464,14 +463,14 @@ def list_by_subscription( overrides`. :return: An iterator like instance of Topic :rtype: - ~azure.mgmt.eventgrid.models.TopicPaged[~azure.mgmt.eventgrid.models.Topic] + ~azext_eventgrid.mgmt.eventgrid.models.TopicPaged[~azext_eventgrid.mgmt.eventgrid.models.Topic] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics' + url = self.list_by_subscription.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -516,6 +515,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -533,14 +533,14 @@ def list_by_resource_group( overrides`. :return: An iterator like instance of Topic :rtype: - ~azure.mgmt.eventgrid.models.TopicPaged[~azure.mgmt.eventgrid.models.Topic] + ~azext_eventgrid.mgmt.eventgrid.models.TopicPaged[~azext_eventgrid.mgmt.eventgrid.models.Topic] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') @@ -586,6 +586,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics'} def list_shared_access_keys( self, resource_group_name, topic_name, custom_headers=None, raw=False, **operation_config): @@ -604,12 +605,12 @@ def list_shared_access_keys( :param operation_config: :ref:`Operation configuration overrides`. :return: TopicSharedAccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.TopicSharedAccessKeys or - ~msrest.pipeline.ClientRawResponse + :rtype: ~azext_eventgrid.mgmt.eventgrid.models.TopicSharedAccessKeys + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys' + url = self.list_shared_access_keys.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -650,6 +651,7 @@ def list_shared_access_keys( return client_raw_response return deserialized + list_shared_access_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys'} def regenerate_key( self, resource_group_name, topic_name, key_name, custom_headers=None, raw=False, **operation_config): @@ -670,14 +672,14 @@ def regenerate_key( :param operation_config: :ref:`Operation configuration overrides`. :return: TopicSharedAccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.TopicSharedAccessKeys or - ~msrest.pipeline.ClientRawResponse + :rtype: ~azext_eventgrid.mgmt.eventgrid.models.TopicSharedAccessKeys + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ regenerate_key_request = models.TopicRegenerateKeyRequest(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -722,6 +724,7 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey'} def list_event_types( self, resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers=None, raw=False, **operation_config): @@ -745,14 +748,14 @@ def list_event_types( overrides`. :return: An iterator like instance of EventType :rtype: - ~azure.mgmt.eventgrid.models.EventTypePaged[~azure.mgmt.eventgrid.models.EventType] + ~azext_eventgrid.mgmt.eventgrid.models.EventTypePaged[~azext_eventgrid.mgmt.eventgrid.models.EventType] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes' + url = self.list_event_types.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -801,3 +804,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_event_types.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes'} diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py index 85da2c00c1a..7921c843fb5 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.4.0" +VERSION = "2018-05-01-preview" From c3244ebb988c11e172ed76f969202b653d6de99a Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Thu, 19 Apr 2018 11:56:06 -0700 Subject: [PATCH 03/14] CLI changes for EventGrid 2018-05-01-preview version. --- src/eventgrid/azext_eventgrid/_params.py | 11 +- src/eventgrid/azext_eventgrid/commands.py | 8 +- src/eventgrid/azext_eventgrid/custom.py | 125 +++++++++++++++++++++- 3 files changed, 138 insertions(+), 6 deletions(-) diff --git a/src/eventgrid/azext_eventgrid/_params.py b/src/eventgrid/azext_eventgrid/_params.py index e77608e5f28..bdb4a731e78 100644 --- a/src/eventgrid/azext_eventgrid/_params.py +++ b/src/eventgrid/azext_eventgrid/_params.py @@ -35,9 +35,9 @@ def load_arguments(self, _): 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('endpoint_type', arg_type=get_enum_type(['webhook', 'eventhub', 'storagequeue', 'hybridconnection'], 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('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.") 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.") @@ -46,10 +46,17 @@ def load_arguments(self, _): 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('input_mapping_fields', arg_type=tags_type, help="This must be specified only when input_schema is customeventschema. This is used for specifying input mappings based on field names. Space separated values in 'key=value' format. Allowed key names are 'id', 'topic', 'eventtime', 'subject', 'eventtype', 'dataversion'.") + c.argument('input_mapping_default_values', arg_type=tags_type, help="This must be specified only when input_schema is customeventschema. This is used for specifying input mappings based on field names. Space separated tags in 'key=value' format. Allowed key names are 'subject', 'eventtype', 'dataversion'.") + c.argument('input_schema', arg_type=get_enum_type(['eventgridschema', 'customeventschema', 'cloudeventv01schema'], default='eventgridschema'), help='Schema in which incoming events will be published for this topic. If customeventschema is specified, either input_mapping_default_values or input_mapping_fields must be specified as well.') 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') + c.argument('event_delivery_schema', arg_type=get_enum_type(['eventgridschema', 'inputeventschema', 'cloudeventv01schema'], default='eventgridschema'), help='Schema in which events should be delivered for this 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="Endpoint where EventGrid should deliver events that cannot be delivered for this 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')) diff --git a/src/eventgrid/azext_eventgrid/commands.py b/src/eventgrid/azext_eventgrid/commands.py index eea0dc336df..cf42e0ac178 100644 --- a/src/eventgrid/azext_eventgrid/commands.py +++ b/src/eventgrid/azext_eventgrid/commands.py @@ -12,21 +12,23 @@ def load_command_table(self, _): topics_mgmt_util = CliCommandType( operations_tmpl='azext_eventgrid.mgmt.eventgrid.operations.topics_operations#TopicsOperations.{}', - client_factory=topics_factory + client_factory=topics_factory, + client_arg_name='self' ) topic_type_mgmt_util = CliCommandType( operations_tmpl='azext_eventgrid.mgmt.eventgrid.operations.topic_types_operations#TopicTypesOperations.{}', - client_factory=topic_types_factory + client_factory=topic_types_factory, + client_arg_name='self' ) 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.custom_command('create', 'cli_topic_create_or_update') g.generic_update_command('update', getter_name='get', setter_name='update', diff --git a/src/eventgrid/azext_eventgrid/custom.py b/src/eventgrid/azext_eventgrid/custom.py index 4b53931eebc..5e49dcd8321 100644 --- a/src/eventgrid/azext_eventgrid/custom.py +++ b/src/eventgrid/azext_eventgrid/custom.py @@ -4,6 +4,7 @@ # -------------------------------------------------------------------------------------------- from six.moves.urllib.parse import quote # pylint: disable=import-error +import re from knack.log import get_logger from knack.util import CLIError from msrestazure.tools import parse_resource_id @@ -13,7 +14,15 @@ EventSubscription, EventSubscriptionUpdateParameters, WebHookEventSubscriptionDestination, + Topic, + JsonInputSchemaMapping, + JsonField, + JsonFieldWithDefault, + RetryPolicy, EventHubEventSubscriptionDestination, + StorageQueueEventSubscriptionDestination, + HybridConnectionEventSubscriptionDestination, + StorageBlobDeadLetterDestination, EventSubscriptionFilter) logger = get_logger(__name__) @@ -25,6 +34,11 @@ EVENTGRID_TOPICS = "topics" WEBHOOK_DESTINATION = "webhook" EVENTHUB_DESTINATION = "eventhub" +STORAGEQUEUE_DESTINATION = "storagequeue" +HYBRIDCONNECTION_DESTINATION = "hybridconnection" +EVENTGRID_SCHEMA = "eventgridschema" +CUSTOM_SCHEMA = "customeventschema" +CLOUDEVENTV01_SCHEMA = "cloudeventv01schema" def cli_topic_list( @@ -36,6 +50,39 @@ def cli_topic_list( return client.list_by_subscription() +def cli_topic_create_or_update( + client, + resource_group_name, + topic_name, + location, + tags=None, + input_schema=EVENTGRID_SCHEMA, + input_mapping_fields=None, + input_mapping_default_values=None): + if input_schema is EVENTGRID_SCHEMA or input_schema is CLOUDEVENTV01_SCHEMA: + # Ensure that custom input mappings are not specified + if input_mapping_fields is not None or input_mapping_default_values is not None: + raise CLIError('input_mapping_default_values and input_mapping_fields are applicable only when input_schema is set to customeventschema.') + + if input_schema is CUSTOM_SCHEMA: + # Ensure that custom input mappings are specified + if input_mapping_fields is not None and input_mapping_default_values is not None: + raise CLIError('Either input_mapping_default_values or input_mapping_fields must be specified when input_schema is set to customeventschema.') + + input_schema_mapping = get_input_schema_mapping( + input_mapping_fields, + input_mapping_default_values) + + topic_info = Topic(location, tags, input_schema, input_schema_mapping) + + async_topic_create = client.create_or_update( + resource_group_name, + topic_name, + topic_info) + created_topic = async_topic_create.result() + return created_topic + + def cli_eventgrid_event_subscription_create( cmd, client, @@ -49,6 +96,10 @@ def cli_eventgrid_event_subscription_create( subject_begins_with=None, subject_ends_with=None, is_subject_case_sensitive=False, + max_delivery_attempts=30, + event_ttl=1440, + event_delivery_schema=EVENTGRID_SCHEMA, + deadletter_endpoint=None, labels=None): scope = _get_scope_for_event_subscription(cmd.cli_ctx, resource_id, topic_name, resource_group_name) @@ -56,13 +107,43 @@ def cli_eventgrid_event_subscription_create( destination = WebHookEventSubscriptionDestination(endpoint) elif endpoint_type.lower() == EVENTHUB_DESTINATION.lower(): destination = EventHubEventSubscriptionDestination(endpoint) + elif endpoint_type.lower() == HYBRIDCONNECTION_DESTINATION.lower(): + destination = HybridConnectionEventSubscriptionDestination(endpoint) + elif endpoint_type.lower() == STORAGEQUEUE_DESTINATION.lower(): + # Supplied endpoint would be in the format /subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/sa1/queueServices/default/queues/{queueName})) + # and we need to break it up into /subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/sa1 and queueName + storage_queue_items = re.split( + "/queueServices/default/queues/", endpoint, flags=re.IGNORECASE) + + if len(storage_queue_items) != 2 or storage_queue_items[0] is None or storage_queue_items[1] is None: + raise CLIError("Argument Error: Expected format of Storage queue endpoint is: /subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/sa1/queueServices/default/queues/queueName") + + destination = StorageQueueEventSubscriptionDestination( + storage_queue_items[0], storage_queue_items[1]) 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) + + retry_policy = RetryPolicy(max_delivery_attempts, event_ttl) + + if deadlettter_endpoint is not None: + storage_blob_items = re.split( + "/blobServices/default/containers/", endpoint, flags=re.IGNORECASE) + + if len(storage_blob_items) != 2 or storage_blob_items[0] is None or storage_blob_items[1] is None: + raise CLIError("Argument Error: Expected format of deadletter destination is: /subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/containerName") + + deadletter_destination = StorageBlobDeadLetterDestination( + storage_blob_items[0], storage_blob_items[1]) + + event_subscription_info = EventSubscription( + destination, event_subscription_filter, labels, event_delivery_schema, retry_policy, deadletter_destination) + + if endpoint_type.lower() == WEBHOOK_DESTINATION.lower() and "azure" not in endpoint and "hookbin" not in endpoint: + print("If the endpoint doesn't support subscription validation response, please visit the validation URL manually to complete the validation handshake.") async_event_subscription_create = client.create_or_update( scope, @@ -251,6 +332,48 @@ def event_subscription_getter( return retrieved_event_subscription +def get_input_schema_mapping( + input_mapping_fields=None, + input_mapping_default_values=None): + input_schema_mapping = None + + if input_mapping_fields is not None or input_mapping_default_values is not None: + input_schema_mapping = JsonInputSchemaMapping() + + input_schema_mapping.id = JsonField() + input_schema_mapping.topic = JsonField() + input_schema_mapping.event_time = JsonField() + input_schema_mapping.subject = JsonFieldWithDefault() + input_schema_mapping.event_type = JsonFieldWithDefault() + input_schema_mapping.data_version = JsonFieldWithDefault() + + for key_value_pair in input_mapping_fields: + split_key_value_pairs = key_value_pair.split("=") + if split_key_value_pairs[0].lower() == "id": + input_schema_mapping.id.source_field = split_key_value_pairs[1] + elif split_key_value_pairs[0].lower() == "eventtime": + input_schema_mapping.event_time.source_field = split_key_value_pairs[1] + elif split_key_value_pairs[0].lower() == "topic": + input_schema_mapping.topic.source_field = split_key_value_pairs[1] + elif split_key_value_pairs[0].lower() == "subject": + input_schema_mapping.subject.source_field = split_key_value_pairs[1] + elif split_key_value_pairs[0].lower() == "dataversion": + input_schema_mapping.data_version.source_field = split_key_value_pairs[1] + elif split_key_value_pairs[0].lower() == "eventtype": + input_schema_mapping.event_type.source_field = split_key_value_pairs[1] + + for key_value_pair2 in input_mapping_default_values: + split_key_value_pairs2 = key_value_pair2.split("=") + if split_key_value_pairs2[0].lower() == "subject": + input_schema_mapping.subject.default_value = split_key_value_pairs2[1] + elif split_key_value_pairs2[0].lower() == "dataversion": + input_schema_mapping.data_version.default_value = split_key_value_pairs2[1] + elif split_key_value_pairs2[0].lower() == "eventtype": + input_schema_mapping.event_type.default_value = split_key_value_pairs2[1] + + return input_schema_mapping + + def update_event_subscription( instance, endpoint=None, From f4fc4a9e7d536ed405711da7879de5d02fef7c24 Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Wed, 25 Apr 2018 14:33:18 -0700 Subject: [PATCH 04/14] Implementation for new commands and corresponding tests. --- src/eventgrid/azext_eventgrid/_help.py | 11 + src/eventgrid/azext_eventgrid/custom.py | 52 +- ...t_subscriptions_to_arm_resource_group.yaml | 143 ++++ ...reate_event_subscriptions_to_resource.yaml | 606 ++++++++++++++ ...eate_event_subscriptions_with_filters.yaml | 308 +++++++ .../eventgrid_test_create_topic.yaml | 704 ++++++++++++++++ .../eventgrid_test_topic_types.yaml | 116 +++ ...t_subscriptions_to_arm_resource_group.yaml | 225 ++--- ..._subscriptions_with_20180501_features.yaml | 231 ++++++ ...eate_event_subscriptions_with_filters.yaml | 202 ++--- .../latest/recordings/test_create_topic.yaml | 767 ++++++++++++------ .../tests/latest/test_eventgrid_commands.py | 130 ++- 12 files changed, 3009 insertions(+), 486 deletions(-) create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_event_subscriptions_to_arm_resource_group.yaml create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_event_subscriptions_to_resource.yaml create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_event_subscriptions_with_filters.yaml create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_topic.yaml create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_topic_types.yaml create mode 100644 src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_20180501_features.yaml diff --git a/src/eventgrid/azext_eventgrid/_help.py b/src/eventgrid/azext_eventgrid/_help.py index dba37bb38ec..566de37edea 100644 --- a/src/eventgrid/azext_eventgrid/_help.py +++ b/src/eventgrid/azext_eventgrid/_help.py @@ -21,6 +21,10 @@ examples: - name: Create a new topic. text: az eventgrid topic create -g rg1 --name topic1 -l westus2 + - name: Create a new topic with custom input mappings. + text: az eventgrid topic create -g rg1 --name topic1 -l westus2 --input-schema customeventschema --input-mapping-fields topic=myTopicField eventType=myEventTypeField --input-mapping-default-values subject=DefaultSubject dataVersion=1.0 + - name: Create a new topic that accepts CloudEvents V0.1. + text: az eventgrid topic create -g rg1 --name topic1 -l westus2 --input-schema cloudeventv01 """ helps['eventgrid topic update'] = """ type: command @@ -104,6 +108,13 @@ text: | 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 + - name: Create a new event subscription for a subscription, using default filters, and an Azure Storage queue as a destination. + text: | + az eventgrid event-subscription create --name es2 --endpoint-type storagequeue \\ + --endpoint /subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/queueservices/default/queues/queue1 + - name: Create a new event subscription for a subscription, using default filters, and CloudEventV01 as the delivery schema. + text: | + az eventgrid event-subscription create --name es2 --endpoint https://contoso.azurewebsites.net/api/f1?code=code --event-delivery-schema cloudeventv01schema """ helps['eventgrid event-subscription update'] = """ type: command diff --git a/src/eventgrid/azext_eventgrid/custom.py b/src/eventgrid/azext_eventgrid/custom.py index 5e49dcd8321..1ecd33eb387 100644 --- a/src/eventgrid/azext_eventgrid/custom.py +++ b/src/eventgrid/azext_eventgrid/custom.py @@ -36,9 +36,10 @@ EVENTHUB_DESTINATION = "eventhub" STORAGEQUEUE_DESTINATION = "storagequeue" HYBRIDCONNECTION_DESTINATION = "hybridconnection" -EVENTGRID_SCHEMA = "eventgridschema" -CUSTOM_SCHEMA = "customeventschema" -CLOUDEVENTV01_SCHEMA = "cloudeventv01schema" +EVENTGRID_SCHEMA = "EventGridSchema" +CLOUDEVENTV01_SCHEMA = "CloudEventV01Schema" +CUSTOM_EVENT_SCHEMA = "CustomEventSchema" +INPUT_EVENT_SCHEMA = "InputEventSchema" def cli_topic_list( @@ -59,15 +60,25 @@ def cli_topic_create_or_update( input_schema=EVENTGRID_SCHEMA, input_mapping_fields=None, input_mapping_default_values=None): - if input_schema is EVENTGRID_SCHEMA or input_schema is CLOUDEVENTV01_SCHEMA: + if input_schema.lower() == EVENTGRID_SCHEMA.lower(): + input_schema = EVENTGRID_SCHEMA + elif input_schema.lower() == CUSTOM_EVENT_SCHEMA.lower(): + input_schema = CUSTOM_EVENT_SCHEMA + elif input_schema.lower() == CLOUDEVENTV01_SCHEMA.lower(): + input_schema = CLOUDEVENTV01_SCHEMA + else: + raise CLIError('The provided input_schema is not a valid value. The supported values are: ' + + EVENTGRID_SCHEMA + ',' + CUSTOM_EVENT_SCHEMA + ',' + CLOUDEVENTV01_SCHEMA) + + if input_schema == EVENTGRID_SCHEMA or input_schema == CLOUDEVENTV01_SCHEMA: # Ensure that custom input mappings are not specified if input_mapping_fields is not None or input_mapping_default_values is not None: - raise CLIError('input_mapping_default_values and input_mapping_fields are applicable only when input_schema is set to customeventschema.') + raise CLIError('input-mapping-default-values and input-mapping-fields should be specified only when input-schema is set to customeventschema.') - if input_schema is CUSTOM_SCHEMA: + if input_schema == CUSTOM_EVENT_SCHEMA: # Ensure that custom input mappings are specified - if input_mapping_fields is not None and input_mapping_default_values is not None: - raise CLIError('Either input_mapping_default_values or input_mapping_fields must be specified when input_schema is set to customeventschema.') + if input_mapping_fields is None and input_mapping_default_values is None: + raise CLIError('Either input-mapping-default-values or input-mapping-fields must be specified when input-schema is set to customeventschema.') input_schema_mapping = get_input_schema_mapping( input_mapping_fields, @@ -101,7 +112,26 @@ def cli_eventgrid_event_subscription_create( event_delivery_schema=EVENTGRID_SCHEMA, deadletter_endpoint=None, labels=None): + max_delivery_attempts = int(max_delivery_attempts) + if max_delivery_attempts < 1 or max_delivery_attempts > 30: + raise CLIError('Max delivery attempts should be a number between 1 and 30.') + + event_ttl = int(event_ttl) + if event_ttl < 1 or event_ttl > 1440: + raise CLIError('Event TTL should be a number between 1 and 1440.') + + if event_delivery_schema.lower() == EVENTGRID_SCHEMA.lower(): + event_delivery_schema = EVENTGRID_SCHEMA + elif event_delivery_schema.lower() == INPUT_EVENT_SCHEMA.lower(): + event_delivery_schema = INPUT_EVENT_SCHEMA + elif event_delivery_schema.lower() == CLOUDEVENTV01_SCHEMA.lower(): + event_delivery_schema = CLOUDEVENTV01_SCHEMA + else: + raise CLIError('The provided event delivery schema is not a valid value. The supported values are' + + EVENTGRID_SCHEMA + ',' + INPUT_EVENT_SCHEMA + ',' + CLOUDEVENTV01_SCHEMA) + scope = _get_scope_for_event_subscription(cmd.cli_ctx, resource_id, topic_name, resource_group_name) + deadletter_destination = None if endpoint_type.lower() == WEBHOOK_DESTINATION.lower(): destination = WebHookEventSubscriptionDestination(endpoint) @@ -129,9 +159,9 @@ def cli_eventgrid_event_subscription_create( retry_policy = RetryPolicy(max_delivery_attempts, event_ttl) - if deadlettter_endpoint is not None: + if deadletter_endpoint is not None: storage_blob_items = re.split( - "/blobServices/default/containers/", endpoint, flags=re.IGNORECASE) + "/blobServices/default/containers/", deadletter_endpoint, flags=re.IGNORECASE) if len(storage_blob_items) != 2 or storage_blob_items[0] is None or storage_blob_items[1] is None: raise CLIError("Argument Error: Expected format of deadletter destination is: /subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/containerName") @@ -142,7 +172,7 @@ def cli_eventgrid_event_subscription_create( event_subscription_info = EventSubscription( destination, event_subscription_filter, labels, event_delivery_schema, retry_policy, deadletter_destination) - if endpoint_type.lower() == WEBHOOK_DESTINATION.lower() and "azure" not in endpoint and "hookbin" not in endpoint: + if endpoint_type.lower() == WEBHOOK_DESTINATION.lower() and "azure" not in endpoint.lower() and "hookbin" not in endpoint.lower(): print("If the endpoint doesn't support subscription validation response, please visit the validation URL manually to complete the validation handshake.") async_event_subscription_create = client.create_or_update( diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_event_subscriptions_to_arm_resource_group.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_event_subscriptions_to_arm_resource_group.yaml new file mode 100644 index 00000000000..4367f526f0c --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_event_subscriptions_to_arm_resource_group.yaml @@ -0,0 +1,143 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-19T22:44:37Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-19T22:44:37Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:44:38 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1135'] + status: {code: 201, message: Created} +- request: + body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": + {"endpointUrl": "https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=69AbujfvYn77Ccf5OySDcTk9CYM1b9Ua2lO37ayoWb97fGRWELGbnA=="}}, + "filter": {"subjectBeginsWith": "mysubject_prefix", "isSubjectCaseSensitive": + false}}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + Content-Length: ['301'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix"},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/F23F3978-A162-423B-8B3A-F4230382F64D?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['712'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:44:39 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1091'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/F23F3978-A162-423B-8B3A-F4230382F64D?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/F23F3978-A162-423B-8B3A-F4230382F64D?api-version=2018-01-01","name":"f23f3978-a162-423b-8b3a-f4230382f64d","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['262'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:44:50 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['763'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:44:50 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Thu, 19 Apr 2018 22:44:52 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdVTlRHUVdUTjRBWlVUQUtRRElUQUdIMlZYWUE3UVBDVkhTSnw2MTdCQzI2MkI1OTRFQkIzLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1029'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_event_subscriptions_to_resource.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_event_subscriptions_to_resource.yaml new file mode 100644 index 00000000000..5652efd88ec --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_event_subscriptions_to_resource.yaml @@ -0,0 +1,606 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-19T22:44:52Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clieventgridrg000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001","name":"clieventgridrg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-19T22:44:52Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:44:52 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1084'] + status: {code: 201, message: Created} +- request: + body: '{"sku": {"name": "Standard_LRS"}, "kind": "Storage", "location": "westus", + "properties": {"supportsHttpsTrafficOnly": false}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account create] + Connection: [keep-alive] + Content-Length: ['125'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-storage/1.5.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002?api-version=2017-10-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + content-type: [text/plain; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:44:55 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westus/asyncoperations/a5ad249e-ce8c-4bd3-a250-2c0d112502d2?monitor=true&api-version=2017-10-01'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1134'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account create] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-storage/1.5.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westus/asyncoperations/a5ad249e-ce8c-4bd3-a250-2c0d112502d2?monitor=true&api-version=2017-10-01 + response: + body: {string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002","name":"clieventgrid000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"trustedDirectories":["72f988bf-86f1-41af-91ab-2d7cd011db47"],"supportsHttpsTrafficOnly":false,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2018-04-19T22:44:55.2234895Z"},"blob":{"enabled":true,"lastEnabledTime":"2018-04-19T22:44:55.2234895Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2018-04-19T22:44:55.1453183Z","primaryEndpoints":{"blob":"https://clieventgrid000002.blob.core.windows.net/","queue":"https://clieventgrid000002.queue.core.windows.net/","table":"https://clieventgrid000002.table.core.windows.net/","file":"https://clieventgrid000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}'} + headers: + cache-control: [no-cache] + content-length: ['1231'] + content-type: [application/json] + date: ['Thu, 19 Apr 2018 22:45:15 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account keys list] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-storage/1.5.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/listKeys?api-version=2017-10-01 + response: + body: {string: '{"keys":[{"keyName":"key1","value":"XpqvWVgOdDMKtSPSO6/xluUlCjOEXX4dlQwKhr7tpSkwwSjBVfXAiIrx/ZBW6UWp5LOsrt+Cy4bpWY5Oxunxww==","permissions":"FULL"},{"keyName":"key2","value":"S/fC7vkeWdqzeIbQNszupGV9XZwBuYUmaS3yO4sYsMAHMyCuJZ0bP+GHio2ewA3A8Ce5NqWO/5DMZSkqozDC+A==","permissions":"FULL"}]}'} + headers: + cache-control: [no-cache] + content-length: ['288'] + content-type: [application/json] + date: ['Thu, 19 Apr 2018 22:45:16 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1147'] + status: {code: 200, message: OK} +- request: + body: '{"sku": {"name": "Standard_LRS"}, "kind": "Storage", "location": "westus", + "properties": {"supportsHttpsTrafficOnly": false}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account create] + Connection: [keep-alive] + Content-Length: ['125'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-storage/1.5.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002?api-version=2017-10-01 + response: + body: {string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002","name":"clieventgrid000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"trustedDirectories":["72f988bf-86f1-41af-91ab-2d7cd011db47"],"supportsHttpsTrafficOnly":false,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2018-04-19T22:44:55.2234895Z"},"blob":{"enabled":true,"lastEnabledTime":"2018-04-19T22:44:55.2234895Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2018-04-19T22:44:55.1453183Z","primaryEndpoints":{"blob":"https://clieventgrid000002.blob.core.windows.net/","queue":"https://clieventgrid000002.queue.core.windows.net/","table":"https://clieventgrid000002.table.core.windows.net/","file":"https://clieventgrid000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}'} + headers: + cache-control: [no-cache] + content-length: ['1231'] + content-type: [application/json] + date: ['Thu, 19 Apr 2018 22:45:17 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1155'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account update] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-storage/1.5.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002?api-version=2017-10-01 + response: + body: {string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002","name":"clieventgrid000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"trustedDirectories":["72f988bf-86f1-41af-91ab-2d7cd011db47"],"supportsHttpsTrafficOnly":false,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2018-04-19T22:44:55.2234895Z"},"blob":{"enabled":true,"lastEnabledTime":"2018-04-19T22:44:55.2234895Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2018-04-19T22:44:55.1453183Z","primaryEndpoints":{"blob":"https://clieventgrid000002.blob.core.windows.net/","queue":"https://clieventgrid000002.queue.core.windows.net/","table":"https://clieventgrid000002.table.core.windows.net/","file":"https://clieventgrid000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}'} + headers: + cache-control: [no-cache] + content-length: ['1231'] + content-type: [application/json] + date: ['Thu, 19 Apr 2018 22:45:17 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"sku": {"name": "Standard_LRS"}, "tags": {}, "properties": {"encryption": + {"services": {"blob": {"enabled": true}, "file": {"enabled": true}}, "keySource": + "Microsoft.Storage"}, "supportsHttpsTrafficOnly": false, "networkAcls": {"bypass": + "AzureServices", "virtualNetworkRules": [], "ipRules": [], "defaultAction": + "Allow"}}, "kind": "StorageV2"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account update] + Connection: [keep-alive] + Content-Length: ['347'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-storage/1.5.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002?api-version=2017-10-01 + response: + body: {string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002","name":"clieventgrid000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"trustedDirectories":["72f988bf-86f1-41af-91ab-2d7cd011db47"],"supportsHttpsTrafficOnly":false,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2018-04-19T22:44:55.2234895Z"},"blob":{"enabled":true,"lastEnabledTime":"2018-04-19T22:44:55.2234895Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2018-04-19T22:44:55.1453183Z","primaryEndpoints":{"blob":"https://clieventgrid000002.blob.core.windows.net/","queue":"https://clieventgrid000002.queue.core.windows.net/","table":"https://clieventgrid000002.table.core.windows.net/","file":"https://clieventgrid000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}'} + headers: + cache-control: [no-cache] + content-length: ['1252'] + content-type: [application/json] + date: ['Thu, 19 Apr 2018 22:45:19 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1124'] + status: {code: 200, message: OK} +- request: + body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": + {"endpointUrl": "https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=69AbujfvYn77Ccf5OySDcTk9CYM1b9Ua2lO37ayoWb97fGRWELGbnA=="}}, + "filter": {"isSubjectCaseSensitive": false}}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + Content-Length: ['260'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/9C36A609-0B13-4535-829B-B1803CEC74BF?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['856'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:45:20 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1103'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/9C36A609-0B13-4535-829B-B1803CEC74BF?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/9C36A609-0B13-4535-829B-B1803CEC74BF?api-version=2018-01-01","name":"9c36a609-0b13-4535-829b-b1803cec74bf","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['279'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:45:30 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['929'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:45:30 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['929'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:45:31 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['929'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:45:31 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003/getFullUrl?api-version=2018-01-01 + response: + body: {string: '{"endpointUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=69AbujfvYn77Ccf5OySDcTk9CYM1b9Ua2lO37ayoWb97fGRWELGbnA=="}'} + headers: + cache-control: [no-cache] + content-length: ['138'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:45:31 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1178'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['929'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:45:32 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"destination": {"endpointType": "WebHook", "properties": {"endpointUrl": + "https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=69AbujfvYn77Ccf5OySDcTk9CYM1b9Ua2lO37ayoWb97fGRWELGbnA=="}}, + "filter": {"subjectBeginsWith": "", "subjectEndsWith": ".jpg", "includedEventTypes": + ["All"]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + Content-Length: ['294'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Updating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/AC255AF5-8FBF-485C-936C-EA97659CEEF8?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['932'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:45:33 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1178'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/AC255AF5-8FBF-485C-936C-EA97659CEEF8?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationsStatus/AC255AF5-8FBF-485C-936C-EA97659CEEF8?api-version=2018-01-01","name":"ac255af5-8fbf-485c-936c-ea97659ceef8","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['279'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:45:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['933'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:45:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/microsoft.storage/storageaccounts/clieventgrid000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} + headers: + cache-control: [no-cache] + content-length: ['945'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:45:44 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clieventgridrg000001/providers/Microsoft.Storage/storageAccounts/clieventgrid000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Thu, 19 Apr 2018 22:45:45 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationResults/8B61D8B7-704F-4443-872B-206D34849BD1?api-version=2018-01-01'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1192'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus/operationResults/8B61D8B7-704F-4443-872B-206D34849BD1?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Thu, 19 Apr 2018 22:45:55 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clieventgridrg000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Thu, 19 Apr 2018 22:45:57 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElFVkVOVEdSSURSR1FQM0o0NVo1UzZaS0xVT01HTkFCRFpNNDVUT0tCTkZBTnw1ODU0MjVFMUM5OUU2MEUwLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1176'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_event_subscriptions_with_filters.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_event_subscriptions_with_filters.yaml new file mode 100644 index 00000000000..d6b1da963c8 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_event_subscriptions_with_filters.yaml @@ -0,0 +1,308 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-19T22:45:57Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-19T22:45:57Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:45:58 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1174'] + status: {code: 201, message: Created} +- request: + body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": + {"endpointUrl": "https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=69AbujfvYn77Ccf5OySDcTk9CYM1b9Ua2lO37ayoWb97fGRWELGbnA=="}}, + "filter": {"subjectEndsWith": "mysubject_suffix", "includedEventTypes": ["blobCreated", + "blobUpdated"], "isSubjectCaseSensitive": true}, "labels": ["Finance", "HR"]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + Content-Length: ['381'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/C984F51F-8A3D-496D-A3C8-0BD099D85059?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['803'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:00 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1121'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/C984F51F-8A3D-496D-A3C8-0BD099D85059?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/C984F51F-8A3D-496D-A3C8-0BD099D85059?api-version=2018-01-01","name":"c984f51f-8a3d-496d-a3c8-0bd099d85059","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['262'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:10 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['827'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:10 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['827'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:11 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['827'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:11 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2/getFullUrl?api-version=2018-01-01 + response: + body: {string: '{"endpointUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=69AbujfvYn77Ccf5OySDcTk9CYM1b9Ua2lO37ayoWb97fGRWELGbnA=="}'} + headers: + cache-control: [no-cache] + content-length: ['138'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:11 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1137'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} + headers: + cache-control: [no-cache] + content-length: ['839'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:12 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Thu, 19 Apr 2018 22:46:13 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/74BB28CD-7CB5-4CF5-8842-3CE79882D0F6?api-version=2018-01-01'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1145'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/74BB28CD-7CB5-4CF5-8842-3CE79882D0F6?api-version=2018-01-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Thu, 19 Apr 2018 22:46:23 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Thu, 19 Apr 2018 22:46:25 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdGQlRIWkY2UkRURkFBQ0dZT0Q0R1BBQTZVRkFaRFo3Q1pMWXwwRjdBN0ExM0VGNzYxNUE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1184'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_topic.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_topic.yaml new file mode 100644 index 00000000000..dfe3058ae09 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_create_topic.yaml @@ -0,0 +1,704 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-19T22:46:26Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-19T22:46:26Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:27 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1081'] + status: {code: 201, message: Created} +- request: + body: '{"location": "eastus2euap"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + Content-Length: ['27'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provisioningState":"Creating","endpoint":null},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/DB27681F-6900-4AB3-A4DB-92AEFBEF98F7?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['414'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:28 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1144'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/DB27681F-6900-4AB3-A4DB-92AEFBEF98F7?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/DB27681F-6900-4AB3-A4DB-92AEFBEF98F7?api-version=2018-01-01","name":"db27681f-6900-4ab3-a4db-92aefbef98f7","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['284'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:39 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + cache-control: [no-cache] + content-length: ['506'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:40 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + cache-control: [no-cache] + content-length: ['506'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:41 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic update] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + cache-control: [no-cache] + content-length: ['506'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:42 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"tags": {"Dept": "IT"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic update] + Connection: [keep-alive] + Content-Length: ['24'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provisioningState":"Updating","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events"},"location":"eastus2euap","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/3363BBEB-A687-4574-9474-EAFCFF97B7D3?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['514'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1176'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic update] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/3363BBEB-A687-4574-9474-EAFCFF97B7D3?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/3363BBEB-A687-4574-9474-EAFCFF97B7D3?api-version=2018-01-01","name":"3363bbeb-a687-4574-9474-eafcff97b7d3","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['284'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:54 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic update] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events"},"location":"eastus2euap","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + cache-control: [no-cache] + content-length: ['515'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:55 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events"},"location":"eastus2euap","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}]}'} + headers: + cache-control: [no-cache] + content-length: ['527'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:56 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic key list] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/listKeys?api-version=2018-01-01 + response: + body: {string: '{"key1":"t1EZk5Chk1+3/ZoJ5xgvFgRFrswomaFES3L13sQelAo=","key2":"NlbcvQdn2yaPMxlkFKxz0bTCQRHZ7Ec3FjEk4rrhpXA="}'} + headers: + cache-control: [no-cache] + content-length: ['109'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:57 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1163'] + status: {code: 200, message: OK} +- request: + body: '{"keyName": "key1"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic key regenerate] + Connection: [keep-alive] + Content-Length: ['19'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/regenerateKey?api-version=2018-01-01 + response: + body: {string: '{"key1":"P8+DXIs8/FHVVvBKl0lpIBMXaA48g6g2EkFRxjqu+zo=","key2":"NlbcvQdn2yaPMxlkFKxz0bTCQRHZ7Ec3FjEk4rrhpXA="}'} + headers: + cache-control: [no-cache] + content-length: ['109'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:58 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1173'] + status: {code: 200, message: OK} +- request: + body: '{"keyName": "key2"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic key regenerate] + Connection: [keep-alive] + Content-Length: ['19'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/regenerateKey?api-version=2018-01-01 + response: + body: {string: '{"key1":"P8+DXIs8/FHVVvBKl0lpIBMXaA48g6g2EkFRxjqu+zo=","key2":"js8JtMptcmkAPZIz/lOO0xxDjFOuU89qVOpOV2byHyc="}'} + headers: + cache-control: [no-cache] + content-length: ['109'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:46:58 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1158'] + status: {code: 200, message: OK} +- request: + body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": + {"endpointUrl": "https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=69AbujfvYn77Ccf5OySDcTk9CYM1b9Ua2lO37ayoWb97fGRWELGbnA=="}}, + "filter": {"isSubjectCaseSensitive": false}}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + Content-Length: ['260'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/B725263F-1D92-4E88-B3E7-F9B31EF7FB31?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['874'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:00 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1175'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/B725263F-1D92-4E88-B3E7-F9B31EF7FB31?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/B725263F-1D92-4E88-B3E7-F9B31EF7FB31?api-version=2018-01-01","name":"b725263f-1d92-4e88-b3e7-f9b31ef7fb31","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['284'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:10 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['947'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:11 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['947'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:12 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['947'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:13 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003/getFullUrl?api-version=2018-01-01 + response: + body: {string: '{"endpointUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=69AbujfvYn77Ccf5OySDcTk9CYM1b9Ua2lO37ayoWb97fGRWELGbnA=="}'} + headers: + cache-control: [no-cache] + content-length: ['138'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:14 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1118'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['947'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:14 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"destination": {"endpointType": "WebHook", "properties": {"endpointUrl": + "https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=69AbujfvYn77Ccf5OySDcTk9CYM1b9Ua2lO37ayoWb97fGRWELGbnA=="}}, + "filter": {"subjectBeginsWith": "", "subjectEndsWith": "", "includedEventTypes": + ["All"]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + Content-Length: ['290'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Updating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/D2BB5053-5AEF-4C9C-9F82-552AC1846DA2?api-version=2018-01-01'] + cache-control: [no-cache] + content-length: ['946'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:15 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1091'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/D2BB5053-5AEF-4C9C-9F82-552AC1846DA2?api-version=2018-01-01 + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/D2BB5053-5AEF-4C9C-9F82-552AC1846DA2?api-version=2018-01-01","name":"d2bb5053-5aef-4c9c-9f82-552ac1846da2","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['284'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:25 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['947'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:27 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Updating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} + headers: + cache-control: [no-cache] + content-length: ['958'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:27 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Thu, 19 Apr 2018 22:47:28 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkczN1FMSzRLRDQySFBRWktXN0pYSlg0UTdGVkpJTVE0UkZBQXwyREVDMUVDNjlCNTMzNzNFLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1162'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_topic_types.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_topic_types.yaml new file mode 100644 index 00000000000..47a237b2647 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/eventgrid_test_topic_types.yaml @@ -0,0 +1,116 @@ +interactions: +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic-type list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/providers/Microsoft.EventGrid/topicTypes?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"provider":"Microsoft.Eventhub","displayName":"Event + Hubs Namespaces","description":"Microsoft Event Hubs service events.","resourceRegionType":"RegionalResource","provisioningState":"Succeeded","supportedLocations":["West + US 2","West Central US","East US 2 EUAP","East US","West US","Central US","East + US 2","West Europe","North Europe","Southeast Asia","East Asia"]},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Eventhub.Namespaces","name":"Microsoft.Eventhub.Namespaces","type":"Microsoft.EventGrid/topicTypes"},{"properties":{"provider":"Microsoft.Storage","displayName":"Storage + Accounts","description":"Microsoft Storage service events.","resourceRegionType":"RegionalResource","provisioningState":"Succeeded","supportedLocations":["West + US 2","West Central US","East US 2 EUAP","East US","West US","Central US","East + US 2","West Europe","North Europe","Southeast Asia","East Asia"]},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Storage.StorageAccounts","name":"Microsoft.Storage.StorageAccounts","type":"Microsoft.EventGrid/topicTypes"},{"properties":{"provider":"Microsoft.Resources","displayName":"Azure + Subscriptions","description":"Resource management events under an Azure subscription","resourceRegionType":"GlobalResource","provisioningState":"Succeeded"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions","name":"Microsoft.Resources.Subscriptions","type":"Microsoft.EventGrid/topicTypes"},{"properties":{"provider":"Microsoft.Resources","displayName":"Resource + Groups","description":"Resource management events under a resource group.","resourceRegionType":"GlobalResource","provisioningState":"Succeeded"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.ResourceGroups","name":"Microsoft.Resources.ResourceGroups","type":"Microsoft.EventGrid/topicTypes"},{"properties":{"provider":"Microsoft.Devices","displayName":"Azure + IoT Hub Accounts","description":"Azure IoT Hub service events","resourceRegionType":"RegionalResource","provisioningState":"Succeeded","supportedLocations":["West + US 2","West Central US","East US","West US","Central US","East US 2","West + Europe","North Europe","Southeast Asia","East Asia"]},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Devices.IotHubs","name":"Microsoft.Devices.IotHubs","type":"Microsoft.EventGrid/topicTypes"},{"properties":{"provider":"Microsoft.EventGrid","displayName":"Event + Grid Topics","description":"Custom events via Event Grid Topics","resourceRegionType":"RegionalResource","provisioningState":"Succeeded","supportedLocations":["West + US 2","West Central US","East US 2 EUAP","East US","West US","Central US","East + US 2","West Europe","North Europe","Southeast Asia","East Asia"]},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.EventGrid.Topics","name":"Microsoft.EventGrid.Topics","type":"Microsoft.EventGrid/topicTypes"},{"properties":{"provider":"Microsoft.ServiceBus","displayName":"Service + Bus Namespaces","description":"Service Bus events","resourceRegionType":"RegionalResource","provisioningState":"Succeeded","supportedLocations":["West + US 2","West Central US","East US 2 EUAP","East US","West US","Central US","East + US 2","West Europe","North Europe","Southeast Asia","East Asia"]},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.ServiceBus.Namespaces","name":"Microsoft.ServiceBus.Namespaces","type":"Microsoft.EventGrid/topicTypes"},{"properties":{"provider":"Microsoft.ContainerRegistry","displayName":"Azure + Container Registry","description":"Azure Container Registry service events","resourceRegionType":"RegionalResource","provisioningState":"Succeeded","supportedLocations":["East + US 2 EUAP"]},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.ContainerRegistry.Registries","name":"Microsoft.ContainerRegistry.Registries","type":"Microsoft.EventGrid/topicTypes"},{"properties":{"provider":"Microsoft.Media","displayName":"Microsoft + Azure Media Services","description":"Microsoft Azure Media Services events","resourceRegionType":"RegionalResource","provisioningState":"Succeeded","supportedLocations":[]},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Media.MediaServices","name":"Microsoft.Media.MediaServices","type":"Microsoft.EventGrid/topicTypes"}]}'} + headers: + cache-control: [no-cache] + content-length: ['4286'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:29 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic-type show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions?api-version=2018-01-01 + response: + body: {string: '{"properties":{"provider":"Microsoft.Resources","displayName":"Azure + Subscriptions","description":"Resource management events under an Azure subscription","resourceRegionType":"GlobalResource","provisioningState":"Succeeded"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions","name":"Microsoft.Resources.Subscriptions","type":"Microsoft.EventGrid/topicTypes"}'} + headers: + cache-control: [no-cache] + content-length: ['391'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:30 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic-type list-event-types] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.27 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes?api-version=2018-01-01 + response: + body: {string: '{"value":[{"properties":{"displayName":"Resource Write Success","description":"Raised + when a resource create or update operation succeeds.","schemaUrl":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/eventgrid/data-plane/Microsoft.Resources/stable/2018-01-01/Resources.json"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes/Microsoft.Resources.ResourceWriteSuccess","name":"Microsoft.Resources.ResourceWriteSuccess","type":"Microsoft.EventGrid/topicTypes/eventTypes"},{"properties":{"displayName":"Resource + Write Failure","description":"Raised when a resource create or update operation + fails.","schemaUrl":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/eventgrid/data-plane/Microsoft.Resources/stable/2018-01-01/Resources.json"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes/Microsoft.Resources.ResourceWriteFailure","name":"Microsoft.Resources.ResourceWriteFailure","type":"Microsoft.EventGrid/topicTypes/eventTypes"},{"properties":{"displayName":"Resource + Write Cancel","description":"Raised when a resource create or update operation + is cancelled.","schemaUrl":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/eventgrid/data-plane/Microsoft.Resources/stable/2018-01-01/Resources.json"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes/Microsoft.Resources.ResourceWriteCancel","name":"Microsoft.Resources.ResourceWriteCancel","type":"Microsoft.EventGrid/topicTypes/eventTypes"},{"properties":{"displayName":"Resource + Delete Success","description":"Raised when a resource deletion operation succeeds.","schemaUrl":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/eventgrid/data-plane/Microsoft.Resources/stable/2018-01-01/Resources.json"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes/Microsoft.Resources.ResourceDeleteSuccess","name":"Microsoft.Resources.ResourceDeleteSuccess","type":"Microsoft.EventGrid/topicTypes/eventTypes"},{"properties":{"displayName":"Resource + Delete Failure","description":"Raised when a resource delete operation fails.","schemaUrl":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/eventgrid/data-plane/Microsoft.Resources/stable/2018-01-01/Resources.json"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes/Microsoft.Resources.ResourceDeleteFailure","name":"Microsoft.Resources.ResourceDeleteFailure","type":"Microsoft.EventGrid/topicTypes/eventTypes"},{"properties":{"displayName":"Resource + Delete Cancel","description":"Raised when a resource delete is cancelled. + This happens when template deployment is cancelled.","schemaUrl":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/eventgrid/data-plane/Microsoft.Resources/stable/2018-01-01/Resources.json"},"id":"providers/Microsoft.EventGrid/topicTypes/Microsoft.Resources.Subscriptions/eventTypes/Microsoft.Resources.ResourceDeleteCancel","name":"Microsoft.Resources.ResourceDeleteCancel","type":"Microsoft.EventGrid/topicTypes/eventTypes"}]}'} + headers: + cache-control: [no-cache] + content-length: ['3252'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 19 Apr 2018 22:47:29 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml index f877234dcce..2a13a45b379 100644 --- a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml @@ -1,62 +1,66 @@ interactions: - request: - body: '{"location": "westus", "tags": {"use": "az-test"}}' + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-25T00:49:12Z"}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] CommandName: [group create] Connection: [keep-alive] - Content-Length: ['50'] + Content-Length: ['110'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-25T00:49:12Z"},"properties":{"provisioningState":"Succeeded"}}'} headers: cache-control: [no-cache] - content-length: ['328'] + content-length: ['384'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 17:39:51 GMT'] + date: ['Wed, 25 Apr 2018 00:49:15 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1139'] status: {code: 201, message: Created} - request: - body: '{"properties": {"destination": {"properties": {"endpointUrl": "https://requestb.in/18zmdhv1"}, - "endpointType": "WebHook"}, "filter": {"isSubjectCaseSensitive": false, "subjectBeginsWith": - "mysubject_prefix"}}}' + body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": + {"endpointUrl": "https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ=="}}, + "filter": {"subjectBeginsWith": "mysubject_prefix", "isSubjectCaseSensitive": + false}, "eventDeliverySchema": "EventGridSchema", "retryPolicy": {"maxDeliveryAttempts": + 30, "eventTimeToLiveInMinutes": 1440}}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription create] Connection: [keep-alive] - Content-Length: ['209'] + Content-Length: ['421'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix"},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix"},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/17903B72-3870-4449-83CC-949CAD461326?api-version=2018-01-01'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/7A1D68BF-ED6E-42E7-9F4A-1B55704BF790?api-version=2018-05-01-preview'] cache-control: [no-cache] - content-length: ['682'] + content-length: ['825'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 17:39:53 GMT'] + date: ['Wed, 25 Apr 2018 00:49:17 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1126'] status: {code: 201, message: Created} - request: body: null @@ -65,17 +69,18 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription create] Connection: [keep-alive] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/17903B72-3870-4449-83CC-949CAD461326?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/7A1D68BF-ED6E-42E7-9F4A-1B55704BF790?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/17903B72-3870-4449-83CC-949CAD461326?api-version=2018-01-01","name":"17903b72-3870-4449-83cc-949cad461326","status":"Succeeded"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/7A1D68BF-ED6E-42E7-9F4A-1B55704BF790?api-version=2018-05-01-preview","name":"7a1d68bf-ed6e-42e7-9f4a-1b55704bf790","status":"Succeeded"}'} headers: cache-control: [no-cache] - content-length: ['262'] + content-length: ['270'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 17:40:03 GMT'] + date: ['Wed, 25 Apr 2018 00:49:28 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -91,17 +96,18 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription create] Connection: [keep-alive] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['733'] + content-length: ['876'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 17:40:03 GMT'] + date: ['Wed, 25 Apr 2018 00:49:29 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -118,18 +124,19 @@ interactions: CommandName: [eventgrid event-subscription show] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['733'] + content-length: ['876'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 17:40:05 GMT'] + date: ['Wed, 25 Apr 2018 00:49:30 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -146,18 +153,19 @@ interactions: CommandName: [eventgrid event-subscription show] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['733'] + content-length: ['876'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 17:40:04 GMT'] + date: ['Wed, 25 Apr 2018 00:49:31 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -175,18 +183,19 @@ interactions: Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2/getFullUrl?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2/getFullUrl?api-version=2018-05-01-preview response: - body: {string: '{"endpointUrl":"https://requestb.in/18zmdhv1"}'} + body: {string: '{"endpointUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ=="}'} headers: cache-control: [no-cache] - content-length: ['46'] + content-length: ['138'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 17:40:05 GMT'] + date: ['Wed, 25 Apr 2018 00:49:32 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -194,7 +203,7 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1123'] status: {code: 200, message: OK} - request: body: null @@ -204,18 +213,19 @@ interactions: CommandName: [eventgrid event-subscription update] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['733'] + content-length: ['876'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 17:40:06 GMT'] + date: ['Wed, 25 Apr 2018 00:49:32 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -225,35 +235,37 @@ interactions: x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: - body: '{"destination": {"properties": {"endpointUrl": "https://requestb.in/18zmdhv2"}, - "endpointType": "WebHook"}, "filter": {"includedEventTypes": ["All"], "subjectEndsWith": - ".jpg", "subjectBeginsWith": "mysubject_prefix"}}' + body: '{"destination": {"endpointType": "WebHook", "properties": {"endpointUrl": + "https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ=="}}, + "filter": {"subjectBeginsWith": "mysubject_prefix", "subjectEndsWith": ".jpg", + "includedEventTypes": ["All"]}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription update] Connection: [keep-alive] - Content-Length: ['218'] + Content-Length: ['310'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Updating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Updating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/97BAD5CC-6F54-4A59-B057-847DA1910BE0?api-version=2018-01-01'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/0CF66B41-3034-4314-AA4F-987A0E981F99?api-version=2018-05-01-preview'] cache-control: [no-cache] - content-length: ['736'] + content-length: ['879'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 17:40:07 GMT'] + date: ['Wed, 25 Apr 2018 00:49:34 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1173'] status: {code: 201, message: Created} - request: body: null @@ -262,17 +274,18 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription update] Connection: [keep-alive] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/97BAD5CC-6F54-4A59-B057-847DA1910BE0?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/0CF66B41-3034-4314-AA4F-987A0E981F99?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/97BAD5CC-6F54-4A59-B057-847DA1910BE0?api-version=2018-01-01","name":"97bad5cc-6f54-4a59-b057-847da1910be0","status":"Succeeded"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/0CF66B41-3034-4314-AA4F-987A0E981F99?api-version=2018-05-01-preview","name":"0cf66b41-3034-4314-aa4f-987a0e981f99","status":"Succeeded"}'} headers: cache-control: [no-cache] - content-length: ['262'] + content-length: ['270'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 17:40:17 GMT'] + date: ['Wed, 25 Apr 2018 00:49:45 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -288,17 +301,18 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription update] Connection: [keep-alive] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['737'] + content-length: ['767'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 17:40:18 GMT'] + date: ['Wed, 25 Apr 2018 00:49:45 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -315,18 +329,19 @@ interactions: CommandName: [eventgrid event-subscription list] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-05-01-preview response: - body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} + body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} headers: cache-control: [no-cache] - content-length: ['749'] + content-length: ['779'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 17:40:19 GMT'] + date: ['Wed, 25 Apr 2018 00:49:47 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -344,24 +359,25 @@ interactions: Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 28 Feb 2018 17:40:20 GMT'] + date: ['Wed, 25 Apr 2018 00:49:48 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/5E788857-4CD0-4040-B562-160F90F16DE9?api-version=2018-01-01'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/2C7B3BC1-A96E-456C-927A-57D22046D615?api-version=2018-05-01-preview'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1195'] + x-ms-ratelimit-remaining-subscription-writes: ['1168'] status: {code: 202, message: Accepted} - request: body: null @@ -370,16 +386,17 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription delete] Connection: [keep-alive] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/5E788857-4CD0-4040-B562-160F90F16DE9?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/2C7B3BC1-A96E-456C-927A-57D22046D615?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 28 Feb 2018 17:40:30 GMT'] + date: ['Wed, 25 Apr 2018 00:49:58 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -395,9 +412,9 @@ interactions: Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 @@ -406,12 +423,12 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 28 Feb 2018 17:40:32 GMT'] + date: ['Wed, 25 Apr 2018 00:50:00 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdMMlFUNlRYVUdFWEJQT1ZVQkxLUTUyQjZSM0hLRExHTzJUV3wwRkJEQjZDQjFEMjhBRkZFLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdTNkIyMkg3TDNVQU80VUgyTzVLNEk1SkhOSzZNWkNPUVhXM3xGQTQyMUE1OUI4Qzc0MzUxLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1155'] status: {code: 202, message: Accepted} version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_20180501_features.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_20180501_features.yaml new file mode 100644 index 00000000000..19e1a95cfe5 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_20180501_features.yaml @@ -0,0 +1,231 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-25T00:50:01Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-25T00:50:01Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:50:01 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1143'] + status: {code: 201, message: Created} +- request: + body: '{"properties": {"destination": {"endpointType": "StorageQueue", "properties": + {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo", + "queueName": "kalsdemoqueue"}}, "filter": {"isSubjectCaseSensitive": false}, + "eventDeliverySchema": "CloudEventV01Schema", "retryPolicy": {"maxDeliveryAttempts": + 30, "eventTimeToLiveInMinutes": 1440}, "deadLetterDestination": {"endpointType": + "StorageBlob", "properties": {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo", + "blobContainerName": "dlq"}}}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + Content-Length: ['674'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5?api-version=2018-05-01-preview + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","queueName":"kalsdemoqueue"},"endpointType":"StorageQueue"},"filter":{},"labels":null,"eventDeliverySchema":"CloudEventV01Schema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440},"deadLetterDestination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","blobContainerName":"dlq"},"endpointType":"StorageBlob"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5","name":"eventsubscription5","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/6BF559CA-3C43-464A-A88C-BBE58D248A6C?api-version=2018-05-01-preview'] + cache-control: [no-cache] + content-length: ['1110'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:50:03 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1125'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/6BF559CA-3C43-464A-A88C-BBE58D248A6C?api-version=2018-05-01-preview + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/6BF559CA-3C43-464A-A88C-BBE58D248A6C?api-version=2018-05-01-preview","name":"6bf559ca-3c43-464a-a88c-bbe58d248a6c","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['270'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:50:14 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5?api-version=2018-05-01-preview + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","queueName":"kalsdemoqueue"},"endpointType":"StorageQueue"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"CloudEventV01Schema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440},"deadLetterDestination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","blobContainerName":"dlq"},"endpointType":"StorageBlob"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5","name":"eventsubscription5","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['1183'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:50:14 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5?api-version=2018-05-01-preview + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","queueName":"kalsdemoqueue"},"endpointType":"StorageQueue"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"CloudEventV01Schema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440},"deadLetterDestination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","blobContainerName":"dlq"},"endpointType":"StorageBlob"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5","name":"eventsubscription5","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['1183'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:50:15 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5?api-version=2018-05-01-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 25 Apr 2018 00:50:15 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/9AF334B8-EB70-4422-B3B6-E07B718AC398?api-version=2018-05-01-preview'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1165'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/9AF334B8-EB70-4422-B3B6-E07B718AC398?api-version=2018-05-01-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 25 Apr 2018 00:50:26 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 25 Apr 2018 00:50:28 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkc2RFRPRzNFT1dSN0RZQVNOWkRBVTIzRExNUUg2UUtZNkhCTHwwREUyRjZENUIyMTE4NEEwLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1085'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml index 50d917d49fe..8328d5facfc 100644 --- a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml @@ -1,63 +1,67 @@ interactions: - request: - body: '{"location": "westus", "tags": {"use": "az-test"}}' + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-25T00:50:28Z"}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] CommandName: [group create] Connection: [keep-alive] - Content-Length: ['50'] + Content-Length: ['110'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-25T00:50:28Z"},"properties":{"provisioningState":"Succeeded"}}'} headers: cache-control: [no-cache] - content-length: ['328'] + content-length: ['384'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 18:10:01 GMT'] + date: ['Wed, 25 Apr 2018 00:50:29 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1194'] + x-ms-ratelimit-remaining-subscription-writes: ['1134'] status: {code: 201, message: Created} - request: body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": - {"endpointUrl": "https://requestb.in/18zmdhv1"}}, "labels": ["Finance", "HR"], - "filter": {"includedEventTypes": ["blobCreated", "blobUpdated"], "subjectEndsWith": - "mysubject_suffix", "isSubjectCaseSensitive": true}}}' + {"endpointUrl": "https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ=="}}, + "filter": {"subjectEndsWith": "mysubject_suffix", "includedEventTypes": ["blobCreated", + "blobUpdated"], "isSubjectCaseSensitive": true}, "labels": ["Finance", "HR"], + "eventDeliverySchema": "EventGridSchema", "retryPolicy": {"maxDeliveryAttempts": + 30, "eventTimeToLiveInMinutes": 1440}}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription create] Connection: [keep-alive] - Content-Length: ['289'] + Content-Length: ['501'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"],"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/3A0FA8DB-5E8E-4E78-86DA-AB8CF1695EAF?api-version=2018-05-01-preview'] cache-control: [no-cache] - content-length: ['773'] + content-length: ['916'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 18:10:07 GMT'] + date: ['Wed, 25 Apr 2018 00:50:30 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1170'] status: {code: 201, message: Created} - request: body: null @@ -66,17 +70,18 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription create] Connection: [keep-alive] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/3A0FA8DB-5E8E-4E78-86DA-AB8CF1695EAF?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01","name":"d1a94534-bdd0-4da9-ab46-401ba0c5830f","status":"InProgress"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/3A0FA8DB-5E8E-4E78-86DA-AB8CF1695EAF?api-version=2018-05-01-preview","name":"3a0fa8db-5e8e-4e78-86da-ab8cf1695eaf","status":"InProgress"}'} headers: cache-control: [no-cache] - content-length: ['263'] + content-length: ['271'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 18:10:17 GMT'] + date: ['Wed, 25 Apr 2018 00:50:42 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -92,17 +97,18 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription create] Connection: [keep-alive] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/3A0FA8DB-5E8E-4E78-86DA-AB8CF1695EAF?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01","name":"d1a94534-bdd0-4da9-ab46-401ba0c5830f","status":"InProgress"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/3A0FA8DB-5E8E-4E78-86DA-AB8CF1695EAF?api-version=2018-05-01-preview","name":"3a0fa8db-5e8e-4e78-86da-ab8cf1695eaf","status":"Succeeded"}'} headers: cache-control: [no-cache] - content-length: ['263'] + content-length: ['270'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 18:10:48 GMT'] + date: ['Wed, 25 Apr 2018 00:51:12 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -118,17 +124,18 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription create] Connection: [keep-alive] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/D1A94534-BDD0-4DA9-AB46-401BA0C5830F?api-version=2018-01-01","name":"d1a94534-bdd0-4da9-ab46-401ba0c5830f","status":"Succeeded"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"],"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['262'] + content-length: ['940'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 18:11:18 GMT'] + date: ['Wed, 25 Apr 2018 00:51:13 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -142,19 +149,22 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [eventgrid event-subscription create] + CommandName: [eventgrid event-subscription show] Connection: [keep-alive] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"],"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['797'] + content-length: ['940'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 18:11:18 GMT'] + date: ['Wed, 25 Apr 2018 00:51:14 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -171,18 +181,19 @@ interactions: CommandName: [eventgrid event-subscription show] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"],"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['797'] + content-length: ['940'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 18:11:19 GMT'] + date: ['Wed, 25 Apr 2018 00:51:15 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -198,27 +209,30 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription show] Connection: [keep-alive] + Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2/getFullUrl?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} headers: cache-control: [no-cache] - content-length: ['797'] + connection: [close] + content-length: ['147'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 18:11:19 GMT'] + date: ['Wed, 25 Apr 2018 00:52:14 GMT'] expires: ['-1'] pragma: [no-cache] - server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] x-content-type-options: [nosniff] - status: {code: 200, message: OK} + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} - request: body: null headers: @@ -228,18 +242,19 @@ interactions: Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2/getFullUrl?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2/getFullUrl?api-version=2018-05-01-preview response: - body: {string: '{"endpointUrl":"https://requestb.in/18zmdhv1"}'} + body: {string: '{"endpointUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ=="}'} headers: cache-control: [no-cache] - content-length: ['46'] + content-length: ['138'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 18:11:20 GMT'] + date: ['Wed, 25 Apr 2018 00:52:15 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -247,7 +262,7 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1126'] status: {code: 200, message: OK} - request: body: null @@ -257,18 +272,19 @@ interactions: CommandName: [eventgrid event-subscription list] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-05-01-preview response: - body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} + body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"],"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} headers: cache-control: [no-cache] - content-length: ['809'] + content-length: ['952'] content-type: [application/json; charset=utf-8] - date: ['Wed, 28 Feb 2018 18:11:20 GMT'] + date: ['Wed, 25 Apr 2018 00:52:16 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -286,24 +302,25 @@ interactions: Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 28 Feb 2018 18:11:22 GMT'] + date: ['Wed, 25 Apr 2018 00:52:19 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/B8AD08A1-C0B3-4137-A2DD-7675E6A7DD71?api-version=2018-01-01'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/ED9C8338-7874-4970-B83F-C4135105CAFB?api-version=2018-05-01-preview'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1195'] + x-ms-ratelimit-remaining-subscription-writes: ['1124'] status: {code: 202, message: Accepted} - request: body: null @@ -312,16 +329,17 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription delete] Connection: [keep-alive] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/B8AD08A1-C0B3-4137-A2DD-7675E6A7DD71?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/ED9C8338-7874-4970-B83F-C4135105CAFB?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 28 Feb 2018 18:11:33 GMT'] + date: ['Wed, 25 Apr 2018 00:52:29 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -337,9 +355,9 @@ interactions: Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.29] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 @@ -348,12 +366,12 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 28 Feb 2018 18:11:34 GMT'] + date: ['Wed, 25 Apr 2018 00:52:30 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdUTDRCU0M3TjRMN0ZZRkFTMlNUUUU2NUVVSE42M0JBT1RQT3w4NDczRTEyNTE4QTkwQkFCLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdMT1U3NExDTDQ3RkVRUTRVSlVENzNCS0hVUUpEU1o1M1JLTnxGQzMxMDU1NzU2MURCRENDLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1189'] + x-ms-ratelimit-remaining-subscription-writes: ['1129'] status: {code: 202, message: Accepted} version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml index 9b56c1a802f..896dd28d404 100644 --- a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml @@ -1,80 +1,89 @@ interactions: - request: - body: '{"location": "westus", "tags": {"use": "az-test"}}' + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-25T00:52:31Z"}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] CommandName: [group create] Connection: [keep-alive] - Content-Length: ['50'] + Content-Length: ['110'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-25T00:52:31Z"},"properties":{"provisioningState":"Succeeded"}}'} headers: cache-control: [no-cache] - content-length: ['328'] + content-length: ['384'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:24 GMT'] + date: ['Wed, 25 Apr 2018 00:52:31 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1141'] status: {code: 201, message: Created} - request: - body: '{"location": "westus2"}' + body: '{"location": "eastus2euap", "properties": {"inputSchema": "EventGridSchema"}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid topic create] Connection: [keep-alive] - Content-Length: ['23'] + Content-Length: ['77'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"provisioningState":"Creating","endpoint":null},"location":"westus2","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + body: {string: '{"properties":{"provisioningState":"Creating","endpoint":null,"inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/3085124C-C601-40D4-BD4C-1879D9CE024F?api-version=2018-01-01'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/516029EA-E4F3-4A75-ADC9-9D27456872BB?api-version=2018-05-01-preview'] cache-control: [no-cache] - content-length: ['410'] + content-length: ['446'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:25 GMT'] + date: ['Wed, 25 Apr 2018 00:52:33 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1174'] status: {code: 201, message: Created} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [eventgrid event-subscription delete] + CommandName: [eventgrid topic create] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/E9B32DA7-DB73-4F12-83AE-49C284488F70?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/516029EA-E4F3-4A75-ADC9-9D27456872BB?api-version=2018-05-01-preview response: - body: {string: ''} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/516029EA-E4F3-4A75-ADC9-9D27456872BB?api-version=2018-05-01-preview","name":"516029ea-e4f3-4a75-adc9-9d27456872bb","status":"Succeeded"}'} headers: cache-control: [no-cache] - content-length: ['0'] - date: ['Wed, 24 Jan 2018 19:16:31 GMT'] + content-length: ['292'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:52:43 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -83,24 +92,85 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid topic create] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/3085124C-C601-40D4-BD4C-1879D9CE024F?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/3085124C-C601-40D4-BD4C-1879D9CE024F?api-version=2018-01-01","name":"3085124c-c601-40d4-bd4c-1879d9ce024f","status":"Succeeded"}'} + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} headers: cache-control: [no-cache] - content-length: ['280'] + content-length: ['538'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:36 GMT'] + date: ['Wed, 25 Apr 2018 00:52:45 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-05-01-preview + response: + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + cache-control: [no-cache] + content-length: ['538'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:52:45 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"location": "eastus2euap", "properties": {"inputSchema": "CloudEventV01Schema"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + Content-Length: ['81'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000003?api-version=2018-05-01-preview + response: + body: {string: '{"properties":{"provisioningState":"Creating","endpoint":null,"inputSchema":"CloudEventV01Schema"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000003","name":"cli000003","type":"Microsoft.EventGrid/topics"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/A49148D7-7FDD-482D-9616-2CB7BB487FEE?api-version=2018-05-01-preview'] + cache-control: [no-cache] + content-length: ['450'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:52:47 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1167'] + status: {code: 201, message: Created} - request: body: null headers: @@ -108,50 +178,140 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid topic create] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/A49148D7-7FDD-482D-9616-2CB7BB487FEE?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.westus2-1.eventgrid.azure.net/api/events"},"location":"westus2","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/A49148D7-7FDD-482D-9616-2CB7BB487FEE?api-version=2018-05-01-preview","name":"a49148d7-7fdd-482d-9616-2cb7bb487fee","status":"Succeeded"}'} headers: cache-control: [no-cache] - content-length: ['498'] + content-length: ['292'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:36 GMT'] + date: ['Wed, 25 Apr 2018 00:52:58 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [eventgrid topic show] + CommandName: [eventgrid topic create] Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000003?api-version=2018-05-01-preview + response: + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000003.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"CloudEventV01Schema"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000003","name":"cli000003","type":"Microsoft.EventGrid/topics"}'} + headers: + cache-control: [no-cache] + content-length: ['542'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:52:58 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"location": "eastus2euap", "properties": {"inputSchema": "CustomEventSchema", + "inputSchemaMapping": {"inputSchemaMappingType": "Json", "properties": {"id": + {}, "topic": {"sourceField": "myTopicField"}, "eventTime": {}, "eventType": + {"sourceField": "myEventTypeField"}, "subject": {"defaultValue": "DefaultSubject"}, + "dataVersion": {"defaultValue": "1.0"}}}}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + Content-Length: ['359'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000004?api-version=2018-05-01-preview + response: + body: {string: '{"properties":{"provisioningState":"Creating","endpoint":null,"inputSchema":"CustomEventSchema","inputSchemaMapping":{"properties":{"id":{"sourceField":null},"topic":{"sourceField":"myTopicField"},"eventTime":{"sourceField":null},"eventType":{"sourceField":"myEventTypeField","defaultValue":null},"subject":{"sourceField":null,"defaultValue":"DefaultSubject"},"dataVersion":{"sourceField":null,"defaultValue":"1.0"}},"inputSchemaMappingType":"Json"}},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000004","name":"cli000004","type":"Microsoft.EventGrid/topics"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/336814BD-7426-4C44-B192-6865AC1DBF44?api-version=2018-05-01-preview'] + cache-control: [no-cache] + content-length: ['802'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:53:01 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1171'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/336814BD-7426-4C44-B192-6865AC1DBF44?api-version=2018-05-01-preview + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/336814BD-7426-4C44-B192-6865AC1DBF44?api-version=2018-05-01-preview","name":"336814bd-7426-4c44-b192-6865ac1dbf44","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['292'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:53:11 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000004?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.westus2-1.eventgrid.azure.net/api/events"},"location":"westus2","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000004.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"CustomEventSchema","inputSchemaMapping":{"properties":{"id":{"sourceField":null},"topic":{"sourceField":"myTopicField"},"eventTime":{"sourceField":null},"eventType":{"sourceField":"myEventTypeField","defaultValue":null},"subject":{"sourceField":null,"defaultValue":"DefaultSubject"},"dataVersion":{"sourceField":null,"defaultValue":"1.0"}},"inputSchemaMappingType":"Json"}},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000004","name":"cli000004","type":"Microsoft.EventGrid/topics"}'} headers: cache-control: [no-cache] - content-length: ['498'] + content-length: ['894'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:37 GMT'] + date: ['Wed, 25 Apr 2018 00:53:12 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -161,24 +321,56 @@ interactions: CommandName: [eventgrid topic update] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.westus2-1.eventgrid.azure.net/api/events"},"location":"westus2","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} headers: cache-control: [no-cache] - content-length: ['498'] + connection: [close] + content-length: ['147'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:37 GMT'] + date: ['Wed, 25 Apr 2018 00:54:12 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic update] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-05-01-preview + response: + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + headers: + cache-control: [no-cache] + content-length: ['538'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:54:13 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: '{"tags": {"Dept": "IT"}}' @@ -189,24 +381,26 @@ interactions: Connection: [keep-alive] Content-Length: ['24'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"provisioningState":"Updating","endpoint":"https://cli000002.westus2-1.eventgrid.azure.net/api/events"},"location":"westus2","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + body: {string: '{"properties":{"provisioningState":"Updating","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/42D2BD1E-6F20-44CC-B55C-512E6AACA621?api-version=2018-01-01'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/3B502A2B-A890-439F-BAB8-066E12401479?api-version=2018-05-01-preview'] cache-control: [no-cache] - content-length: ['506'] + content-length: ['546'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:38 GMT'] + date: ['Wed, 25 Apr 2018 00:54:15 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1161'] status: {code: 201, message: Created} - request: body: null @@ -215,23 +409,25 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid topic update] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/42D2BD1E-6F20-44CC-B55C-512E6AACA621?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/3B502A2B-A890-439F-BAB8-066E12401479?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/42D2BD1E-6F20-44CC-B55C-512E6AACA621?api-version=2018-01-01","name":"42d2bd1e-6f20-44cc-b55c-512e6aaca621","status":"Succeeded"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/3B502A2B-A890-439F-BAB8-066E12401479?api-version=2018-05-01-preview","name":"3b502a2b-a890-439f-bab8-066e12401479","status":"Succeeded"}'} headers: cache-control: [no-cache] - content-length: ['280'] + content-length: ['292'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:48 GMT'] + date: ['Wed, 25 Apr 2018 00:54:25 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -240,23 +436,25 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid topic update] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.westus2-1.eventgrid.azure.net/api/events"},"location":"westus2","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} headers: cache-control: [no-cache] - content-length: ['507'] + content-length: ['547'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:49 GMT'] + date: ['Wed, 25 Apr 2018 00:54:25 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -266,24 +464,26 @@ interactions: CommandName: [eventgrid topic list] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics?api-version=2018-05-01-preview response: - body: {string: '{"value":[{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.westus2-1.eventgrid.azure.net/api/events"},"location":"westus2","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}]}'} + body: {string: '{"value":[{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"},{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000003.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"CloudEventV01Schema"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000003","name":"cli000003","type":"Microsoft.EventGrid/topics"},{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000004.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"CustomEventSchema","inputSchemaMapping":{"properties":{"id":{"sourceField":null},"topic":{"sourceField":"myTopicField"},"eventTime":{"sourceField":null},"eventType":{"sourceField":"myEventTypeField","defaultValue":null},"subject":{"sourceField":null,"defaultValue":"DefaultSubject"},"dataVersion":{"sourceField":null,"defaultValue":"1.0"}},"inputSchemaMappingType":"Json"}},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000004","name":"cli000004","type":"Microsoft.EventGrid/topics"}]}'} headers: cache-control: [no-cache] - content-length: ['519'] + content-length: ['1997'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:49 GMT'] + date: ['Wed, 25 Apr 2018 00:54:27 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -294,57 +494,61 @@ interactions: Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/listKeys?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/listKeys?api-version=2018-05-01-preview response: - body: {string: '{"key1":"7wmL9F7yQn+3EAo5Jec0S1v5KrPp67uzEESJ73vkcZQ=","key2":"aXPLwYZgRkBMYGBdDm4nh5QDo9r8iMiHj9ErN/6rgCc="}'} + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} headers: cache-control: [no-cache] - content-length: ['109'] + connection: [close] + content-length: ['147'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:49 GMT'] + date: ['Wed, 25 Apr 2018 00:55:27 GMT'] expires: ['-1'] pragma: [no-cache] - server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - status: {code: 200, message: OK} + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} - request: - body: '{"keyName": "key1"}' + body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [eventgrid topic key regenerate] + CommandName: [eventgrid topic key list] Connection: [keep-alive] - Content-Length: ['19'] + Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/regenerateKey?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/listKeys?api-version=2018-05-01-preview response: - body: {string: '{"key1":"6ctpQeWQ3bKmjIPhAJI5YKTZOTwYFIyhvcegiADG7KU=","key2":"aXPLwYZgRkBMYGBdDm4nh5QDo9r8iMiHj9ErN/6rgCc="}'} + body: {string: '{"key1":"fKlmVMhD0gLPU2ocz2hb6B+hmcAISPf/fZm87V7JUvY=","key2":"w/NVF1lH6RBJQNnLjgl2xmWRxLmLz0WB2K0OnVXV9Fg="}'} headers: cache-control: [no-cache] content-length: ['109'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:50 GMT'] + date: ['Wed, 25 Apr 2018 00:55:28 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1168'] status: {code: 200, message: OK} - request: - body: '{"keyName": "key2"}' + body: '{"keyName": "key1"}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] @@ -352,81 +556,92 @@ interactions: Connection: [keep-alive] Content-Length: ['19'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/regenerateKey?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/regenerateKey?api-version=2018-05-01-preview response: - body: {string: '{"key1":"6ctpQeWQ3bKmjIPhAJI5YKTZOTwYFIyhvcegiADG7KU=","key2":"fxdT5G9RbtU9/Dt3J/fsuP3QEEoigxVtJO50fj5X92g="}'} + body: {string: '{"key1":"8bXRTW0X6V5b0PxDKhxtTZaY1tNp5/tWO6zXkWjW6Lk=","key2":"w/NVF1lH6RBJQNnLjgl2xmWRxLmLz0WB2K0OnVXV9Fg="}'} headers: cache-control: [no-cache] content-length: ['109'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:50 GMT'] + date: ['Wed, 25 Apr 2018 00:55:29 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1139'] status: {code: 200, message: OK} - request: - body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": - {"endpointUrl": "https://requestb.in/18zmdhv1"}}, "filter": {"isSubjectCaseSensitive": - false}}}' + body: '{"keyName": "key2"}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [eventgrid event-subscription create] + CommandName: [eventgrid topic key regenerate] Connection: [keep-alive] - Content-Length: ['168'] + Content-Length: ['19'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/regenerateKey?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"key1":"8bXRTW0X6V5b0PxDKhxtTZaY1tNp5/tWO6zXkWjW6Lk=","key2":"CHoEC30kIox5DNk6ODnm++D92NNdmUsX9DYS9CRvLys="}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/51BD9C4D-BD3E-45C4-A8A3-FF170E2CA549?api-version=2018-01-01'] cache-control: [no-cache] - content-length: ['844'] + content-length: ['109'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:16:51 GMT'] + date: ['Wed, 25 Apr 2018 00:55:30 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - status: {code: 201, message: Created} + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1138'] + status: {code: 200, message: OK} - request: - body: null + body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": + {"endpointUrl": "https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ=="}}, + "filter": {"isSubjectCaseSensitive": false}, "eventDeliverySchema": "EventGridSchema", + "retryPolicy": {"maxDeliveryAttempts": 30, "eventTimeToLiveInMinutes": 1440}}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription create] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/51BD9C4D-BD3E-45C4-A8A3-FF170E2CA549?api-version=2018-01-01 + Content-Length: ['380'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/51BD9C4D-BD3E-45C4-A8A3-FF170E2CA549?api-version=2018-01-01","name":"51bd9c4d-bd3e-45c4-a8a3-ff170e2ca549","status":"InProgress"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005","name":"cli000005","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/E766DDBF-F639-41BF-B3DA-55C6594DCD25?api-version=2018-05-01-preview'] cache-control: [no-cache] - content-length: ['281'] + content-length: ['987'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:17:02 GMT'] + date: ['Wed, 25 Apr 2018 00:55:32 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1152'] + status: {code: 201, message: Created} - request: body: null headers: @@ -434,23 +649,25 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription create] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/51BD9C4D-BD3E-45C4-A8A3-FF170E2CA549?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/E766DDBF-F639-41BF-B3DA-55C6594DCD25?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/51BD9C4D-BD3E-45C4-A8A3-FF170E2CA549?api-version=2018-01-01","name":"51bd9c4d-bd3e-45c4-a8a3-ff170e2ca549","status":"Succeeded"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/E766DDBF-F639-41BF-B3DA-55C6594DCD25?api-version=2018-05-01-preview","name":"e766ddbf-f639-41bf-b3da-55c6594dcd25","status":"Succeeded"}'} headers: cache-control: [no-cache] - content-length: ['280'] + content-length: ['292'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:17:31 GMT'] + date: ['Wed, 25 Apr 2018 00:55:42 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -459,23 +676,25 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription create] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005","name":"cli000005","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['917'] + content-length: ['1060'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:17:32 GMT'] + date: ['Wed, 25 Apr 2018 00:55:43 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -485,24 +704,26 @@ interactions: CommandName: [eventgrid event-subscription show] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005","name":"cli000005","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['917'] + content-length: ['1060'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:17:32 GMT'] + date: ['Wed, 25 Apr 2018 00:55:43 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -512,24 +733,26 @@ interactions: CommandName: [eventgrid event-subscription show] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005","name":"cli000005","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['917'] + content-length: ['1060'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:17:33 GMT'] + date: ['Wed, 25 Apr 2018 00:55:44 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -540,25 +763,27 @@ interactions: Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003/getFullUrl?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005/getFullUrl?api-version=2018-05-01-preview response: - body: {string: '{"endpointUrl":"https://requestb.in/18zmdhv1"}'} + body: {string: '{"endpointUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ=="}'} headers: cache-control: [no-cache] - content-length: ['46'] + content-length: ['138'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:17:32 GMT'] + date: ['Wed, 25 Apr 2018 00:55:45 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1180'] status: {code: 200, message: OK} - request: body: null @@ -568,54 +793,59 @@ interactions: CommandName: [eventgrid event-subscription update] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005","name":"cli000005","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['917'] + content-length: ['1060'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:17:34 GMT'] + date: ['Wed, 25 Apr 2018 00:55:46 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: '{"destination": {"endpointType": "WebHook", "properties": {"endpointUrl": - "https://requestb.in/18zmdhv2"}}, "filter": {"subjectBeginsWith": "", "subjectEndsWith": - "", "includedEventTypes": ["All"]}}' + "https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ=="}}, + "filter": {"subjectBeginsWith": "", "subjectEndsWith": "", "includedEventTypes": + ["All"]}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription update] Connection: [keep-alive] - Content-Length: ['198'] + Content-Length: ['290'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Updating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Updating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005","name":"cli000005","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/8AC6881D-2028-4818-B844-40E41BEC234C?api-version=2018-05-01-preview'] cache-control: [no-cache] - content-length: ['916'] + content-length: ['1059'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:17:34 GMT'] + date: ['Wed, 25 Apr 2018 00:55:47 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1121'] status: {code: 201, message: Created} - request: body: null @@ -624,23 +854,25 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription update] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/8AC6881D-2028-4818-B844-40E41BEC234C?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01","name":"bdb1e8e1-0a72-4cc0-8d59-c19c6a93fe27","status":"InProgress"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/8AC6881D-2028-4818-B844-40E41BEC234C?api-version=2018-05-01-preview","name":"8ac6881d-2028-4818-b844-40e41bec234c","status":"Succeeded"}'} headers: cache-control: [no-cache] - content-length: ['281'] + content-length: ['292'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:17:44 GMT'] + date: ['Wed, 25 Apr 2018 00:55:58 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -649,101 +881,112 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription update] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01","name":"bdb1e8e1-0a72-4cc0-8d59-c19c6a93fe27","status":"InProgress"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005","name":"cli000005","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['281'] + content-length: ['1060'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:18:14 GMT'] + date: ['Wed, 25 Apr 2018 00:55:58 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [eventgrid event-subscription update] + CommandName: [eventgrid event-subscription list] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationsStatus/BDB1E8E1-0A72-4CC0-8D59-C19C6A93FE27?api-version=2018-01-01","name":"bdb1e8e1-0a72-4cc0-8d59-c19c6a93fe27","status":"Succeeded"}'} + body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005","name":"cli000005","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} headers: cache-control: [no-cache] - content-length: ['280'] + content-length: ['1072'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:18:44 GMT'] + date: ['Wed, 25 Apr 2018 00:55:59 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] transfer-encoding: [chunked] vary: [Accept-Encoding] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [eventgrid event-subscription update] + CommandName: [eventgrid event-subscription delete] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: ''} headers: cache-control: [no-cache] - content-length: ['917'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:18:45 GMT'] + content-length: ['0'] + date: ['Wed, 25 Apr 2018 00:56:00 GMT'] expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/2B91E2DE-A1A4-4D35-9ED2-6F75ED6F4DE4?api-version=2018-05-01-preview'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1189'] + status: {code: 202, message: Accepted} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [eventgrid event-subscription list] + CommandName: [eventgrid event-subscription delete] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] - accept-language: [en-US] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/2B91E2DE-A1A4-4D35-9ED2-6F75ED6F4DE4?api-version=2018-05-01-preview response: - body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://requestb.in/18zmdhv2"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003","name":"cli000003","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} headers: cache-control: [no-cache] - content-length: ['929'] + connection: [close] + content-length: ['147'] content-type: [application/json; charset=utf-8] - date: ['Wed, 24 Jan 2018 19:18:45 GMT'] + date: ['Wed, 25 Apr 2018 00:57:10 GMT'] expires: ['-1'] pragma: [no-cache] - server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} - request: body: null headers: @@ -751,26 +994,23 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid event-subscription delete] Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] - accept-language: [en-US] - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000003?api-version=2018-01-01 + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/2B91E2DE-A1A4-4D35-9ED2-6F75ED6F4DE4?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 24 Jan 2018 19:18:46 GMT'] + date: ['Wed, 25 Apr 2018 00:57:10 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationResults/7FD22F25-21F8-4D2A-91EC-2BADA4E10BD3?api-version=2018-01-01'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - status: {code: 202, message: Accepted} + x-content-type-options: [nosniff] + status: {code: 200, message: OK} - request: body: null headers: @@ -780,46 +1020,54 @@ interactions: Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 24 Jan 2018 19:18:47 GMT'] + date: ['Wed, 25 Apr 2018 00:57:13 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationResults/F819FFA2-A9B2-4D2D-9F0D-D3D86712EA00?api-version=2018-01-01'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/155922BF-BCBE-4F0B-95B1-439C7475D2AA?api-version=2018-05-01-preview'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1129'] status: {code: 202, message: Accepted} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [eventgrid event-subscription delete] + CommandName: [eventgrid topic delete] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationResults/7FD22F25-21F8-4D2A-91EC-2BADA4E10BD3?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/155922BF-BCBE-4F0B-95B1-439C7475D2AA?api-version=2018-05-01-preview response: - body: {string: ''} + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} headers: cache-control: [no-cache] - content-length: ['0'] - date: ['Wed, 24 Jan 2018 19:18:56 GMT'] + connection: [close] + content-length: ['147'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 00:58:23 GMT'] expires: ['-1'] pragma: [no-cache] - server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - status: {code: 200, message: OK} + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} - request: body: null headers: @@ -827,20 +1075,22 @@ interactions: Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid topic delete] Connection: [keep-alive] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 azure-mgmt-eventgrid/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/westus2/operationResults/F819FFA2-A9B2-4D2D-9F0D-D3D86712EA00?api-version=2018-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/155922BF-BCBE-4F0B-95B1-439C7475D2AA?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 24 Jan 2018 19:18:57 GMT'] + date: ['Wed, 25 Apr 2018 00:58:23 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] status: {code: 200, message: OK} - request: body: null @@ -851,9 +1101,9 @@ interactions: Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.25 - msrest_azure/0.4.20 resourcemanagementclient/1.2.1 Azure-SDK-For-Python - AZURECLI/2.0.26] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] accept-language: [en-US] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 @@ -862,11 +1112,12 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 24 Jan 2018 19:18:59 GMT'] + date: ['Wed, 25 Apr 2018 00:58:25 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkc3TE5aTUFYVUtEQkFCTlRXSklFMlIyTEFIVEpRQVE0RUY2UXwzODFBMkU0OTRGNENDMDVDLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdBRUhXTEZWRUdKNzVDSDZaUjRYWVI3Q05YM003MjVTNDREQnw2RDJCNkJDM0M4RkU0OEI3LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1177'] status: {code: 202, message: Accepted} version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py b/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py index 18466ea4ec5..0b5701a6d7a 100644 --- a/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py +++ b/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py @@ -6,9 +6,10 @@ # pylint: disable=line-too-long import unittest from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer - +from knack.util import CLIError class EventGridTests(ScenarioTest): + @unittest.skip("Temporarily disabled as this is not yet enabled with the 2018-05-01-preview API version") def test_topic_types(self): self.kwargs.update({ @@ -28,13 +29,22 @@ def test_topic_types(self): @ResourceGroupPreparer() def test_create_topic(self, resource_group): + endpoint_url = 'https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ==' + endpoint_baseurl = 'https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1' + topic_name = self.create_random_name(prefix='cli', length=40) + topic_name2 = self.create_random_name(prefix='cli', length=40) + topic_name3 = self.create_random_name(prefix='cli', length=40) event_subscription_name = self.create_random_name(prefix='cli', length=40) self.kwargs.update({ 'topic_name': topic_name, - 'location': 'westus2', - 'event_subscription_name': event_subscription_name + 'topic_name2': topic_name2, + 'topic_name3': topic_name3, + 'location': 'eastus2euap', + 'event_subscription_name': event_subscription_name, + 'endpoint_url': endpoint_url, + 'endpoint_baseurl': endpoint_baseurl }) self.cmd('az eventgrid topic create --name {topic_name} --resource-group {rg} --location {location}', checks=[ @@ -48,6 +58,31 @@ def test_create_topic(self, resource_group): self.check('name', self.kwargs['topic_name']), ]) + # Test various failure conditions + # Input mappings cannot be provided when input schema is not customeventschema + with self.assertRaises(CLIError) as ex1: + self.cmd('az eventgrid topic create --name {topic_name2} --resource-group {rg} --location {location} --input-schema CloudEventV01Schema --input-mapping-fields topic=myTopicField') + + # Input mappings cannot be provided when input schema is not customeventschema + with self.assertRaises(CLIError) as ex2: + self.cmd('az eventgrid topic create --name {topic_name2} --resource-group {rg} --location {location} --input-schema eventgridschema --input-mapping-fields topic=myTopicField') + + # Input mappings must be provided when input schema is customeventschema + with self.assertRaises(CLIError) as ex3: + self.cmd('az eventgrid topic create --name {topic_name2} --resource-group {rg} --location {location} --input-schema customeventschema') + + self.cmd('az eventgrid topic create --name {topic_name2} --resource-group {rg} --location {location} --input-schema CloudEventV01Schema', checks=[ + self.check('type', 'Microsoft.EventGrid/topics'), + self.check('name', self.kwargs['topic_name2']), + self.check('provisioningState', 'Succeeded'), + ]) + + self.cmd('az eventgrid topic create --name {topic_name3} --resource-group {rg} --location {location} --input-schema Customeventschema --input-mapping-fields topic=myTopicField eventType=myEventTypeField --input-mapping-default-values subject=DefaultSubject dataVersion=1.0', checks=[ + self.check('type', 'Microsoft.EventGrid/topics'), + self.check('name', self.kwargs['topic_name3']), + self.check('provisioningState', 'Succeeded'), + ]) + self.cmd('az eventgrid topic update --name {topic_name} --resource-group {rg} --tags Dept=IT', checks=[ self.check('name', self.kwargs['topic_name']), self.check('tags', {'Dept': 'IT'}), @@ -70,11 +105,11 @@ def test_create_topic(self, resource_group): self.assertIsNotNone(output['key1']) self.assertIsNotNone(output['key2']) - self.cmd('az eventgrid event-subscription create --topic-name {topic_name} -g {rg} --name {event_subscription_name} --endpoint https://requestb.in/18zmdhv1', checks=[ + self.cmd('az eventgrid event-subscription create --topic-name {topic_name} -g {rg} --name {event_subscription_name} --endpoint {endpoint_url}', checks=[ self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), self.check('provisioningState', 'Succeeded'), self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', 'https://requestb.in/18zmdhv1') + self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) ]) self.cmd('az eventgrid event-subscription show --topic-name {topic_name} -g {rg} --name {event_subscription_name}', checks=[ @@ -84,15 +119,15 @@ def test_create_topic(self, resource_group): ]) self.cmd('az eventgrid event-subscription show --topic-name {topic_name} -g {rg} --name {event_subscription_name} --include-full-endpoint-url', checks=[ - self.check('destination.endpointUrl', 'https://requestb.in/18zmdhv1'), - self.check('destination.endpointBaseUrl', 'https://requestb.in/18zmdhv1') + self.check('destination.endpointUrl', self.kwargs['endpoint_url']), + self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) ]) - self.cmd('az eventgrid event-subscription update --topic-name {topic_name} -g {rg} --name {event_subscription_name} --endpoint https://requestb.in/18zmdhv2', checks=[ + self.cmd('az eventgrid event-subscription update --topic-name {topic_name} -g {rg} --name {event_subscription_name} --endpoint {endpoint_url}', checks=[ self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), self.check('provisioningState', 'Succeeded'), self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', 'https://requestb.in/18zmdhv2') + self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) ]) self.cmd('az eventgrid event-subscription list --topic-name {topic_name} -g {rg}', checks=[ @@ -105,18 +140,20 @@ def test_create_topic(self, resource_group): @ResourceGroupPreparer() def test_create_event_subscriptions_to_arm_resource_group(self, resource_group): event_subscription_name = 'eventsubscription2' - endpoint_url = 'https://requestb.in/18zmdhv1' + endpoint_url = 'https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ==' + endpoint_baseurl = 'https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1' self.kwargs.update({ 'event_subscription_name': event_subscription_name, - 'endpoint_url': endpoint_url + 'endpoint_url': endpoint_url, + 'endpoint_baseurl': endpoint_baseurl }) self.cmd('az eventgrid event-subscription create -g {rg} --name {event_subscription_name} --endpoint {endpoint_url} --subject-begins-with mysubject_prefix', checks=[ self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), self.check('provisioningState', 'Succeeded'), self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_url']) + self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) ]) self.cmd('az eventgrid event-subscription show -g {rg} --name {event_subscription_name}', checks=[ @@ -127,11 +164,11 @@ def test_create_event_subscriptions_to_arm_resource_group(self, resource_group): self.check('destination.endpointUrl', self.kwargs['endpoint_url']), ]) - self.cmd('az eventgrid event-subscription update -g {rg} --name {event_subscription_name} --endpoint https://requestb.in/18zmdhv2 --subject-ends-with .jpg', checks=[ + self.cmd('az eventgrid event-subscription update -g {rg} --name {event_subscription_name} --endpoint {endpoint_url} --subject-ends-with .jpg', checks=[ self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), self.check('provisioningState', 'Succeeded'), self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', 'https://requestb.in/18zmdhv2'), + self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']), self.check('filter.subjectEndsWith', '.jpg'), ]) @@ -142,20 +179,25 @@ def test_create_event_subscriptions_to_arm_resource_group(self, resource_group): self.cmd('az eventgrid event-subscription delete --resource-group {rg} --name {event_subscription_name}') + @unittest.skip("Temporarily disabled as this is not yet enabled with the 2018-05-01-preview API version") @ResourceGroupPreparer(name_prefix='clieventgridrg') @StorageAccountPreparer(name_prefix='clieventgrid') def test_create_event_subscriptions_to_resource(self, resource_group, resource_group_location, storage_account): event_subscription_name = self.create_random_name(prefix='cli', length=40) + endpoint_url = 'https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ==' + endpoint_baseurl = 'https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1' self.kwargs.update({ 'event_subscription_name': event_subscription_name, - 'location': resource_group_location + 'location': resource_group_location, + 'endpoint_url': endpoint_url, + 'endpoint_baseurl': endpoint_baseurl }) self.kwargs['resource_id'] = self.cmd('storage account create -g {rg} -n {sa} --sku Standard_LRS -l {location}').get_output_in_json()['id'] self.cmd('az storage account update -g {rg} -n {sa} --set kind=StorageV2') - self.cmd('az eventgrid event-subscription create --resource-id {resource_id} --name {event_subscription_name} --endpoint https://requestb.in/18zmdhv1', checks=[ + self.cmd('az eventgrid event-subscription create --resource-id {resource_id} --name {event_subscription_name} --endpoint {endpoint_url}', checks=[ self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), self.check('provisioningState', 'Succeeded'), self.check('name', self.kwargs['event_subscription_name']), @@ -167,15 +209,15 @@ def test_create_event_subscriptions_to_resource(self, resource_group, resource_g self.check('name', self.kwargs['event_subscription_name']), ]) self.cmd('az eventgrid event-subscription show --include-full-endpoint-url --resource-id {resource_id} --name {event_subscription_name}', checks=[ - self.check('destination.endpointUrl', 'https://requestb.in/18zmdhv1'), + self.check('destination.endpointUrl', self.kwargs['endpoint_url']), ]) - self.cmd('az eventgrid event-subscription update --resource-id {resource_id} --name {event_subscription_name} --endpoint https://requestb.in/18zmdhv2 --subject-ends-with .jpg', checks=[ + self.cmd('az eventgrid event-subscription update --resource-id {resource_id} --name {event_subscription_name} --endpoint {endpoint_url} --subject-ends-with .jpg', checks=[ self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), self.check('provisioningState', 'Succeeded'), self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', 'https://requestb.in/18zmdhv2'), - self.check('filter.subjectEndsWith', '.jpg'), + self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']), + self.check('filter.subjectEndsWith', '.jpg') ]) self.cmd('az eventgrid event-subscription list --resource-id {resource_id}', checks=[ @@ -187,7 +229,8 @@ def test_create_event_subscriptions_to_resource(self, resource_group, resource_g @ResourceGroupPreparer() def test_create_event_subscriptions_with_filters(self, resource_group): event_subscription_name = 'eventsubscription2' - endpoint_url = 'https://requestb.in/18zmdhv1' + endpoint_url = 'https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ==' + endpoint_baseurl = 'https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1' subject_ends_with = 'mysubject_suffix' event_type_1 = 'blobCreated' event_type_2 = 'blobUpdated' @@ -197,6 +240,7 @@ def test_create_event_subscriptions_with_filters(self, resource_group): self.kwargs.update({ 'event_subscription_name': event_subscription_name, 'endpoint_url': endpoint_url, + 'endpoint_baseurl': endpoint_baseurl, 'subject_ends_with': subject_ends_with, 'event_type_1': event_type_1, 'event_type_2': event_type_2, @@ -223,3 +267,47 @@ def test_create_event_subscriptions_with_filters(self, resource_group): self.check('[0].provisioningState', 'Succeeded'), ]) self.cmd('az eventgrid event-subscription delete --resource-group {rg} --name {event_subscription_name}') + + + @ResourceGroupPreparer() + def test_create_event_subscriptions_with_20180501_features(self, resource_group): + event_subscription_name1 = 'eventsubscription1' + event_subscription_name2 = 'eventsubscription2' + storagequeue_endpoint_id = '/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo/queueservices/default/queues/kalsdemoqueue' + deadletter_endpoint_id = '/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo/blobServices/default/containers/dlq' + hybridconnection_endpoint_id = '/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourcegroups/kalstest/providers/Microsoft.Relay/namespaces/kalsdemo' + + self.kwargs.update({ + 'event_subscription_name1': event_subscription_name1, + 'event_subscription_name2': event_subscription_name2, + 'storagequeue_endpoint_id': storagequeue_endpoint_id, + 'deadletter_endpoint_id': deadletter_endpoint_id, + 'hybridconnection_endpoint_id': hybridconnection_endpoint_id + }) + + # Failure cases + # Invalid Event TTL value + with self.assertRaises(CLIError) as ex2: + self.cmd('az eventgrid event-subscription create -g {rg} --name {event_subscription_name1} --endpoint-type storagequeue --endpoint {storagequeue_endpoint_id} --event-ttl 2000 --deadletter-endpoint {deadletter_endpoint_id}') + + # Invalid max delivery attempts value + with self.assertRaises(CLIError) as ex3: + self.cmd('az eventgrid event-subscription create -g {rg} --name {event_subscription_name1} --endpoint-type storagequeue --endpoint {storagequeue_endpoint_id} --max-delivery-attempts 31 --deadletter-endpoint {deadletter_endpoint_id}') + + # Create a storage queue destination based event subscription with cloud event schema as the delivery schema + self.cmd('az eventgrid event-subscription create -g {rg} --name {event_subscription_name1} --endpoint-type stoRAgequeue --endpoint {storagequeue_endpoint_id} --event-delivery-schema cloudeventv01schema --deadletter-endpoint {deadletter_endpoint_id}') + + self.cmd('az eventgrid event-subscription show -g {rg} --name {event_subscription_name1}', checks=[ + self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('provisioningState', 'Succeeded'), + ]) + + # Create a hybridconnection destination based event subscription with default eventgrid event schema as the delivery schema + self.cmd('az eventgrid event-subscription create -g {rg} --name {event_subscription_name2} --endpoint-type HybRidConnection --endpoint {hybridconnection_endpoint_id} --deadletter-endpoint {deadletter_endpoint_id} --max-delivery-attempts 20 --event-ttl 1000') + + self.cmd('az eventgrid event-subscription show -g {rg} --name {event_subscription_name2}', checks=[ + self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), + self.check('provisioningState', 'Succeeded'), + ]) + + self.cmd('az eventgrid event-subscription delete --resource-group {rg} --name {event_subscription_name1}') From ebc5e5aa10dc7438ecbf11f12d612dbace5c2e14 Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Wed, 25 Apr 2018 15:37:42 -0700 Subject: [PATCH 05/14] Updated test recordings. --- ...t_subscriptions_to_arm_resource_group.yaml | 192 +++++++-- ..._subscriptions_with_20180501_features.yaml | 173 +++++++-- ...eate_event_subscriptions_with_filters.yaml | 129 ++++-- .../latest/recordings/test_create_topic.yaml | 367 +++++++++++------- .../tests/latest/test_eventgrid_commands.py | 2 +- 5 files changed, 627 insertions(+), 236 deletions(-) diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml index 2a13a45b379..f4340bde17b 100644 --- a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml @@ -1,7 +1,7 @@ interactions: - request: body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", - "date": "2018-04-25T00:49:12Z"}}' + "date": "2018-04-25T22:16:13Z"}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] @@ -16,17 +16,17 @@ interactions: method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-25T00:49:12Z"},"properties":{"provisioningState":"Succeeded"}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-25T22:16:13Z"},"properties":{"provisioningState":"Succeeded"}}'} headers: cache-control: [no-cache] content-length: ['384'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:49:15 GMT'] + date: ['Wed, 25 Apr 2018 22:16:15 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1139'] + x-ms-ratelimit-remaining-subscription-writes: ['1090'] status: {code: 201, message: Created} - request: body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": @@ -50,17 +50,17 @@ interactions: response: body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix"},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/7A1D68BF-ED6E-42E7-9F4A-1B55704BF790?api-version=2018-05-01-preview'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/F55D534C-BAD9-4DAA-9004-5802EB047A2E?api-version=2018-05-01-preview'] cache-control: [no-cache] content-length: ['825'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:49:17 GMT'] + date: ['Wed, 25 Apr 2018 22:16:16 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1126'] + x-ms-ratelimit-remaining-subscription-writes: ['1115'] status: {code: 201, message: Created} - request: body: null @@ -73,14 +73,14 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/7A1D68BF-ED6E-42E7-9F4A-1B55704BF790?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/F55D534C-BAD9-4DAA-9004-5802EB047A2E?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/7A1D68BF-ED6E-42E7-9F4A-1B55704BF790?api-version=2018-05-01-preview","name":"7a1d68bf-ed6e-42e7-9f4a-1b55704bf790","status":"Succeeded"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/F55D534C-BAD9-4DAA-9004-5802EB047A2E?api-version=2018-05-01-preview","name":"f55d534c-bad9-4daa-9004-5802eb047a2e","status":"Succeeded"}'} headers: cache-control: [no-cache] content-length: ['270'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:49:28 GMT'] + date: ['Wed, 25 Apr 2018 22:16:27 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -107,7 +107,7 @@ interactions: cache-control: [no-cache] content-length: ['876'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:49:29 GMT'] + date: ['Wed, 25 Apr 2018 22:16:28 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -136,7 +136,7 @@ interactions: cache-control: [no-cache] content-length: ['876'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:49:30 GMT'] + date: ['Wed, 25 Apr 2018 22:16:29 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -165,7 +165,7 @@ interactions: cache-control: [no-cache] content-length: ['876'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:49:31 GMT'] + date: ['Wed, 25 Apr 2018 22:16:30 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -174,6 +174,37 @@ interactions: vary: [Accept-Encoding] x-content-type-options: [nosniff] status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2/getFullUrl?api-version=2018-05-01-preview + response: + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} + headers: + cache-control: [no-cache] + connection: [close] + content-length: ['147'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:17:30 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} - request: body: null headers: @@ -195,7 +226,7 @@ interactions: cache-control: [no-cache] content-length: ['138'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:49:32 GMT'] + date: ['Wed, 25 Apr 2018 22:17:31 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -203,8 +234,38 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1123'] + x-ms-ratelimit-remaining-subscription-writes: ['1153'] status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview + response: + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} + headers: + cache-control: [no-cache] + connection: [close] + content-length: ['147'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:18:31 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} - request: body: null headers: @@ -225,7 +286,7 @@ interactions: cache-control: [no-cache] content-length: ['876'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:49:32 GMT'] + date: ['Wed, 25 Apr 2018 22:18:32 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -255,17 +316,17 @@ interactions: response: body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Updating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/0CF66B41-3034-4314-AA4F-987A0E981F99?api-version=2018-05-01-preview'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/F45DA0EF-0491-4E92-B0DC-945633E8492D?api-version=2018-05-01-preview'] cache-control: [no-cache] content-length: ['879'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:49:34 GMT'] + date: ['Wed, 25 Apr 2018 22:18:34 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1173'] + x-ms-ratelimit-remaining-subscription-writes: ['1117'] status: {code: 201, message: Created} - request: body: null @@ -278,14 +339,14 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/0CF66B41-3034-4314-AA4F-987A0E981F99?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/F45DA0EF-0491-4E92-B0DC-945633E8492D?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/0CF66B41-3034-4314-AA4F-987A0E981F99?api-version=2018-05-01-preview","name":"0cf66b41-3034-4314-aa4f-987a0e981f99","status":"Succeeded"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/F45DA0EF-0491-4E92-B0DC-945633E8492D?api-version=2018-05-01-preview","name":"f45da0ef-0491-4e92-b0dc-945633e8492d","status":"Succeeded"}'} headers: cache-control: [no-cache] content-length: ['270'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:49:45 GMT'] + date: ['Wed, 25 Apr 2018 22:18:44 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -307,12 +368,12 @@ interactions: method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] - content-length: ['767'] + content-length: ['880'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:49:45 GMT'] + date: ['Wed, 25 Apr 2018 22:18:45 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -336,12 +397,12 @@ interactions: method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-05-01-preview response: - body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} + body: {string: '{"value":[{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"mysubject_prefix","subjectEndsWith":".jpg","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}]}'} headers: cache-control: [no-cache] - content-length: ['779'] + content-length: ['892'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:49:47 GMT'] + date: ['Wed, 25 Apr 2018 22:18:46 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -350,6 +411,37 @@ interactions: vary: [Accept-Encoding] x-content-type-options: [nosniff] status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview + response: + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} + headers: + cache-control: [no-cache] + connection: [close] + content-length: ['147'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:19:47 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} - request: body: null headers: @@ -370,14 +462,14 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:49:48 GMT'] + date: ['Wed, 25 Apr 2018 22:19:48 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/2C7B3BC1-A96E-456C-927A-57D22046D615?api-version=2018-05-01-preview'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/39AAF5F8-501E-4D4E-9CF6-7C24B5113A11?api-version=2018-05-01-preview'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1168'] + x-ms-ratelimit-remaining-subscription-writes: ['1180'] status: {code: 202, message: Accepted} - request: body: null @@ -390,13 +482,41 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/2C7B3BC1-A96E-456C-927A-57D22046D615?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/39AAF5F8-501E-4D4E-9CF6-7C24B5113A11?api-version=2018-05-01-preview + response: + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} + headers: + cache-control: [no-cache] + connection: [close] + content-length: ['147'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:20:58 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription delete] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/39AAF5F8-501E-4D4E-9CF6-7C24B5113A11?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:49:58 GMT'] + date: ['Wed, 25 Apr 2018 22:20:59 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -423,12 +543,12 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:50:00 GMT'] + date: ['Wed, 25 Apr 2018 22:21:00 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdTNkIyMkg3TDNVQU80VUgyTzVLNEk1SkhOSzZNWkNPUVhXM3xGQTQyMUE1OUI4Qzc0MzUxLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdKVERKSjNTS0xRNTUyTU5BNFVUQlZGN08yWklBNUFaS01JTHw1RUMwRTE5QzdDRDREOTYxLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1155'] + x-ms-ratelimit-remaining-subscription-writes: ['1175'] status: {code: 202, message: Accepted} version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_20180501_features.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_20180501_features.yaml index 19e1a95cfe5..7d3f56cfeed 100644 --- a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_20180501_features.yaml +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_20180501_features.yaml @@ -1,7 +1,7 @@ interactions: - request: body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", - "date": "2018-04-25T00:50:01Z"}}' + "date": "2018-04-25T22:21:01Z"}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] @@ -16,17 +16,17 @@ interactions: method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-25T00:50:01Z"},"properties":{"provisioningState":"Succeeded"}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-25T22:21:01Z"},"properties":{"provisioningState":"Succeeded"}}'} headers: cache-control: [no-cache] content-length: ['384'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:50:01 GMT'] + date: ['Wed, 25 Apr 2018 22:21:02 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1143'] + x-ms-ratelimit-remaining-subscription-writes: ['1129'] status: {code: 201, message: Created} - request: body: '{"properties": {"destination": {"endpointType": "StorageQueue", "properties": @@ -48,21 +48,21 @@ interactions: AZURECLI/2.0.31] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription1?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","queueName":"kalsdemoqueue"},"endpointType":"StorageQueue"},"filter":{},"labels":null,"eventDeliverySchema":"CloudEventV01Schema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440},"deadLetterDestination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","blobContainerName":"dlq"},"endpointType":"StorageBlob"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5","name":"eventsubscription5","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","queueName":"kalsdemoqueue"},"endpointType":"StorageQueue"},"filter":{},"labels":null,"eventDeliverySchema":"CloudEventV01Schema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440},"deadLetterDestination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","blobContainerName":"dlq"},"endpointType":"StorageBlob"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription1","name":"eventsubscription1","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/6BF559CA-3C43-464A-A88C-BBE58D248A6C?api-version=2018-05-01-preview'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/1D380517-F077-4CF3-9E2C-2C5F09C99004?api-version=2018-05-01-preview'] cache-control: [no-cache] content-length: ['1110'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:50:03 GMT'] + date: ['Wed, 25 Apr 2018 22:21:04 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1125'] + x-ms-ratelimit-remaining-subscription-writes: ['1149'] status: {code: 201, message: Created} - request: body: null @@ -75,14 +75,14 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/6BF559CA-3C43-464A-A88C-BBE58D248A6C?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/1D380517-F077-4CF3-9E2C-2C5F09C99004?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/6BF559CA-3C43-464A-A88C-BBE58D248A6C?api-version=2018-05-01-preview","name":"6bf559ca-3c43-464a-a88c-bbe58d248a6c","status":"Succeeded"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/1D380517-F077-4CF3-9E2C-2C5F09C99004?api-version=2018-05-01-preview","name":"1d380517-f077-4cf3-9e2c-2c5f09c99004","status":"Succeeded"}'} headers: cache-control: [no-cache] content-length: ['270'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:50:14 GMT'] + date: ['Wed, 25 Apr 2018 22:21:15 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -102,14 +102,14 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription1?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","queueName":"kalsdemoqueue"},"endpointType":"StorageQueue"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"CloudEventV01Schema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440},"deadLetterDestination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","blobContainerName":"dlq"},"endpointType":"StorageBlob"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5","name":"eventsubscription5","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","queueName":"kalsdemoqueue"},"endpointType":"StorageQueue"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"CloudEventV01Schema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440},"deadLetterDestination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","blobContainerName":"dlq"},"endpointType":"StorageBlob"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription1","name":"eventsubscription1","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] content-length: ['1183'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:50:14 GMT'] + date: ['Wed, 25 Apr 2018 22:21:15 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -131,14 +131,133 @@ interactions: AZURECLI/2.0.31] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription1?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","queueName":"kalsdemoqueue"},"endpointType":"StorageQueue"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"CloudEventV01Schema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440},"deadLetterDestination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","blobContainerName":"dlq"},"endpointType":"StorageBlob"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5","name":"eventsubscription5","type":"Microsoft.EventGrid/eventSubscriptions"}'} + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","queueName":"kalsdemoqueue"},"endpointType":"StorageQueue"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"CloudEventV01Schema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440},"deadLetterDestination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","blobContainerName":"dlq"},"endpointType":"StorageBlob"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription1","name":"eventsubscription1","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: cache-control: [no-cache] content-length: ['1183'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:50:15 GMT'] + date: ['Wed, 25 Apr 2018 22:21:16 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"properties": {"destination": {"endpointType": "HybridConnection", "properties": + {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Relay/namespaces/kalsdemo/hybridConnections/kalstest"}}, + "filter": {"isSubjectCaseSensitive": false}, "eventDeliverySchema": "EventGridSchema", + "retryPolicy": {"maxDeliveryAttempts": 20, "eventTimeToLiveInMinutes": 1000}, + "deadLetterDestination": {"endpointType": "StorageBlob", "properties": {"resourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo", + "blobContainerName": "dlq"}}}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + Content-Length: ['664'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Relay/namespaces/kalsdemo/hybridConnections/kalstest"},"endpointType":"HybridConnection"},"filter":{},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":20,"eventTimeToLiveInMinutes":1000},"deadLetterDestination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","blobContainerName":"dlq"},"endpointType":"StorageBlob"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/B11651B8-B933-4A4E-9492-980C56EE3C67?api-version=2018-05-01-preview'] + cache-control: [no-cache] + content-length: ['1102'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:21:19 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1170'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/B11651B8-B933-4A4E-9492-980C56EE3C67?api-version=2018-05-01-preview + response: + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/B11651B8-B933-4A4E-9492-980C56EE3C67?api-version=2018-05-01-preview","name":"b11651b8-b933-4a4e-9492-980c56ee3c67","status":"Succeeded"}'} + headers: + cache-control: [no-cache] + content-length: ['270'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:21:30 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Relay/namespaces/kalsdemo/hybridConnections/kalstest"},"endpointType":"HybridConnection"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":20,"eventTimeToLiveInMinutes":1000},"deadLetterDestination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","blobContainerName":"dlq"},"endpointType":"StorageBlob"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['1175'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:21:30 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview + response: + body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Succeeded","destination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Relay/namespaces/kalsdemo/hybridConnections/kalstest"},"endpointType":"HybridConnection"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":20,"eventTimeToLiveInMinutes":1000},"deadLetterDestination":{"properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo","blobContainerName":"dlq"},"endpointType":"StorageBlob"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} + headers: + cache-control: [no-cache] + content-length: ['1175'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:21:31 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -161,20 +280,20 @@ interactions: AZURECLI/2.0.31] accept-language: [en-US] method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription5?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription1?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:50:15 GMT'] + date: ['Wed, 25 Apr 2018 22:21:33 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/9AF334B8-EB70-4422-B3B6-E07B718AC398?api-version=2018-05-01-preview'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/FD1C137E-03D1-4113-A317-4692D40A3AD2?api-version=2018-05-01-preview'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1165'] + x-ms-ratelimit-remaining-subscription-writes: ['1162'] status: {code: 202, message: Accepted} - request: body: null @@ -187,13 +306,13 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/9AF334B8-EB70-4422-B3B6-E07B718AC398?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/FD1C137E-03D1-4113-A317-4692D40A3AD2?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:50:26 GMT'] + date: ['Wed, 25 Apr 2018 22:21:44 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -220,12 +339,12 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:50:28 GMT'] + date: ['Wed, 25 Apr 2018 22:21:45 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkc2RFRPRzNFT1dSN0RZQVNOWkRBVTIzRExNUUg2UUtZNkhCTHwwREUyRjZENUIyMTE4NEEwLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdUR002SlpJRkk0Rk1KRlBHQVZMU1JBWlFXWTVKSk5KTVlTUHw3Q0U3QjQ3QzhDODE2RTE0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1085'] + x-ms-ratelimit-remaining-subscription-writes: ['1149'] status: {code: 202, message: Accepted} version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml index 8328d5facfc..eab1d1b8546 100644 --- a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml @@ -1,7 +1,7 @@ interactions: - request: body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", - "date": "2018-04-25T00:50:28Z"}}' + "date": "2018-04-25T22:21:45Z"}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] @@ -16,17 +16,17 @@ interactions: method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-25T00:50:28Z"},"properties":{"provisioningState":"Succeeded"}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-25T22:21:45Z"},"properties":{"provisioningState":"Succeeded"}}'} headers: cache-control: [no-cache] content-length: ['384'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:50:29 GMT'] + date: ['Wed, 25 Apr 2018 22:21:46 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1134'] + x-ms-ratelimit-remaining-subscription-writes: ['1173'] status: {code: 201, message: Created} - request: body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": @@ -51,17 +51,17 @@ interactions: response: body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectEndsWith":"mysubject_suffix","includedEventTypes":["blobCreated","blobUpdated"],"isSubjectCaseSensitive":true},"labels":["Finance","HR"],"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2","name":"eventsubscription2","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/3A0FA8DB-5E8E-4E78-86DA-AB8CF1695EAF?api-version=2018-05-01-preview'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/0826EDCE-5A43-4AB4-B2C1-12E645EF49E8?api-version=2018-05-01-preview'] cache-control: [no-cache] content-length: ['916'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:50:30 GMT'] + date: ['Wed, 25 Apr 2018 22:21:48 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1170'] + x-ms-ratelimit-remaining-subscription-writes: ['1178'] status: {code: 201, message: Created} - request: body: null @@ -74,14 +74,14 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/3A0FA8DB-5E8E-4E78-86DA-AB8CF1695EAF?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/0826EDCE-5A43-4AB4-B2C1-12E645EF49E8?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/3A0FA8DB-5E8E-4E78-86DA-AB8CF1695EAF?api-version=2018-05-01-preview","name":"3a0fa8db-5e8e-4e78-86da-ab8cf1695eaf","status":"InProgress"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/0826EDCE-5A43-4AB4-B2C1-12E645EF49E8?api-version=2018-05-01-preview","name":"0826edce-5a43-4ab4-b2c1-12e645ef49e8","status":"Succeeded"}'} headers: cache-control: [no-cache] - content-length: ['271'] + content-length: ['270'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:50:42 GMT'] + date: ['Wed, 25 Apr 2018 22:21:59 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -101,22 +101,23 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/3A0FA8DB-5E8E-4E78-86DA-AB8CF1695EAF?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationsStatus/3A0FA8DB-5E8E-4E78-86DA-AB8CF1695EAF?api-version=2018-05-01-preview","name":"3a0fa8db-5e8e-4e78-86da-ab8cf1695eaf","status":"Succeeded"}'} + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} headers: cache-control: [no-cache] - content-length: ['270'] + connection: [close] + content-length: ['147'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:51:12 GMT'] + date: ['Wed, 25 Apr 2018 22:22:59 GMT'] expires: ['-1'] pragma: [no-cache] - server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] x-content-type-options: [nosniff] - status: {code: 200, message: OK} + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} - request: body: null headers: @@ -135,7 +136,7 @@ interactions: cache-control: [no-cache] content-length: ['940'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:51:13 GMT'] + date: ['Wed, 25 Apr 2018 22:22:59 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -164,7 +165,7 @@ interactions: cache-control: [no-cache] content-length: ['940'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:51:14 GMT'] + date: ['Wed, 25 Apr 2018 22:23:01 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -173,6 +174,36 @@ interactions: vary: [Accept-Encoding] x-content-type-options: [nosniff] status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions/eventsubscription2?api-version=2018-05-01-preview + response: + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} + headers: + cache-control: [no-cache] + connection: [close] + content-length: ['147'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:24:01 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} - request: body: null headers: @@ -193,7 +224,7 @@ interactions: cache-control: [no-cache] content-length: ['940'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:51:15 GMT'] + date: ['Wed, 25 Apr 2018 22:24:01 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -226,7 +257,7 @@ interactions: connection: [close] content-length: ['147'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:52:14 GMT'] + date: ['Wed, 25 Apr 2018 22:25:02 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -254,7 +285,7 @@ interactions: cache-control: [no-cache] content-length: ['138'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:52:15 GMT'] + date: ['Wed, 25 Apr 2018 22:25:02 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -262,8 +293,38 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1126'] + x-ms-ratelimit-remaining-subscription-writes: ['1166'] status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2018-05-01-preview + response: + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} + headers: + cache-control: [no-cache] + connection: [close] + content-length: ['147'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:26:03 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} - request: body: null headers: @@ -284,7 +345,7 @@ interactions: cache-control: [no-cache] content-length: ['952'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:52:16 GMT'] + date: ['Wed, 25 Apr 2018 22:26:05 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -313,14 +374,14 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:52:19 GMT'] + date: ['Wed, 25 Apr 2018 22:26:08 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/ED9C8338-7874-4970-B83F-C4135105CAFB?api-version=2018-05-01-preview'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/84440EC7-D9FF-447E-B67A-E0C5FF118E29?api-version=2018-05-01-preview'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1124'] + x-ms-ratelimit-remaining-subscription-writes: ['1144'] status: {code: 202, message: Accepted} - request: body: null @@ -333,13 +394,13 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/ED9C8338-7874-4970-B83F-C4135105CAFB?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/operationResults/84440EC7-D9FF-447E-B67A-E0C5FF118E29?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:52:29 GMT'] + date: ['Wed, 25 Apr 2018 22:26:18 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -366,12 +427,12 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:52:30 GMT'] + date: ['Wed, 25 Apr 2018 22:26:20 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdMT1U3NExDTDQ3RkVRUTRVSlVENzNCS0hVUUpEU1o1M1JLTnxGQzMxMDU1NzU2MURCRENDLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkc2NlVYQkNWREVUQVFETFRXUldaRzNJREpQRVZGUEJKSjRNSnw3RTRBNUREN0JFRDE4QUY1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1129'] + x-ms-ratelimit-remaining-subscription-writes: ['1128'] status: {code: 202, message: Accepted} version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml index 896dd28d404..bd1ce2c28f9 100644 --- a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml @@ -1,7 +1,7 @@ interactions: - request: body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", - "date": "2018-04-25T00:52:31Z"}}' + "date": "2018-04-25T22:26:20Z"}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] @@ -16,17 +16,17 @@ interactions: method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-25T00:52:31Z"},"properties":{"provisioningState":"Succeeded"}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-25T22:26:20Z"},"properties":{"provisioningState":"Succeeded"}}'} headers: cache-control: [no-cache] content-length: ['384'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:52:31 GMT'] + date: ['Wed, 25 Apr 2018 22:26:21 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1141'] + x-ms-ratelimit-remaining-subscription-writes: ['1119'] status: {code: 201, message: Created} - request: body: '{"location": "eastus2euap", "properties": {"inputSchema": "EventGridSchema"}}' @@ -46,11 +46,11 @@ interactions: response: body: {string: '{"properties":{"provisioningState":"Creating","endpoint":null,"inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/516029EA-E4F3-4A75-ADC9-9D27456872BB?api-version=2018-05-01-preview'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/16962264-979B-4706-9629-B8BE6D466456?api-version=2018-05-01-preview'] cache-control: [no-cache] content-length: ['446'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:52:33 GMT'] + date: ['Wed, 25 Apr 2018 22:26:23 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -69,14 +69,14 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/516029EA-E4F3-4A75-ADC9-9D27456872BB?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/16962264-979B-4706-9629-B8BE6D466456?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/516029EA-E4F3-4A75-ADC9-9D27456872BB?api-version=2018-05-01-preview","name":"516029ea-e4f3-4a75-adc9-9d27456872bb","status":"Succeeded"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/16962264-979B-4706-9629-B8BE6D466456?api-version=2018-05-01-preview","name":"16962264-979b-4706-9629-b8be6d466456","status":"Succeeded"}'} headers: cache-control: [no-cache] content-length: ['292'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:52:43 GMT'] + date: ['Wed, 25 Apr 2018 22:26:33 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -103,7 +103,7 @@ interactions: cache-control: [no-cache] content-length: ['538'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:52:45 GMT'] + date: ['Wed, 25 Apr 2018 22:26:34 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -132,7 +132,7 @@ interactions: cache-control: [no-cache] content-length: ['538'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:52:45 GMT'] + date: ['Wed, 25 Apr 2018 22:26:34 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -159,17 +159,17 @@ interactions: response: body: {string: '{"properties":{"provisioningState":"Creating","endpoint":null,"inputSchema":"CloudEventV01Schema"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000003","name":"cli000003","type":"Microsoft.EventGrid/topics"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/A49148D7-7FDD-482D-9616-2CB7BB487FEE?api-version=2018-05-01-preview'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/BE3710D6-4137-4929-8F9B-8C471BC98D10?api-version=2018-05-01-preview'] cache-control: [no-cache] content-length: ['450'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:52:47 GMT'] + date: ['Wed, 25 Apr 2018 22:26:36 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1167'] + x-ms-ratelimit-remaining-subscription-writes: ['1140'] status: {code: 201, message: Created} - request: body: null @@ -182,14 +182,14 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/A49148D7-7FDD-482D-9616-2CB7BB487FEE?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/BE3710D6-4137-4929-8F9B-8C471BC98D10?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/A49148D7-7FDD-482D-9616-2CB7BB487FEE?api-version=2018-05-01-preview","name":"a49148d7-7fdd-482d-9616-2cb7bb487fee","status":"Succeeded"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/BE3710D6-4137-4929-8F9B-8C471BC98D10?api-version=2018-05-01-preview","name":"be3710d6-4137-4929-8f9b-8c471bc98d10","status":"Succeeded"}'} headers: cache-control: [no-cache] content-length: ['292'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:52:58 GMT'] + date: ['Wed, 25 Apr 2018 22:26:47 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -216,7 +216,7 @@ interactions: cache-control: [no-cache] content-length: ['542'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:52:58 GMT'] + date: ['Wed, 25 Apr 2018 22:26:58 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -225,6 +225,41 @@ interactions: vary: [Accept-Encoding] x-content-type-options: [nosniff] status: {code: 200, message: OK} +- request: + body: '{"location": "eastus2euap", "properties": {"inputSchema": "CustomEventSchema", + "inputSchemaMapping": {"inputSchemaMappingType": "Json", "properties": {"id": + {}, "topic": {"sourceField": "myTopicField"}, "eventTime": {}, "eventType": + {"sourceField": "myEventTypeField"}, "subject": {"defaultValue": "DefaultSubject"}, + "dataVersion": {"defaultValue": "1.0"}}}}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + Content-Length: ['359'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000004?api-version=2018-05-01-preview + response: + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} + headers: + cache-control: [no-cache] + connection: [close] + content-length: ['147'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:27:58 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} - request: body: '{"location": "eastus2euap", "properties": {"inputSchema": "CustomEventSchema", "inputSchemaMapping": {"inputSchemaMappingType": "Json", "properties": {"id": @@ -247,17 +282,17 @@ interactions: response: body: {string: '{"properties":{"provisioningState":"Creating","endpoint":null,"inputSchema":"CustomEventSchema","inputSchemaMapping":{"properties":{"id":{"sourceField":null},"topic":{"sourceField":"myTopicField"},"eventTime":{"sourceField":null},"eventType":{"sourceField":"myEventTypeField","defaultValue":null},"subject":{"sourceField":null,"defaultValue":"DefaultSubject"},"dataVersion":{"sourceField":null,"defaultValue":"1.0"}},"inputSchemaMappingType":"Json"}},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000004","name":"cli000004","type":"Microsoft.EventGrid/topics"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/336814BD-7426-4C44-B192-6865AC1DBF44?api-version=2018-05-01-preview'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/59850CB8-ED79-4AAD-AFE7-9FA2C88EAA33?api-version=2018-05-01-preview'] cache-control: [no-cache] content-length: ['802'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:53:01 GMT'] + date: ['Wed, 25 Apr 2018 22:28:01 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1171'] + x-ms-ratelimit-remaining-subscription-writes: ['1177'] status: {code: 201, message: Created} - request: body: null @@ -270,14 +305,42 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/336814BD-7426-4C44-B192-6865AC1DBF44?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/59850CB8-ED79-4AAD-AFE7-9FA2C88EAA33?api-version=2018-05-01-preview + response: + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} + headers: + cache-control: [no-cache] + connection: [close] + content-length: ['147'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:29:13 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/59850CB8-ED79-4AAD-AFE7-9FA2C88EAA33?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/336814BD-7426-4C44-B192-6865AC1DBF44?api-version=2018-05-01-preview","name":"336814bd-7426-4c44-b192-6865ac1dbf44","status":"Succeeded"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/59850CB8-ED79-4AAD-AFE7-9FA2C88EAA33?api-version=2018-05-01-preview","name":"59850cb8-ed79-4aad-afe7-9fa2c88eaa33","status":"Succeeded"}'} headers: cache-control: [no-cache] content-length: ['292'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:53:11 GMT'] + date: ['Wed, 25 Apr 2018 22:29:13 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -304,7 +367,7 @@ interactions: cache-control: [no-cache] content-length: ['894'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:53:12 GMT'] + date: ['Wed, 25 Apr 2018 22:29:14 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -336,7 +399,7 @@ interactions: connection: [close] content-length: ['147'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:54:12 GMT'] + date: ['Wed, 25 Apr 2018 22:30:15 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -363,7 +426,7 @@ interactions: cache-control: [no-cache] content-length: ['538'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:54:13 GMT'] + date: ['Wed, 25 Apr 2018 22:30:14 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -388,47 +451,51 @@ interactions: method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"provisioningState":"Updating","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/3B502A2B-A890-439F-BAB8-066E12401479?api-version=2018-05-01-preview'] cache-control: [no-cache] - content-length: ['546'] + connection: [close] + content-length: ['147'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:54:15 GMT'] + date: ['Wed, 25 Apr 2018 22:31:15 GMT'] expires: ['-1'] pragma: [no-cache] - server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1161'] - status: {code: 201, message: Created} + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} - request: - body: null + body: '{"tags": {"Dept": "IT"}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] CommandName: [eventgrid topic update] Connection: [keep-alive] + Content-Length: ['24'] + Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/3B502A2B-A890-439F-BAB8-066E12401479?api-version=2018-05-01-preview + accept-language: [en-US] + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/3B502A2B-A890-439F-BAB8-066E12401479?api-version=2018-05-01-preview","name":"3b502a2b-a890-439f-bab8-066e12401479","status":"Succeeded"}'} + body: {string: '{"properties":{"provisioningState":"Updating","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} headers: + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/4798C616-5004-473D-B3F6-3679683162E2?api-version=2018-05-01-preview'] cache-control: [no-cache] - content-length: ['292'] + content-length: ['546'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:54:25 GMT'] + date: ['Wed, 25 Apr 2018 22:31:16 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] x-content-type-options: [nosniff] - status: {code: 200, message: OK} + x-ms-ratelimit-remaining-subscription-writes: ['1148'] + status: {code: 201, message: Created} - request: body: null headers: @@ -440,14 +507,14 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/4798C616-5004-473D-B3F6-3679683162E2?api-version=2018-05-01-preview response: - body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/4798C616-5004-473D-B3F6-3679683162E2?api-version=2018-05-01-preview","name":"4798c616-5004-473d-b3f6-3679683162e2","status":"Succeeded"}'} headers: cache-control: [no-cache] - content-length: ['547'] + content-length: ['292'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:54:25 GMT'] + date: ['Wed, 25 Apr 2018 22:31:28 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -461,22 +528,20 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [eventgrid topic list] + CommandName: [eventgrid topic update] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] - accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2018-05-01-preview response: - body: {string: '{"value":[{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"},{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000003.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"CloudEventV01Schema"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000003","name":"cli000003","type":"Microsoft.EventGrid/topics"},{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000004.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"CustomEventSchema","inputSchemaMapping":{"properties":{"id":{"sourceField":null},"topic":{"sourceField":"myTopicField"},"eventTime":{"sourceField":null},"eventType":{"sourceField":"myEventTypeField","defaultValue":null},"subject":{"sourceField":null,"defaultValue":"DefaultSubject"},"dataVersion":{"sourceField":null,"defaultValue":"1.0"}},"inputSchemaMappingType":"Json"}},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000004","name":"cli000004","type":"Microsoft.EventGrid/topics"}]}'} + body: {string: '{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"}'} headers: cache-control: [no-cache] - content-length: ['1997'] + content-length: ['547'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:54:27 GMT'] + date: ['Wed, 25 Apr 2018 22:31:28 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -490,32 +555,30 @@ interactions: headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] - CommandName: [eventgrid topic key list] + CommandName: [eventgrid topic list] Connection: [keep-alive] - Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] accept-language: [en-US] - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/listKeys?api-version=2018-05-01-preview + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics?api-version=2018-05-01-preview response: - body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not - receive a response from ''Microsoft.EventGrid'' within the specified time - period."}}'} + body: {string: '{"value":[{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000002.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"EventGridSchema"},"location":"eastus2euap","tags":{"Dept":"IT"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002","name":"cli000002","type":"Microsoft.EventGrid/topics"},{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000003.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"CloudEventV01Schema"},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000003","name":"cli000003","type":"Microsoft.EventGrid/topics"},{"properties":{"provisioningState":"Succeeded","endpoint":"https://cli000004.eastus2euap-1.eventgrid.azure.net/api/events","inputSchema":"CustomEventSchema","inputSchemaMapping":{"properties":{"id":{"sourceField":null},"topic":{"sourceField":"myTopicField"},"eventTime":{"sourceField":null},"eventType":{"sourceField":"myEventTypeField","defaultValue":null},"subject":{"sourceField":null,"defaultValue":"DefaultSubject"},"dataVersion":{"sourceField":null,"defaultValue":"1.0"}},"inputSchemaMappingType":"Json"}},"location":"eastus2euap","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000004","name":"cli000004","type":"Microsoft.EventGrid/topics"}]}'} headers: cache-control: [no-cache] - connection: [close] - content-length: ['147'] + content-length: ['1997'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:27 GMT'] + date: ['Wed, 25 Apr 2018 22:31:30 GMT'] expires: ['-1'] pragma: [no-cache] + server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-ms-failure-cause: [service] - status: {code: 504, message: Gateway Timeout} + status: {code: 200, message: OK} - request: body: null headers: @@ -532,12 +595,12 @@ interactions: method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/listKeys?api-version=2018-05-01-preview response: - body: {string: '{"key1":"fKlmVMhD0gLPU2ocz2hb6B+hmcAISPf/fZm87V7JUvY=","key2":"w/NVF1lH6RBJQNnLjgl2xmWRxLmLz0WB2K0OnVXV9Fg="}'} + body: {string: '{"key1":"OoLwLglcgw7YFEcSv6kFZm/sFiS8ct1WcVYHHm2jkBg=","key2":"3eqGKiGGQYx4JV0fs8PFCu4LVIiLHLtoLAOupThEAYc="}'} headers: cache-control: [no-cache] content-length: ['109'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:28 GMT'] + date: ['Wed, 25 Apr 2018 22:31:30 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -545,7 +608,7 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1168'] + x-ms-ratelimit-remaining-subscription-writes: ['1153'] status: {code: 200, message: OK} - request: body: '{"keyName": "key1"}' @@ -563,12 +626,12 @@ interactions: method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/regenerateKey?api-version=2018-05-01-preview response: - body: {string: '{"key1":"8bXRTW0X6V5b0PxDKhxtTZaY1tNp5/tWO6zXkWjW6Lk=","key2":"w/NVF1lH6RBJQNnLjgl2xmWRxLmLz0WB2K0OnVXV9Fg="}'} + body: {string: '{"key1":"EIC76AhTgFpC8WwRHtcTlM4x3hpmZSwIE8qBzyQWBpU=","key2":"3eqGKiGGQYx4JV0fs8PFCu4LVIiLHLtoLAOupThEAYc="}'} headers: cache-control: [no-cache] content-length: ['109'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:29 GMT'] + date: ['Wed, 25 Apr 2018 22:31:31 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -576,7 +639,7 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1139'] + x-ms-ratelimit-remaining-subscription-writes: ['1137'] status: {code: 200, message: OK} - request: body: '{"keyName": "key2"}' @@ -594,12 +657,12 @@ interactions: method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/regenerateKey?api-version=2018-05-01-preview response: - body: {string: '{"key1":"8bXRTW0X6V5b0PxDKhxtTZaY1tNp5/tWO6zXkWjW6Lk=","key2":"CHoEC30kIox5DNk6ODnm++D92NNdmUsX9DYS9CRvLys="}'} + body: {string: '{"key1":"EIC76AhTgFpC8WwRHtcTlM4x3hpmZSwIE8qBzyQWBpU=","key2":"MlG5FZqZy3kfUYR4vJcEV7B5qkge+gtJZNSvuyEULnM="}'} headers: cache-control: [no-cache] content-length: ['109'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:30 GMT'] + date: ['Wed, 25 Apr 2018 22:31:32 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -607,7 +670,7 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1138'] + x-ms-ratelimit-remaining-subscription-writes: ['1155'] status: {code: 200, message: OK} - request: body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": @@ -630,17 +693,17 @@ interactions: response: body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Creating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005","name":"cli000005","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/E766DDBF-F639-41BF-B3DA-55C6594DCD25?api-version=2018-05-01-preview'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/292171BA-FEA2-4D18-B24F-A7C0E1280F29?api-version=2018-05-01-preview'] cache-control: [no-cache] content-length: ['987'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:32 GMT'] + date: ['Wed, 25 Apr 2018 22:31:33 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1152'] + x-ms-ratelimit-remaining-subscription-writes: ['1092'] status: {code: 201, message: Created} - request: body: null @@ -653,14 +716,14 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/E766DDBF-F639-41BF-B3DA-55C6594DCD25?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/292171BA-FEA2-4D18-B24F-A7C0E1280F29?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/E766DDBF-F639-41BF-B3DA-55C6594DCD25?api-version=2018-05-01-preview","name":"e766ddbf-f639-41bf-b3da-55c6594dcd25","status":"Succeeded"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/292171BA-FEA2-4D18-B24F-A7C0E1280F29?api-version=2018-05-01-preview","name":"292171ba-fea2-4d18-b24f-a7c0e1280f29","status":"Succeeded"}'} headers: cache-control: [no-cache] content-length: ['292'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:42 GMT'] + date: ['Wed, 25 Apr 2018 22:31:43 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -687,7 +750,7 @@ interactions: cache-control: [no-cache] content-length: ['1060'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:43 GMT'] + date: ['Wed, 25 Apr 2018 22:31:45 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -716,7 +779,7 @@ interactions: cache-control: [no-cache] content-length: ['1060'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:43 GMT'] + date: ['Wed, 25 Apr 2018 22:31:44 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -745,7 +808,7 @@ interactions: cache-control: [no-cache] content-length: ['1060'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:44 GMT'] + date: ['Wed, 25 Apr 2018 22:31:46 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -775,7 +838,7 @@ interactions: cache-control: [no-cache] content-length: ['138'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:45 GMT'] + date: ['Wed, 25 Apr 2018 22:31:46 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -783,7 +846,7 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1180'] + x-ms-ratelimit-remaining-subscription-writes: ['1164'] status: {code: 200, message: OK} - request: body: null @@ -805,7 +868,7 @@ interactions: cache-control: [no-cache] content-length: ['1060'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:46 GMT'] + date: ['Wed, 25 Apr 2018 22:31:47 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -835,17 +898,17 @@ interactions: response: body: {string: '{"properties":{"topic":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.eventgrid/topics/cli000002","provisioningState":"Updating","destination":{"properties":{"endpointUrl":null,"endpointBaseUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1"},"endpointType":"WebHook"},"filter":{"subjectBeginsWith":"","subjectEndsWith":"","includedEventTypes":["All"]},"labels":null,"eventDeliverySchema":"EventGridSchema","retryPolicy":{"maxDeliveryAttempts":30,"eventTimeToLiveInMinutes":1440}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005","name":"cli000005","type":"Microsoft.EventGrid/eventSubscriptions"}'} headers: - azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/8AC6881D-2028-4818-B844-40E41BEC234C?api-version=2018-05-01-preview'] + azure-asyncoperation: ['https://management.azure.com:443/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/9F7DD233-1D02-4296-966A-0C2E7DF0AC4A?api-version=2018-05-01-preview'] cache-control: [no-cache] content-length: ['1059'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:47 GMT'] + date: ['Wed, 25 Apr 2018 22:31:48 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1121'] + x-ms-ratelimit-remaining-subscription-writes: ['1125'] status: {code: 201, message: Created} - request: body: null @@ -858,14 +921,70 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/8AC6881D-2028-4818-B844-40E41BEC234C?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/9F7DD233-1D02-4296-966A-0C2E7DF0AC4A?api-version=2018-05-01-preview + response: + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} + headers: + cache-control: [no-cache] + connection: [close] + content-length: ['147'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:32:58 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/9F7DD233-1D02-4296-966A-0C2E7DF0AC4A?api-version=2018-05-01-preview + response: + body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not + receive a response from ''Microsoft.EventGrid'' within the specified time + period."}}'} + headers: + cache-control: [no-cache] + connection: [close] + content-length: ['147'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:33:58 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-failure-cause: [service] + status: {code: 504, message: Gateway Timeout} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid event-subscription update] + Connection: [keep-alive] + User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 + msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python + AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/9F7DD233-1D02-4296-966A-0C2E7DF0AC4A?api-version=2018-05-01-preview response: - body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/8AC6881D-2028-4818-B844-40E41BEC234C?api-version=2018-05-01-preview","name":"8ac6881d-2028-4818-b844-40e41bec234c","status":"Succeeded"}'} + body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationsStatus/9F7DD233-1D02-4296-966A-0C2E7DF0AC4A?api-version=2018-05-01-preview","name":"9f7dd233-1d02-4296-966a-0c2e7df0ac4a","status":"Succeeded"}'} headers: cache-control: [no-cache] content-length: ['292'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:58 GMT'] + date: ['Wed, 25 Apr 2018 22:34:01 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -892,7 +1011,7 @@ interactions: cache-control: [no-cache] content-length: ['1060'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:58 GMT'] + date: ['Wed, 25 Apr 2018 22:34:01 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -921,7 +1040,7 @@ interactions: cache-control: [no-cache] content-length: ['1072'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:55:59 GMT'] + date: ['Wed, 25 Apr 2018 22:34:03 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -950,14 +1069,14 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:56:00 GMT'] + date: ['Wed, 25 Apr 2018 22:34:04 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/2B91E2DE-A1A4-4D35-9ED2-6F75ED6F4DE4?api-version=2018-05-01-preview'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/98C8E589-047C-48E0-A859-C5EF9EA7B59C?api-version=2018-05-01-preview'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1189'] + x-ms-ratelimit-remaining-subscription-writes: ['1102'] status: {code: 202, message: Accepted} - request: body: null @@ -970,41 +1089,13 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/2B91E2DE-A1A4-4D35-9ED2-6F75ED6F4DE4?api-version=2018-05-01-preview - response: - body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not - receive a response from ''Microsoft.EventGrid'' within the specified time - period."}}'} - headers: - cache-control: [no-cache] - connection: [close] - content-length: ['147'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:57:10 GMT'] - expires: ['-1'] - pragma: [no-cache] - strict-transport-security: [max-age=31536000; includeSubDomains] - x-content-type-options: [nosniff] - x-ms-failure-cause: [service] - status: {code: 504, message: Gateway Timeout} -- request: - body: null - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - CommandName: [eventgrid event-subscription delete] - Connection: [keep-alive] - User-Agent: [python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.27 - msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python - AZURECLI/2.0.31] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/2B91E2DE-A1A4-4D35-9ED2-6F75ED6F4DE4?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/98C8E589-047C-48E0-A859-C5EF9EA7B59C?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:57:10 GMT'] + date: ['Wed, 25 Apr 2018 22:34:15 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -1031,14 +1122,14 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:57:13 GMT'] + date: ['Wed, 25 Apr 2018 22:34:16 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/155922BF-BCBE-4F0B-95B1-439C7475D2AA?api-version=2018-05-01-preview'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/A498E306-B3E4-478D-893D-798681AFB64D?api-version=2018-05-01-preview'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1129'] + x-ms-ratelimit-remaining-subscription-writes: ['1126'] status: {code: 202, message: Accepted} - request: body: null @@ -1051,7 +1142,7 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/155922BF-BCBE-4F0B-95B1-439C7475D2AA?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/A498E306-B3E4-478D-893D-798681AFB64D?api-version=2018-05-01-preview response: body: {string: '{"error":{"code":"GatewayTimeout","message":"The gateway did not receive a response from ''Microsoft.EventGrid'' within the specified time @@ -1061,7 +1152,7 @@ interactions: connection: [close] content-length: ['147'] content-type: [application/json; charset=utf-8] - date: ['Wed, 25 Apr 2018 00:58:23 GMT'] + date: ['Wed, 25 Apr 2018 22:35:26 GMT'] expires: ['-1'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] @@ -1079,13 +1170,13 @@ interactions: msrest_azure/0.4.25 azext_eventgrid-mgmt-eventgrid/2018-05-01-preview Azure-SDK-For-Python AZURECLI/2.0.31] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/155922BF-BCBE-4F0B-95B1-439C7475D2AA?api-version=2018-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus2euap/operationResults/A498E306-B3E4-478D-893D-798681AFB64D?api-version=2018-05-01-preview response: body: {string: ''} headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:58:23 GMT'] + date: ['Wed, 25 Apr 2018 22:35:27 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -1112,12 +1203,12 @@ interactions: headers: cache-control: [no-cache] content-length: ['0'] - date: ['Wed, 25 Apr 2018 00:58:25 GMT'] + date: ['Wed, 25 Apr 2018 22:35:28 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdBRUhXTEZWRUdKNzVDSDZaUjRYWVI3Q05YM003MjVTNDREQnw2RDJCNkJDM0M4RkU0OEI3LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdQU0JOUkJSSTdFWUtaNDNTU0M1SUY1WUwzR0FJRjJOVURBR3w4MEYxRjgxMzY1RDNGQzE3LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] pragma: [no-cache] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] - x-ms-ratelimit-remaining-subscription-writes: ['1177'] + x-ms-ratelimit-remaining-subscription-writes: ['1175'] status: {code: 202, message: Accepted} version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py b/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py index 0b5701a6d7a..d6932000c13 100644 --- a/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py +++ b/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py @@ -275,7 +275,7 @@ def test_create_event_subscriptions_with_20180501_features(self, resource_group) event_subscription_name2 = 'eventsubscription2' storagequeue_endpoint_id = '/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo/queueservices/default/queues/kalsdemoqueue' deadletter_endpoint_id = '/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourcegroups/kalstest/providers/Microsoft.Storage/storageAccounts/kalsdemo/blobServices/default/containers/dlq' - hybridconnection_endpoint_id = '/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourcegroups/kalstest/providers/Microsoft.Relay/namespaces/kalsdemo' + hybridconnection_endpoint_id = '/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourcegroups/kalstest/providers/Microsoft.Relay/namespaces/kalsdemo/hybridConnections/kalstest' self.kwargs.update({ 'event_subscription_name1': event_subscription_name1, From 6cee3d15ab979b9686955e0f214740473f5aa2fb Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Wed, 25 Apr 2018 16:01:45 -0700 Subject: [PATCH 06/14] Updated help text / minor refactoring. --- src/eventgrid/azext_eventgrid/_params.py | 8 +-- src/eventgrid/azext_eventgrid/custom.py | 91 ++++++++++++++---------- 2 files changed, 56 insertions(+), 43 deletions(-) diff --git a/src/eventgrid/azext_eventgrid/_params.py b/src/eventgrid/azext_eventgrid/_params.py index bdb4a731e78..5eb0da07323 100644 --- a/src/eventgrid/azext_eventgrid/_params.py +++ b/src/eventgrid/azext_eventgrid/_params.py @@ -46,17 +46,17 @@ def load_arguments(self, _): 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('input_mapping_fields', arg_type=tags_type, help="This must be specified only when input_schema is customeventschema. This is used for specifying input mappings based on field names. Space separated values in 'key=value' format. Allowed key names are 'id', 'topic', 'eventtime', 'subject', 'eventtype', 'dataversion'.") - c.argument('input_mapping_default_values', arg_type=tags_type, help="This must be specified only when input_schema is customeventschema. This is used for specifying input mappings based on field names. Space separated tags in 'key=value' format. Allowed key names are 'subject', 'eventtype', 'dataversion'.") + c.argument('input_mapping_fields', arg_type=tags_type, help="When input-schema is specified as customeventschema, this parameter is used to specify input mappings based on field names. Specify space separated mappings in 'key=value' format. Allowed key names are 'id', 'topic', 'eventtime', 'subject', 'eventtype', 'dataversion'. The corresponding value names should specify the names of the fields in the custom input schema.") + c.argument('input_mapping_default_values', arg_type=tags_type, help="When input-schema is specified as customeventschema, this parameter is used to specify input mappings based on default values. Specify space separated mappings in 'key=value' format. Allowed key names are 'subject', 'eventtype', 'dataversion'. The corresponding value names should specify the default values to be used for the mapping.") c.argument('input_schema', arg_type=get_enum_type(['eventgridschema', 'customeventschema', 'cloudeventv01schema'], default='eventgridschema'), help='Schema in which incoming events will be published for this topic. If customeventschema is specified, either input_mapping_default_values or input_mapping_fields must be specified as well.') 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') - c.argument('event_delivery_schema', arg_type=get_enum_type(['eventgridschema', 'inputeventschema', 'cloudeventv01schema'], default='eventgridschema'), help='Schema in which events should be delivered for this event subscription.') + c.argument('event_delivery_schema', arg_type=get_enum_type(['eventgridschema', 'inputeventschema', 'cloudeventv01schema'], default='eventgridschema'), help='Schema in which events should be delivered for this event subscription. If inputeventschema is specified, events will be delivered in the same schema as the published event schema. If cloudeventv01schema is specified, events will be delivered in the Cloud Events V0.1 schema.') 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="Endpoint where EventGrid should deliver events that cannot be delivered for this event subscription.") + 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.") 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')) diff --git a/src/eventgrid/azext_eventgrid/custom.py b/src/eventgrid/azext_eventgrid/custom.py index 1ecd33eb387..4c2da0f9fd4 100644 --- a/src/eventgrid/azext_eventgrid/custom.py +++ b/src/eventgrid/azext_eventgrid/custom.py @@ -41,6 +41,13 @@ CUSTOM_EVENT_SCHEMA = "CustomEventSchema" INPUT_EVENT_SCHEMA = "InputEventSchema" +# Constants for the target field names of the mapping +TOPIC = "topic" +SUBJECT = "subject" +ID = "id" +EVENTTIME = "eventtime" +EVENTTYPE = "eventtype" +DATAVERSION = "dataversion" def cli_topic_list( client, @@ -363,45 +370,51 @@ def event_subscription_getter( def get_input_schema_mapping( - input_mapping_fields=None, - input_mapping_default_values=None): - input_schema_mapping = None - - if input_mapping_fields is not None or input_mapping_default_values is not None: - input_schema_mapping = JsonInputSchemaMapping() - - input_schema_mapping.id = JsonField() - input_schema_mapping.topic = JsonField() - input_schema_mapping.event_time = JsonField() - input_schema_mapping.subject = JsonFieldWithDefault() - input_schema_mapping.event_type = JsonFieldWithDefault() - input_schema_mapping.data_version = JsonFieldWithDefault() - - for key_value_pair in input_mapping_fields: - split_key_value_pairs = key_value_pair.split("=") - if split_key_value_pairs[0].lower() == "id": - input_schema_mapping.id.source_field = split_key_value_pairs[1] - elif split_key_value_pairs[0].lower() == "eventtime": - input_schema_mapping.event_time.source_field = split_key_value_pairs[1] - elif split_key_value_pairs[0].lower() == "topic": - input_schema_mapping.topic.source_field = split_key_value_pairs[1] - elif split_key_value_pairs[0].lower() == "subject": - input_schema_mapping.subject.source_field = split_key_value_pairs[1] - elif split_key_value_pairs[0].lower() == "dataversion": - input_schema_mapping.data_version.source_field = split_key_value_pairs[1] - elif split_key_value_pairs[0].lower() == "eventtype": - input_schema_mapping.event_type.source_field = split_key_value_pairs[1] - - for key_value_pair2 in input_mapping_default_values: - split_key_value_pairs2 = key_value_pair2.split("=") - if split_key_value_pairs2[0].lower() == "subject": - input_schema_mapping.subject.default_value = split_key_value_pairs2[1] - elif split_key_value_pairs2[0].lower() == "dataversion": - input_schema_mapping.data_version.default_value = split_key_value_pairs2[1] - elif split_key_value_pairs2[0].lower() == "eventtype": - input_schema_mapping.event_type.default_value = split_key_value_pairs2[1] - - return input_schema_mapping + input_mapping_fields=None, + input_mapping_default_values=None): + input_schema_mapping = None + + if input_mapping_fields is not None or input_mapping_default_values is not None: + input_schema_mapping = JsonInputSchemaMapping() + + input_schema_mapping.id = JsonField() + input_schema_mapping.topic = JsonField() + input_schema_mapping.event_time = JsonField() + input_schema_mapping.subject = JsonFieldWithDefault() + input_schema_mapping.event_type = JsonFieldWithDefault() + input_schema_mapping.data_version = JsonFieldWithDefault() + + for field_mapping_pair in input_mapping_fields: + field_mapping = field_mapping_pair.split("=") + target = field_mapping[0] + source = field_mapping[1] + + if target.lower() == ID.lower(): + input_schema_mapping.id.source_field = source + elif target.lower() == EVENTTIME.lower(): + input_schema_mapping.event_time.source_field = source + elif target.lower() == TOPIC.lower(): + input_schema_mapping.topic.source_field = source + elif target.lower() == SUBJECT.lower(): + input_schema_mapping.subject.source_field = source + elif target.lower() == DATAVERSION.lower(): + input_schema_mapping.data_version.source_field = source + elif target.lower() == EVENTTYPE.lower(): + input_schema_mapping.event_type.source_field = source + + for default_value_mapping_pair in input_mapping_default_values: + default_value_mapping = default_value_mapping_pair.split("=") + target = default_value_mapping[0] + source = default_value_mapping[1] + + if target.lower() == SUBJECT.lower(): + input_schema_mapping.subject.default_value = source + elif target.lower() == DATAVERSION.lower(): + input_schema_mapping.data_version.default_value = source + elif target.lower() == EVENTTYPE.lower(): + input_schema_mapping.event_type.default_value = source + + return input_schema_mapping def update_event_subscription( From 7dbe65d98cc98e023797bf7745b2c1d9840f52b9 Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Wed, 25 Apr 2018 16:05:40 -0700 Subject: [PATCH 07/14] Include extension metadata. --- src/eventgrid/azext_eventgrid/azext_metadata.json | 1 - src/eventgrid/setup.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eventgrid/azext_eventgrid/azext_metadata.json b/src/eventgrid/azext_eventgrid/azext_metadata.json index 0805b25d581..a2f37531f6a 100644 --- a/src/eventgrid/azext_eventgrid/azext_metadata.json +++ b/src/eventgrid/azext_eventgrid/azext_metadata.json @@ -1,4 +1,3 @@ { - "azext.minCliCoreVersion": "2.0.24", "azext.isPreview": true } \ No newline at end of file diff --git a/src/eventgrid/setup.py b/src/eventgrid/setup.py index bb87c47b82c..818709bc947 100644 --- a/src/eventgrid/setup.py +++ b/src/eventgrid/setup.py @@ -37,5 +37,6 @@ url='https://github.com/Azure/azure-cli-extensions', classifiers=CLASSIFIERS, packages=find_packages(exclude=["tests"]), + package_data={'azext_eventgrid': ['azext_metadata.json']}, install_requires=DEPENDENCIES ) From eeb674cebdbf1406f362fa0d01331af7e4c0122b Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Wed, 25 Apr 2018 17:53:51 -0700 Subject: [PATCH 08/14] Linter fixes. --- src/eventgrid/azext_eventgrid/custom.py | 57 +++++++++++++------ .../mgmt/eventgrid/__init__.py | 1 - .../azext_eventgrid/mgmt/eventgrid/version.py | 1 - src/eventgrid/setup.py | 4 +- 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/src/eventgrid/azext_eventgrid/custom.py b/src/eventgrid/azext_eventgrid/custom.py index 4c2da0f9fd4..465aae4ae4a 100644 --- a/src/eventgrid/azext_eventgrid/custom.py +++ b/src/eventgrid/azext_eventgrid/custom.py @@ -74,18 +74,20 @@ def cli_topic_create_or_update( elif input_schema.lower() == CLOUDEVENTV01_SCHEMA.lower(): input_schema = CLOUDEVENTV01_SCHEMA else: - raise CLIError('The provided input_schema is not a valid value. The supported values are: ' + - EVENTGRID_SCHEMA + ',' + CUSTOM_EVENT_SCHEMA + ',' + CLOUDEVENTV01_SCHEMA) + raise CLIError('The provided input_schema is not valid. The supported values are: ' + + EVENTGRID_SCHEMA + ',' + CUSTOM_EVENT_SCHEMA + ',' + CLOUDEVENTV01_SCHEMA) if input_schema == EVENTGRID_SCHEMA or input_schema == CLOUDEVENTV01_SCHEMA: # Ensure that custom input mappings are not specified if input_mapping_fields is not None or input_mapping_default_values is not None: - raise CLIError('input-mapping-default-values and input-mapping-fields should be specified only when input-schema is set to customeventschema.') + raise CLIError('input-mapping-default-values and input-mapping-fields should be '+ + 'specified only when input-schema is set to customeventschema.') if input_schema == CUSTOM_EVENT_SCHEMA: # Ensure that custom input mappings are specified if input_mapping_fields is None and input_mapping_default_values is None: - raise CLIError('Either input-mapping-default-values or input-mapping-fields must be specified when input-schema is set to customeventschema.') + raise CLIError('Either input-mapping-default-values or input-mapping-fields must be '+ + 'specified when input-schema is set to customeventschema.') input_schema_mapping = get_input_schema_mapping( input_mapping_fields, @@ -101,7 +103,7 @@ def cli_topic_create_or_update( return created_topic -def cli_eventgrid_event_subscription_create( +def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals cmd, client, event_subscription_name, @@ -134,10 +136,15 @@ def cli_eventgrid_event_subscription_create( elif event_delivery_schema.lower() == CLOUDEVENTV01_SCHEMA.lower(): event_delivery_schema = CLOUDEVENTV01_SCHEMA else: - raise CLIError('The provided event delivery schema is not a valid value. The supported values are' + - EVENTGRID_SCHEMA + ',' + INPUT_EVENT_SCHEMA + ',' + CLOUDEVENTV01_SCHEMA) + raise CLIError('The provided event delivery schema is not valid. The supported ' + ' values are:' + EVENTGRID_SCHEMA + ',' + INPUT_EVENT_SCHEMA + + ',' + CLOUDEVENTV01_SCHEMA) - scope = _get_scope_for_event_subscription(cmd.cli_ctx, resource_id, topic_name, resource_group_name) + scope = _get_scope_for_event_subscription( + cmd.cli_ctx, + resource_id, + topic_name, + resource_group_name) deadletter_destination = None if endpoint_type.lower() == WEBHOOK_DESTINATION.lower(): @@ -147,13 +154,17 @@ def cli_eventgrid_event_subscription_create( elif endpoint_type.lower() == HYBRIDCONNECTION_DESTINATION.lower(): destination = HybridConnectionEventSubscriptionDestination(endpoint) elif endpoint_type.lower() == STORAGEQUEUE_DESTINATION.lower(): - # Supplied endpoint would be in the format /subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/sa1/queueServices/default/queues/{queueName})) - # and we need to break it up into /subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/sa1 and queueName + # Supplied endpoint would be in the following format: + # /subscriptions/.../storageAccounts/sa1/queueServices/default/queues/{queueName})) + # and we need to break it up into: + # /subscriptions/.../storageAccounts/sa1 and queueName storage_queue_items = re.split( "/queueServices/default/queues/", endpoint, flags=re.IGNORECASE) if len(storage_queue_items) != 2 or storage_queue_items[0] is None or storage_queue_items[1] is None: - raise CLIError("Argument Error: Expected format of Storage queue endpoint is: /subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/sa1/queueServices/default/queues/queueName") + raise CLIError('Argument Error: Expected format of Storage queue endpoint is:' + + '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/'+ + 'storageAccounts/sa1/queueServices/default/queues/queueName') destination = StorageQueueEventSubscriptionDestination( storage_queue_items[0], storage_queue_items[1]) @@ -171,23 +182,33 @@ def cli_eventgrid_event_subscription_create( "/blobServices/default/containers/", deadletter_endpoint, flags=re.IGNORECASE) if len(storage_blob_items) != 2 or storage_blob_items[0] is None or storage_blob_items[1] is None: - raise CLIError("Argument Error: Expected format of deadletter destination is: /subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/containerName") + raise CLIError('Argument Error: Expected format of deadletter destination is:'+ + '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/'+ + 'storageAccounts/sa1/blobServices/default/containers/containerName') deadletter_destination = StorageBlobDeadLetterDestination( storage_blob_items[0], storage_blob_items[1]) event_subscription_info = EventSubscription( - destination, event_subscription_filter, labels, event_delivery_schema, retry_policy, deadletter_destination) - - if endpoint_type.lower() == WEBHOOK_DESTINATION.lower() and "azure" not in endpoint.lower() and "hookbin" not in endpoint.lower(): - print("If the endpoint doesn't support subscription validation response, please visit the validation URL manually to complete the validation handshake.") + destination, + event_subscription_filter, + labels, + event_delivery_schema, + retry_policy, + deadletter_destination) + + if endpoint_type.lower() == WEBHOOK_DESTINATION.lower() and \ + "azure" not in endpoint.lower() and \ + "hookbin" not in endpoint.lower(): + print("If the provided endpoint doesn't support subscription validation handshake, "+ + "navigate to the validation URL that you receive in the webhook destination, "+ + "in order to complete the event subscription creation.") 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 + return async_event_subscription_create.result() def event_subscription_setter( diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/__init__.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/__init__.py index 4cb1d289dde..252c1f87238 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/__init__.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/__init__.py @@ -15,4 +15,3 @@ __all__ = ['EventGridManagementClient'] __version__ = VERSION - diff --git a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py index 7921c843fb5..54628defc95 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py @@ -10,4 +10,3 @@ # -------------------------------------------------------------------------- VERSION = "2018-05-01-preview" - diff --git a/src/eventgrid/setup.py b/src/eventgrid/setup.py index 818709bc947..12a7ef59458 100644 --- a/src/eventgrid/setup.py +++ b/src/eventgrid/setup.py @@ -29,8 +29,8 @@ setup( name='eventgrid', version=VERSION, - description='An Azure CLI Extension providing support for Azure EventGrid preview version.', - long_description='An Azure CLI Extension providing support for Azure EventGrid preview version.', + description='Support for Azure EventGrid 2018-05-01-preview features', + long_description='Support for Azure EventGrid features in 2018-05-01-preview version.', license='MIT', author='J. Kalyana Sundaram', author_email='kalyanaj@microsoft.com', From 51f7d1e22c5b87e439c529780abb3cba4b1e1dfd Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Thu, 26 Apr 2018 10:46:32 -0700 Subject: [PATCH 09/14] Fixes for flake8 issues. --- src/eventgrid/azext_eventgrid/custom.py | 15 ++++++++------- .../tests/latest/test_eventgrid_commands.py | 12 ++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/eventgrid/azext_eventgrid/custom.py b/src/eventgrid/azext_eventgrid/custom.py index 465aae4ae4a..c721a14579c 100644 --- a/src/eventgrid/azext_eventgrid/custom.py +++ b/src/eventgrid/azext_eventgrid/custom.py @@ -49,6 +49,7 @@ EVENTTYPE = "eventtype" DATAVERSION = "dataversion" + def cli_topic_list( client, resource_group_name=None): @@ -80,13 +81,13 @@ def cli_topic_create_or_update( if input_schema == EVENTGRID_SCHEMA or input_schema == CLOUDEVENTV01_SCHEMA: # Ensure that custom input mappings are not specified if input_mapping_fields is not None or input_mapping_default_values is not None: - raise CLIError('input-mapping-default-values and input-mapping-fields should be '+ + raise CLIError('input-mapping-default-values and input-mapping-fields should be ' + 'specified only when input-schema is set to customeventschema.') if input_schema == CUSTOM_EVENT_SCHEMA: # Ensure that custom input mappings are specified if input_mapping_fields is None and input_mapping_default_values is None: - raise CLIError('Either input-mapping-default-values or input-mapping-fields must be '+ + raise CLIError('Either input-mapping-default-values or input-mapping-fields must be ' + 'specified when input-schema is set to customeventschema.') input_schema_mapping = get_input_schema_mapping( @@ -163,7 +164,7 @@ def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals if len(storage_queue_items) != 2 or storage_queue_items[0] is None or storage_queue_items[1] is None: raise CLIError('Argument Error: Expected format of Storage queue endpoint is:' + - '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/'+ + '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + 'storageAccounts/sa1/queueServices/default/queues/queueName') destination = StorageQueueEventSubscriptionDestination( @@ -182,8 +183,8 @@ def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals "/blobServices/default/containers/", deadletter_endpoint, flags=re.IGNORECASE) if len(storage_blob_items) != 2 or storage_blob_items[0] is None or storage_blob_items[1] is None: - raise CLIError('Argument Error: Expected format of deadletter destination is:'+ - '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/'+ + raise CLIError('Argument Error: Expected format of deadletter destination is:' + + '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + 'storageAccounts/sa1/blobServices/default/containers/containerName') deadletter_destination = StorageBlobDeadLetterDestination( @@ -200,8 +201,8 @@ def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals if endpoint_type.lower() == WEBHOOK_DESTINATION.lower() and \ "azure" not in endpoint.lower() and \ "hookbin" not in endpoint.lower(): - print("If the provided endpoint doesn't support subscription validation handshake, "+ - "navigate to the validation URL that you receive in the webhook destination, "+ + print("If the provided endpoint doesn't support subscription validation handshake, " + + "navigate to the validation URL that you receive in the webhook destination, " + "in order to complete the event subscription creation.") async_event_subscription_create = client.create_or_update( diff --git a/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py b/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py index d6932000c13..bbe096695d7 100644 --- a/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py +++ b/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py @@ -8,6 +8,7 @@ from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer from knack.util import CLIError + class EventGridTests(ScenarioTest): @unittest.skip("Temporarily disabled as this is not yet enabled with the 2018-05-01-preview API version") def test_topic_types(self): @@ -60,15 +61,15 @@ def test_create_topic(self, resource_group): # Test various failure conditions # Input mappings cannot be provided when input schema is not customeventschema - with self.assertRaises(CLIError) as ex1: + with self.assertRaises(CLIError): self.cmd('az eventgrid topic create --name {topic_name2} --resource-group {rg} --location {location} --input-schema CloudEventV01Schema --input-mapping-fields topic=myTopicField') # Input mappings cannot be provided when input schema is not customeventschema - with self.assertRaises(CLIError) as ex2: + with self.assertRaises(CLIError): self.cmd('az eventgrid topic create --name {topic_name2} --resource-group {rg} --location {location} --input-schema eventgridschema --input-mapping-fields topic=myTopicField') # Input mappings must be provided when input schema is customeventschema - with self.assertRaises(CLIError) as ex3: + with self.assertRaises(CLIError): self.cmd('az eventgrid topic create --name {topic_name2} --resource-group {rg} --location {location} --input-schema customeventschema') self.cmd('az eventgrid topic create --name {topic_name2} --resource-group {rg} --location {location} --input-schema CloudEventV01Schema', checks=[ @@ -268,7 +269,6 @@ def test_create_event_subscriptions_with_filters(self, resource_group): ]) self.cmd('az eventgrid event-subscription delete --resource-group {rg} --name {event_subscription_name}') - @ResourceGroupPreparer() def test_create_event_subscriptions_with_20180501_features(self, resource_group): event_subscription_name1 = 'eventsubscription1' @@ -287,11 +287,11 @@ def test_create_event_subscriptions_with_20180501_features(self, resource_group) # Failure cases # Invalid Event TTL value - with self.assertRaises(CLIError) as ex2: + with self.assertRaises(CLIError): self.cmd('az eventgrid event-subscription create -g {rg} --name {event_subscription_name1} --endpoint-type storagequeue --endpoint {storagequeue_endpoint_id} --event-ttl 2000 --deadletter-endpoint {deadletter_endpoint_id}') # Invalid max delivery attempts value - with self.assertRaises(CLIError) as ex3: + with self.assertRaises(CLIError): self.cmd('az eventgrid event-subscription create -g {rg} --name {event_subscription_name1} --endpoint-type storagequeue --endpoint {storagequeue_endpoint_id} --max-delivery-attempts 31 --deadletter-endpoint {deadletter_endpoint_id}') # Create a storage queue destination based event subscription with cloud event schema as the delivery schema From 9b01f18ce3af982617574f4e1d6178678bf65417 Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Thu, 26 Apr 2018 11:03:36 -0700 Subject: [PATCH 10/14] Updating CODEOWNERS file for eventgrid. --- .github/CODEOWNERS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e58a01a59ae..091c272ac5c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -20,4 +20,6 @@ /src/dns/ @muwaqar -/src/signalr/ @zackliu \ No newline at end of file +/src/signalr/ @zackliu + +/src/eventgrid/ @kalyanaj \ No newline at end of file From 7c095333666f472faa292c52a1293bad0129efb3 Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Thu, 26 Apr 2018 11:37:44 -0700 Subject: [PATCH 11/14] Incorporated CR feedback. --- src/eventgrid/azext_eventgrid/custom.py | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/eventgrid/azext_eventgrid/custom.py b/src/eventgrid/azext_eventgrid/custom.py index c721a14579c..d5a5a2038e1 100644 --- a/src/eventgrid/azext_eventgrid/custom.py +++ b/src/eventgrid/azext_eventgrid/custom.py @@ -75,20 +75,20 @@ def cli_topic_create_or_update( elif input_schema.lower() == CLOUDEVENTV01_SCHEMA.lower(): input_schema = CLOUDEVENTV01_SCHEMA else: - raise CLIError('The provided input_schema is not valid. The supported values are: ' + + raise CLIError('The provided --input-schema is not valid. The supported values are: ' + EVENTGRID_SCHEMA + ',' + CUSTOM_EVENT_SCHEMA + ',' + CLOUDEVENTV01_SCHEMA) if input_schema == EVENTGRID_SCHEMA or input_schema == CLOUDEVENTV01_SCHEMA: # Ensure that custom input mappings are not specified if input_mapping_fields is not None or input_mapping_default_values is not None: - raise CLIError('input-mapping-default-values and input-mapping-fields should be ' + - 'specified only when input-schema is set to customeventschema.') + raise CLIError('--input-mapping-default-values and --input-mapping-fields should be ' + + 'specified only when --input-schema is set to customeventschema.') if input_schema == CUSTOM_EVENT_SCHEMA: # Ensure that custom input mappings are specified if input_mapping_fields is None and input_mapping_default_values is None: - raise CLIError('Either input-mapping-default-values or input-mapping-fields must be ' + - 'specified when input-schema is set to customeventschema.') + raise CLIError('Either --input-mapping-default-values or --input-mapping-fields must be ' + + 'specified when --input-schema is set to customeventschema.') input_schema_mapping = get_input_schema_mapping( input_mapping_fields, @@ -124,11 +124,11 @@ def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals labels=None): max_delivery_attempts = int(max_delivery_attempts) if max_delivery_attempts < 1 or max_delivery_attempts > 30: - raise CLIError('Max delivery attempts should be a number between 1 and 30.') + raise CLIError('--max-delivery-attempts should be a number between 1 and 30.') event_ttl = int(event_ttl) if event_ttl < 1 or event_ttl > 1440: - raise CLIError('Event TTL should be a number between 1 and 1440.') + raise CLIError('--event-ttl should be a number between 1 and 1440.') if event_delivery_schema.lower() == EVENTGRID_SCHEMA.lower(): event_delivery_schema = EVENTGRID_SCHEMA @@ -137,7 +137,7 @@ def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals elif event_delivery_schema.lower() == CLOUDEVENTV01_SCHEMA.lower(): event_delivery_schema = CLOUDEVENTV01_SCHEMA else: - raise CLIError('The provided event delivery schema is not valid. The supported ' + raise CLIError('The provided --event-delivery-schema is not valid. The supported ' ' values are:' + EVENTGRID_SCHEMA + ',' + INPUT_EVENT_SCHEMA + ',' + CLOUDEVENTV01_SCHEMA) @@ -163,7 +163,7 @@ def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals "/queueServices/default/queues/", endpoint, flags=re.IGNORECASE) if len(storage_queue_items) != 2 or storage_queue_items[0] is None or storage_queue_items[1] is None: - raise CLIError('Argument Error: Expected format of Storage queue endpoint is:' + + raise CLIError('Argument Error: Expected format of --endpoint for storage queue is:' + '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + 'storageAccounts/sa1/queueServices/default/queues/queueName') @@ -183,7 +183,7 @@ def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals "/blobServices/default/containers/", deadletter_endpoint, flags=re.IGNORECASE) if len(storage_blob_items) != 2 or storage_blob_items[0] is None or storage_blob_items[1] is None: - raise CLIError('Argument Error: Expected format of deadletter destination is:' + + raise CLIError('Argument Error: Expected format of --deadletter-endpoint is:' + '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + 'storageAccounts/sa1/blobServices/default/containers/containerName') @@ -201,9 +201,9 @@ def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals if endpoint_type.lower() == WEBHOOK_DESTINATION.lower() and \ "azure" not in endpoint.lower() and \ "hookbin" not in endpoint.lower(): - print("If the provided endpoint doesn't support subscription validation handshake, " + - "navigate to the validation URL that you receive in the webhook destination, " + - "in order to complete the event subscription creation.") + logger.warning("If the provided endpoint doesn't support subscription validation handshake, " + + "navigate to the validation URL that you receive in the webhook destination, " + + "in order to complete the event subscription creation.") async_event_subscription_create = client.create_or_update( scope, @@ -269,7 +269,7 @@ def cli_event_subscription_list( # pylint: disable=too-many-return-statements 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.') + raise CLIError('Since --resource-id 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'] @@ -285,7 +285,7 @@ def cli_event_subscription_list( # pylint: disable=too-many-return-statements if topic_name: if resource_group_name is None: - raise CLIError('Since topic-name is specified, resource-group-name must also be specified.') + raise CLIError('Since --topic-name is specified, --resource-group-name must also be specified.') return client.list_by_resource( resource_group_name, @@ -367,7 +367,7 @@ def _get_scope_for_event_subscription( 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.") + 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: From a942baa3a4892f3e0e632e8c7b7dd633c5ef8910 Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Thu, 26 Apr 2018 11:56:24 -0700 Subject: [PATCH 12/14] Added missing license header. --- src/eventgrid/azext_eventgrid/mgmt/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/eventgrid/azext_eventgrid/mgmt/__init__.py b/src/eventgrid/azext_eventgrid/mgmt/__init__.py index de40ea7ca05..a5b81f3bde4 100644 --- a/src/eventgrid/azext_eventgrid/mgmt/__init__.py +++ b/src/eventgrid/azext_eventgrid/mgmt/__init__.py @@ -1 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + __import__('pkg_resources').declare_namespace(__name__) From 6ca9fee9d0d84325f91edf04286074364d6a59fb Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Fri, 27 Apr 2018 11:23:38 -0700 Subject: [PATCH 13/14] Fixed event subscription update to honor the new endpoint types. --- src/eventgrid/azext_eventgrid/_help.py | 2 +- src/eventgrid/azext_eventgrid/_params.py | 2 +- src/eventgrid/azext_eventgrid/custom.py | 181 ++++++++++++++--------- 3 files changed, 116 insertions(+), 69 deletions(-) diff --git a/src/eventgrid/azext_eventgrid/_help.py b/src/eventgrid/azext_eventgrid/_help.py index 566de37edea..f0242fb0f68 100644 --- a/src/eventgrid/azext_eventgrid/_help.py +++ b/src/eventgrid/azext_eventgrid/_help.py @@ -23,7 +23,7 @@ text: az eventgrid topic create -g rg1 --name topic1 -l westus2 - name: Create a new topic with custom input mappings. text: az eventgrid topic create -g rg1 --name topic1 -l westus2 --input-schema customeventschema --input-mapping-fields topic=myTopicField eventType=myEventTypeField --input-mapping-default-values subject=DefaultSubject dataVersion=1.0 - - name: Create a new topic that accepts CloudEvents V0.1. + - name: Create a new topic that accepts events published in CloudEvents V0.1 schema. text: az eventgrid topic create -g rg1 --name topic1 -l westus2 --input-schema cloudeventv01 """ helps['eventgrid topic update'] = """ diff --git a/src/eventgrid/azext_eventgrid/_params.py b/src/eventgrid/azext_eventgrid/_params.py index 5eb0da07323..4e42694dba5 100644 --- a/src/eventgrid/azext_eventgrid/_params.py +++ b/src/eventgrid/azext_eventgrid/_params.py @@ -53,7 +53,7 @@ def load_arguments(self, _): 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') - c.argument('event_delivery_schema', arg_type=get_enum_type(['eventgridschema', 'inputeventschema', 'cloudeventv01schema'], default='eventgridschema'), help='Schema in which events should be delivered for this event subscription. If inputeventschema is specified, events will be delivered in the same schema as the published event schema. If cloudeventv01schema is specified, events will be delivered in the Cloud Events V0.1 schema.') + c.argument('event_delivery_schema', arg_type=get_enum_type(['eventgridschema', 'inputeventschema', 'cloudeventv01schema'], default='eventgridschema'), help='Schema in which events should be delivered for this event subscription. By default, events are delivered in the eventgridschema. To make EventGrid deliver events in the same schema as the published event schema, use customeventschema as the value for this parameter. To make EventGrid deliver events in the Cloud Events V0.1 schema, use cloudeventv01schema as the value for this parameter.') 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.") diff --git a/src/eventgrid/azext_eventgrid/custom.py b/src/eventgrid/azext_eventgrid/custom.py index d5a5a2038e1..e658f79a74f 100644 --- a/src/eventgrid/azext_eventgrid/custom.py +++ b/src/eventgrid/azext_eventgrid/custom.py @@ -104,7 +104,7 @@ def cli_topic_create_or_update( return created_topic -def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals +def cli_eventgrid_event_subscription_create( cmd, client, event_subscription_name, @@ -122,53 +122,16 @@ def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals event_delivery_schema=EVENTGRID_SCHEMA, deadletter_endpoint=None, labels=None): + # Construct RetryPolicy based on max_delivery_attempts and event_ttl max_delivery_attempts = int(max_delivery_attempts) - if max_delivery_attempts < 1 or max_delivery_attempts > 30: - raise CLIError('--max-delivery-attempts should be a number between 1 and 30.') - event_ttl = int(event_ttl) - if event_ttl < 1 or event_ttl > 1440: - raise CLIError('--event-ttl should be a number between 1 and 1440.') - - if event_delivery_schema.lower() == EVENTGRID_SCHEMA.lower(): - event_delivery_schema = EVENTGRID_SCHEMA - elif event_delivery_schema.lower() == INPUT_EVENT_SCHEMA.lower(): - event_delivery_schema = INPUT_EVENT_SCHEMA - elif event_delivery_schema.lower() == CLOUDEVENTV01_SCHEMA.lower(): - event_delivery_schema = CLOUDEVENTV01_SCHEMA - else: - raise CLIError('The provided --event-delivery-schema is not valid. The supported ' - ' values are:' + EVENTGRID_SCHEMA + ',' + INPUT_EVENT_SCHEMA + - ',' + CLOUDEVENTV01_SCHEMA) - - scope = _get_scope_for_event_subscription( - cmd.cli_ctx, - resource_id, - topic_name, - resource_group_name) - deadletter_destination = None - - if endpoint_type.lower() == WEBHOOK_DESTINATION.lower(): - destination = WebHookEventSubscriptionDestination(endpoint) - elif endpoint_type.lower() == EVENTHUB_DESTINATION.lower(): - destination = EventHubEventSubscriptionDestination(endpoint) - elif endpoint_type.lower() == HYBRIDCONNECTION_DESTINATION.lower(): - destination = HybridConnectionEventSubscriptionDestination(endpoint) - elif endpoint_type.lower() == STORAGEQUEUE_DESTINATION.lower(): - # Supplied endpoint would be in the following format: - # /subscriptions/.../storageAccounts/sa1/queueServices/default/queues/{queueName})) - # and we need to break it up into: - # /subscriptions/.../storageAccounts/sa1 and queueName - storage_queue_items = re.split( - "/queueServices/default/queues/", endpoint, flags=re.IGNORECASE) + _validate_retry_policy(max_delivery_attempts, event_ttl) + retry_policy = RetryPolicy(max_delivery_attempts, event_ttl) - if len(storage_queue_items) != 2 or storage_queue_items[0] is None or storage_queue_items[1] is None: - raise CLIError('Argument Error: Expected format of --endpoint for storage queue is:' + - '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + - 'storageAccounts/sa1/queueServices/default/queues/queueName') + # Get event_delivery_schema in the right case + event_delivery_schema = _get_event_delivery_schema(event_delivery_schema) - destination = StorageQueueEventSubscriptionDestination( - storage_queue_items[0], storage_queue_items[1]) + destination = _get_endpoint_destination(endpoint_type, endpoint) event_subscription_filter = EventSubscriptionFilter( subject_begins_with, @@ -176,19 +139,15 @@ def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals included_event_types, is_subject_case_sensitive) - retry_policy = RetryPolicy(max_delivery_attempts, event_ttl) - + deadletter_destination = None if deadletter_endpoint is not None: - storage_blob_items = re.split( - "/blobServices/default/containers/", deadletter_endpoint, flags=re.IGNORECASE) - - if len(storage_blob_items) != 2 or storage_blob_items[0] is None or storage_blob_items[1] is None: - raise CLIError('Argument Error: Expected format of --deadletter-endpoint is:' + - '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + - 'storageAccounts/sa1/blobServices/default/containers/containerName') + deadletter_destination = _get_deadletter_destination(deadletter_endpoint) - deadletter_destination = StorageBlobDeadLetterDestination( - storage_blob_items[0], storage_blob_items[1]) + scope = _get_scope_for_event_subscription( + cmd.cli_ctx, + resource_id, + topic_name, + resource_group_name) event_subscription_info = EventSubscription( destination, @@ -198,12 +157,7 @@ def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals retry_policy, deadletter_destination) - if endpoint_type.lower() == WEBHOOK_DESTINATION.lower() and \ - "azure" not in endpoint.lower() and \ - "hookbin" not in endpoint.lower(): - logger.warning("If the provided endpoint doesn't support subscription validation handshake, " + - "navigate to the validation URL that you receive in the webhook destination, " + - "in order to complete the event subscription creation.") + _warn_if_manual_handshake_needed(endpoint_type, endpoint) async_event_subscription_create = client.create_or_update( scope, @@ -446,16 +400,25 @@ def update_event_subscription( subject_begins_with=None, subject_ends_with=None, included_event_types=None, - labels=None): + labels=None, + deadletter_endpoint=None): event_subscription_destination = None + deadletter_destination = None event_subscription_labels = instance.labels event_subscription_filter = instance.filter + # TODO: These are not currently updatable, make them updatable. + event_delivery_schema = instance.event_delivery_schema + retry_policy = instance.retry_policy + + if event_delivery_schema is None: + event_delivery_schema = EVENTGRID_SCHEMA + 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) + event_subscription_destination = _get_endpoint_destination(endpoint_type, endpoint) + + if deadletter_endpoint is not None: + deadletter_destination = _get_deadletter_destination(deadletter_endpoint) if subject_begins_with is not None: event_subscription_filter.subject_begins_with = subject_begins_with @@ -472,7 +435,91 @@ def update_event_subscription( params = EventSubscriptionUpdateParameters( destination=event_subscription_destination, filter=event_subscription_filter, - labels=event_subscription_labels + labels=event_subscription_labels, + retry_policy=instance.retry_policy, + dead_letter_destination=deadletter_destination, + event_delivery_schema=event_delivery_schema ) return params + +def _get_endpoint_destination(endpoint_type, endpoint): + if endpoint_type.lower() == WEBHOOK_DESTINATION.lower(): + destination = WebHookEventSubscriptionDestination(endpoint) + elif endpoint_type.lower() == EVENTHUB_DESTINATION.lower(): + destination = EventHubEventSubscriptionDestination(endpoint) + elif endpoint_type.lower() == HYBRIDCONNECTION_DESTINATION.lower(): + destination = HybridConnectionEventSubscriptionDestination(endpoint) + elif endpoint_type.lower() == STORAGEQUEUE_DESTINATION.lower(): + destination = _get_storage_queue_destination(endpoint) + + return destination + +def _get_storage_queue_destination(endpoint): + # Supplied endpoint would be in the following format: + # /subscriptions/.../storageAccounts/sa1/queueServices/default/queues/{queueName})) + # and we need to break it up into: + # /subscriptions/.../storageAccounts/sa1 and queueName + queue_items = re.split( + "/queueServices/default/queues/", endpoint, flags=re.IGNORECASE) + + if len(queue_items) != 2 or queue_items[0] is None or queue_items[1] is None: + raise CLIError('Argument Error: Expected format of --endpoint for storage queue is:' + + '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + + 'storageAccounts/sa1/queueServices/default/queues/queueName') + + destination = StorageQueueEventSubscriptionDestination( + queue_items[0], queue_items[1]) + + return destination + +def _get_deadletter_destination(deadletter_endpoint): + blob_items = re.split( + "/blobServices/default/containers/", deadletter_endpoint, flags=re.IGNORECASE) + + if len(blob_items) != 2 or blob_items[0] is None or blob_items[1] is None: + raise CLIError('Argument Error: Expected format of --deadletter-endpoint is:' + + '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + + 'storageAccounts/sa1/blobServices/default/containers/containerName') + + deadletter_destination = StorageBlobDeadLetterDestination( + blob_items[0], blob_items[1]) + + return deadletter_destination + +def _validate_retry_policy(max_delivery_attempts, event_ttl): + if max_delivery_attempts < 1 or max_delivery_attempts > 30: + raise CLIError('--max-delivery-attempts should be a number between 1 and 30.') + + if event_ttl < 1 or event_ttl > 1440: + raise CLIError('--event-ttl should be a number between 1 and 1440.') + +def _get_event_delivery_schema(event_delivery_schema): + if event_delivery_schema.lower() == EVENTGRID_SCHEMA.lower(): + event_delivery_schema = EVENTGRID_SCHEMA + elif event_delivery_schema.lower() == INPUT_EVENT_SCHEMA.lower(): + event_delivery_schema = INPUT_EVENT_SCHEMA + elif event_delivery_schema.lower() == CLOUDEVENTV01_SCHEMA.lower(): + event_delivery_schema = CLOUDEVENTV01_SCHEMA + else: + raise CLIError('The provided --event-delivery-schema is not valid. The supported ' + ' values are:' + EVENTGRID_SCHEMA + ',' + INPUT_EVENT_SCHEMA + + ',' + CLOUDEVENTV01_SCHEMA) + + return event_delivery_schema + +def _warn_if_manual_handshake_needed(endpoint_type, endpoint): + # If the endpoint belongs to a service that we know implements the subscription validation + # handshake, there's no need to show this message, hence we check for those services + # before showing this message. This list includes Azure Automation, EventGrid Trigger based + # Azure functions, and Azure Logic Apps. + if endpoint_type.lower() == WEBHOOK_DESTINATION.lower() and \ + "azure-automation" not in endpoint.lower() and \ + "eventgridextension" not in endpoint.lower() and \ + "logic.azure.com" not in endpoint.lower() and \ + "hookbin" not in endpoint.lower(): + logger.warning("If the provided endpoint doesn't support subscription validation " + + "handshake, navigate to the validation URL that you receive in the " + + "subscription validation event, in order to complete the event " + + "subscription creation or update. For more details, " + + "please visit http://aka.ms/esvalidation") From e752404b4ba5a40c5c2e1e314f461c234cf0b714 Mon Sep 17 00:00:00 2001 From: "J. Kalyana Sundaram" Date: Fri, 27 Apr 2018 11:33:26 -0700 Subject: [PATCH 14/14] Flake8 fixes. --- src/eventgrid/azext_eventgrid/custom.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/eventgrid/azext_eventgrid/custom.py b/src/eventgrid/azext_eventgrid/custom.py index e658f79a74f..f772b126aed 100644 --- a/src/eventgrid/azext_eventgrid/custom.py +++ b/src/eventgrid/azext_eventgrid/custom.py @@ -436,13 +436,14 @@ def update_event_subscription( destination=event_subscription_destination, filter=event_subscription_filter, labels=event_subscription_labels, - retry_policy=instance.retry_policy, + retry_policy=retry_policy, dead_letter_destination=deadletter_destination, event_delivery_schema=event_delivery_schema ) return params + def _get_endpoint_destination(endpoint_type, endpoint): if endpoint_type.lower() == WEBHOOK_DESTINATION.lower(): destination = WebHookEventSubscriptionDestination(endpoint) @@ -455,6 +456,7 @@ def _get_endpoint_destination(endpoint_type, endpoint): return destination + def _get_storage_queue_destination(endpoint): # Supplied endpoint would be in the following format: # /subscriptions/.../storageAccounts/sa1/queueServices/default/queues/{queueName})) @@ -465,28 +467,30 @@ def _get_storage_queue_destination(endpoint): if len(queue_items) != 2 or queue_items[0] is None or queue_items[1] is None: raise CLIError('Argument Error: Expected format of --endpoint for storage queue is:' + - '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + - 'storageAccounts/sa1/queueServices/default/queues/queueName') + '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + + 'storageAccounts/sa1/queueServices/default/queues/queueName') destination = StorageQueueEventSubscriptionDestination( queue_items[0], queue_items[1]) return destination + def _get_deadletter_destination(deadletter_endpoint): blob_items = re.split( "/blobServices/default/containers/", deadletter_endpoint, flags=re.IGNORECASE) if len(blob_items) != 2 or blob_items[0] is None or blob_items[1] is None: raise CLIError('Argument Error: Expected format of --deadletter-endpoint is:' + - '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + - 'storageAccounts/sa1/blobServices/default/containers/containerName') + '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + + 'storageAccounts/sa1/blobServices/default/containers/containerName') deadletter_destination = StorageBlobDeadLetterDestination( blob_items[0], blob_items[1]) return deadletter_destination + def _validate_retry_policy(max_delivery_attempts, event_ttl): if max_delivery_attempts < 1 or max_delivery_attempts > 30: raise CLIError('--max-delivery-attempts should be a number between 1 and 30.') @@ -494,6 +498,7 @@ def _validate_retry_policy(max_delivery_attempts, event_ttl): if event_ttl < 1 or event_ttl > 1440: raise CLIError('--event-ttl should be a number between 1 and 1440.') + def _get_event_delivery_schema(event_delivery_schema): if event_delivery_schema.lower() == EVENTGRID_SCHEMA.lower(): event_delivery_schema = EVENTGRID_SCHEMA @@ -508,6 +513,7 @@ def _get_event_delivery_schema(event_delivery_schema): return event_delivery_schema + def _warn_if_manual_handshake_needed(endpoint_type, endpoint): # If the endpoint belongs to a service that we know implements the subscription validation # handshake, there's no need to show this message, hence we check for those services