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 diff --git a/scripts/ci/available_extensions_doc.py b/scripts/ci/available_extensions_doc.py index 97dbb54ad70..b2ba99b083e 100644 --- a/scripts/ci/available_extensions_doc.py +++ b/scripts/ci/available_extensions_doc.py @@ -6,7 +6,6 @@ from __future__ import print_function import sys -import datetime import collections from pkg_resources import parse_version @@ -20,12 +19,11 @@ author: derekbekoe ms.author: debekoe manager: routlaw -ms.date: {{ date }} +ms.date: 04/27/2018 ms.topic: article ms.prod: azure -ms.technology: azure -ms.devlang: azurecli -ms.service: multiple +ms.technology: azure-cli +ms.devlang: azure-cli --- # Available extensions for the Azure CLI 2.0 @@ -62,9 +60,8 @@ def get_extensions(): def main(): extensions = get_extensions() - now = datetime.datetime.now() template = Template(DOC_TEMPLATE) - print(template.render(extensions=extensions, date=now.strftime("%m/%d/%Y")), file=sys.stdout) + print(template.render(extensions=extensions), file=sys.stdout) if __name__ == '__main__': 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..f0242fb0f68 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/_help.py @@ -0,0 +1,217 @@ +# -------------------------------------------------------------------------------------------- +# 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 + - 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 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'] = """ + 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 + - 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 + 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..4e42694dba5 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/_params.py @@ -0,0 +1,75 @@ +# -------------------------------------------------------------------------------------------- +# 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', '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 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.") + 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')) + 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. 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.") + + 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..cf42e0ac178 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/commands.py @@ -0,0 +1,55 @@ +# -------------------------------------------------------------------------------------------- +# 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, + 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_arg_name='self' + ) + + with self.command_group('eventgrid topic', topics_mgmt_util, client_factory=topics_factory) as g: + 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', + 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..f772b126aed --- /dev/null +++ b/src/eventgrid/azext_eventgrid/custom.py @@ -0,0 +1,531 @@ +# -------------------------------------------------------------------------------------------- +# 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 +import re +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, + Topic, + JsonInputSchemaMapping, + JsonField, + JsonFieldWithDefault, + RetryPolicy, + EventHubEventSubscriptionDestination, + StorageQueueEventSubscriptionDestination, + HybridConnectionEventSubscriptionDestination, + StorageBlobDeadLetterDestination, + 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" +STORAGEQUEUE_DESTINATION = "storagequeue" +HYBRIDCONNECTION_DESTINATION = "hybridconnection" +EVENTGRID_SCHEMA = "EventGridSchema" +CLOUDEVENTV01_SCHEMA = "CloudEventV01Schema" +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, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name) + + 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.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 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.') + + 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.') + + 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, + 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, + max_delivery_attempts=30, + event_ttl=1440, + 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) + event_ttl = int(event_ttl) + _validate_retry_policy(max_delivery_attempts, event_ttl) + retry_policy = RetryPolicy(max_delivery_attempts, event_ttl) + + # Get event_delivery_schema in the right case + event_delivery_schema = _get_event_delivery_schema(event_delivery_schema) + + destination = _get_endpoint_destination(endpoint_type, endpoint) + + event_subscription_filter = EventSubscriptionFilter( + subject_begins_with, + subject_ends_with, + included_event_types, + is_subject_case_sensitive) + + deadletter_destination = None + if deadletter_endpoint is not None: + deadletter_destination = _get_deadletter_destination(deadletter_endpoint) + + scope = _get_scope_for_event_subscription( + cmd.cli_ctx, + resource_id, + topic_name, + resource_group_name) + + event_subscription_info = EventSubscription( + destination, + event_subscription_filter, + labels, + event_delivery_schema, + retry_policy, + deadletter_destination) + + _warn_if_manual_handshake_needed(endpoint_type, endpoint) + + async_event_subscription_create = client.create_or_update( + scope, + event_subscription_name, + event_subscription_info) + return async_event_subscription_create.result() + + +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 --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'] + 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 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 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( + instance, + endpoint=None, + endpoint_type=WEBHOOK_DESTINATION, + subject_begins_with=None, + subject_ends_with=None, + included_event_types=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: + 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 + + 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, + 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) + 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") diff --git a/src/eventgrid/azext_eventgrid/mgmt/__init__.py b/src/eventgrid/azext_eventgrid/mgmt/__init__.py new file mode 100644 index 00000000000..a5b81f3bde4 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/__init__.py @@ -0,0 +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__) 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..252c1f87238 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/__init__.py @@ -0,0 +1,17 @@ +# 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..ff647ec69be --- /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('azext_eventgrid-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: azext_eventgrid.mgmt.eventgrid.operations.EventSubscriptionsOperations + :ivar operations: Operations operations + :vartype operations: azext_eventgrid.mgmt.eventgrid.operations.Operations + :ivar topics: Topics operations + :vartype topics: azext_eventgrid.mgmt.eventgrid.operations.TopicsOperations + :ivar topic_types: TopicTypes operations + :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 + 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-05-01-preview' + 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..6d5522b310b --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/__init__.py @@ -0,0 +1,90 @@ +# 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 .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 +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, + EventDeliverySchema, + TopicProvisioningState, + InputSchema, + ResourceRegionType, + TopicTypeProvisioningState, +) + +__all__ = [ + 'EventSubscriptionDestination', + 'EventSubscriptionFilter', + 'RetryPolicy', + 'DeadLetterDestination', + 'Resource', + 'StorageBlobDeadLetterDestination', + 'WebHookEventSubscriptionDestination', + 'EventHubEventSubscriptionDestination', + 'StorageQueueEventSubscriptionDestination', + 'HybridConnectionEventSubscriptionDestination', + 'EventSubscription', + 'EventSubscriptionUpdateParameters', + 'EventSubscriptionFullUrl', + 'OperationInfo', + 'Operation', + 'InputSchemaMapping', + 'JsonField', + 'JsonFieldWithDefault', + 'JsonInputSchemaMapping', + 'TrackedResource', + 'Topic', + 'TopicUpdateParameters', + 'TopicSharedAccessKeys', + 'TopicRegenerateKeyRequest', + 'EventType', + 'TopicTypeInfo', + 'EventSubscriptionPaged', + 'OperationPaged', + 'TopicPaged', + '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 new file mode 100644 index 00000000000..475673ac48f --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_grid_management_client_enums.py @@ -0,0 +1,63 @@ +# 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" + awaiting_manual_action = "AwaitingManualAction" + + +class EventDeliverySchema(Enum): + + event_grid_schema = "EventGridSchema" + input_event_schema = "InputEventSchema" + cloud_event_v01_schema = "CloudEventV01Schema" + + +class TopicProvisioningState(Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + canceled = "Canceled" + failed = "Failed" + + +class InputSchema(Enum): + + event_grid_schema = "EventGridSchema" + custom_event_schema = "CustomEventSchema" + cloud_event_v01_schema = "CloudEventV01Schema" + + +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..a9e58d8b874 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription.py @@ -0,0 +1,88 @@ +# 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', 'AwaitingManualAction' + :vartype provisioning_state: str or + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionProvisioningState + :param destination: Information about the destination where events have to + be delivered for the event subscription. + :type destination: + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionDestination + :param filter: Information about the filter for the event subscription. + :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 = { + '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]'}, + '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, 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 new file mode 100644 index 00000000000..39a84a8da20 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/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 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, + StorageQueueEventSubscriptionDestination, + HybridConnectionEventSubscriptionDestination + + :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', 'StorageQueue': 'StorageQueueEventSubscriptionDestination', 'HybridConnection': 'HybridConnectionEventSubscriptionDestination'} + } + + 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..1983ed5632b --- /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..125de89b8ad --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/event_subscription_update_parameters.py @@ -0,0 +1,57 @@ +# 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: + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionDestination + :param filter: Information about the filter for the event subscription. + :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, 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.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..036a77fcaf9 --- /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/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 new file mode 100644 index 00000000000..81a1e88fe6e --- /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: ~azext_eventgrid.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..b1301775390 --- /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/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 new file mode 100644 index 00000000000..d3969752e79 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/models/topic.py @@ -0,0 +1,77 @@ +# 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 + ~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 = { + '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'}, + 'input_schema': {'key': 'properties.inputSchema', 'type': 'str'}, + 'input_schema_mapping': {'key': 'properties.inputSchemaMapping', 'type': 'InputSchemaMapping'}, + } + + 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 new file mode 100644 index 00000000000..0b5bf2a7071 --- /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..4941af002f3 --- /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 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..2c26f9b0103 --- /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 + ~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 + ~azext_eventgrid.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..9da12fc0048 --- /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..021e2d47943 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/event_subscriptions_operations.py @@ -0,0 +1,1230 @@ +# 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 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 + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + 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: ~azext_eventgrid.mgmt.eventgrid.models.EventSubscription or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + 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') + } + 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 + 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 = 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') + } + 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: + ~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[~azext_eventgrid.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) + 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 = 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') + } + 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) + 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 = 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') + } + 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 + updated + :type event_subscription_name: str + :param event_subscription_update_parameters: Updated event + subscription information + :type event_subscription_update_parameters: + ~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[~azext_eventgrid.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) + 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): + """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: + ~azext_eventgrid.mgmt.eventgrid.models.EventSubscriptionFullUrl or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + 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') + } + 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 + 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): + """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: + ~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 = self.list_global_by_subscription.metadata['url'] + 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 + 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): + """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: + ~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 = 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') + } + 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 + 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): + """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: + ~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 = 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') + } + 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 + 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): + """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: + ~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 = 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'), + '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 + 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): + """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: + ~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 = 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') + } + 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 + 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): + """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: + ~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 = 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'), + '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 + 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): + """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: + ~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 = 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'), + '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 + 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): + """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: + ~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 = 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'), + '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 + 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): + """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: + ~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 = 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'), + '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 + 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 new file mode 100644 index 00000000000..2ef36b9c994 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/operations.py @@ -0,0 +1,102 @@ +# 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 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 + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + 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: + ~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 = self.list.metadata['url'] + + # 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 + 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 new file mode 100644 index 00000000000..d3cb9a3e3ed --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topic_types_operations.py @@ -0,0 +1,230 @@ +# 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 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 + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + 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: + ~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 = self.list.metadata['url'] + + # 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 + list.metadata = {'url': '/providers/Microsoft.EventGrid/topicTypes'} + + 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: ~azext_eventgrid.mgmt.eventgrid.models.TopicTypeInfo or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + 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 + get.metadata = {'url': '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}'} + + 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: + ~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 = self.list_event_types.metadata['url'] + 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 + 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 new file mode 100644 index 00000000000..ea2c70c9fc8 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/operations/topics_operations.py @@ -0,0 +1,807 @@ +# 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 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 + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + 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: ~azext_eventgrid.mgmt.eventgrid.models.Topic or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + 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'), + '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 + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} + + + def _create_or_update_initial( + self, resource_group_name, topic_name, topic_info, custom_headers=None, raw=False, **operation_config): + # Construct URL + 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'), + '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, topic_info, 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 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[~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, + topic_info=topic_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('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) + 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 = 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'), + '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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} + + + 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 = 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'), + '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[~azext_eventgrid.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) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} + + 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: + ~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 = self.list_by_subscription.metadata['url'] + 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 + 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): + """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: + ~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 = 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') + } + 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 + 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): + """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: ~azext_eventgrid.mgmt.eventgrid.models.TopicSharedAccessKeys + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + 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'), + '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 + 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): + """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: ~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 = 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'), + '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 + 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): + """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: + ~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 = 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'), + '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 + 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 new file mode 100644 index 00000000000..54628defc95 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/mgmt/eventgrid/version.py @@ -0,0 +1,12 @@ +# 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 = "2018-05-01-preview" 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/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 new file mode 100644 index 00000000000..f4340bde17b --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_to_arm_resource_group.yaml @@ -0,0 +1,554 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-25T22:16:13Z"}}' + 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-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 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: ['1090'] + status: {code: 201, message: Created} +- request: + 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: ['421'] + 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":{"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/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 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: ['1115'] + 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/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/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 22:16: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 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":{"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: ['876'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:16: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-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":{"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: ['876'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:16: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 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":{"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: ['876'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:16: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-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: + 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: '{"endpointUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ=="}'} + headers: + cache-control: [no-cache] + content-length: ['138'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22: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] + x-content-type-options: [nosniff] + 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: + 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: '{"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: ['876'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:18: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=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: ['310'] + 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: PATCH + 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://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/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 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: ['1117'] + 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.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/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/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 22: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] + 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.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":{"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: ['880'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22: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] + 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.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: '{"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: ['892'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:18: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: 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: + 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: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + 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/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: ['1180'] + 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/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 22:20:59 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 22:21:00 GMT'] + expires: ['-1'] + 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: ['1175'] + 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_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..7d3f56cfeed --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_20180501_features.yaml @@ -0,0 +1,350 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-25T22:21: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-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 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: ['1129'] + 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/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/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/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 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: ['1149'] + 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/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/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 22:21: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 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/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/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 22:21: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 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/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/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 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] + 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/eventsubscription1?api-version=2018-05-01-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + 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/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: ['1162'] + 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/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 22:21:44 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 22:21:45 GMT'] + expires: ['-1'] + 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: ['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 new file mode 100644 index 00000000000..eab1d1b8546 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_event_subscriptions_with_filters.yaml @@ -0,0 +1,438 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-25T22:21:45Z"}}' + 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-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 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: ['1173'] + status: {code: 201, message: Created} +- request: + body: '{"properties": {"destination": {"endpointType": "WebHook", "properties": + {"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: ['501'] + 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":{"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/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 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: ['1178'] + 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/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/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: ['270'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:21: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 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: '{"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:22:59 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 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":{"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: ['940'] + content-type: [application/json; charset=utf-8] + 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} +- 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":{"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: ['940'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:23:01 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: '{"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: + 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":{"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: ['940'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:24:01 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.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:25:02 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 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: '{"endpointUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ=="}'} + headers: + cache-control: [no-cache] + content-length: ['138'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:25: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] + x-content-type-options: [nosniff] + 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: + 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: '{"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: ['952'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:26: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 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: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + 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/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: ['1144'] + 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/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 22:26:18 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 22:26:20 GMT'] + expires: ['-1'] + 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: ['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 new file mode 100644 index 00000000000..bd1ce2c28f9 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_create_topic.yaml @@ -0,0 +1,1214 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-25T22:26:20Z"}}' + 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-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 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: ['1119'] + status: {code: 201, message: Created} +- request: + body: '{"location": "eastus2euap", "properties": {"inputSchema": "EventGridSchema"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic create] + Connection: [keep-alive] + Content-Length: ['77'] + 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?api-version=2018-05-01-preview + 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/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 22:26:23 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: ['1174'] + 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/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/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 22:26: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] + 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-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 22:26: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] + 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 22:26: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] + 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/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 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: ['1140'] + 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/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/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 22:26:47 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/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 22:26: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.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": + {}, "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: '{"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/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 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: ['1177'] + 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/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/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 22:29: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 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/cli000004?api-version=2018-05-01-preview + response: + 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: ['894'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:29: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 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: '{"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:30:15 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 22:30: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: '{"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] + 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: '{"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:31:15 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: '{"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] + 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: '{"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: ['546'] + content-type: [application/json; charset=utf-8] + 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] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1148'] + 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.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/4798C616-5004-473D-B3F6-3679683162E2?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/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: ['292'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:31: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-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.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-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"}'} + headers: + cache-control: [no-cache] + content-length: ['547'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:31: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-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.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 + 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"}]}'} + headers: + cache-control: [no-cache] + content-length: ['1997'] + content-type: [application/json; charset=utf-8] + 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] + 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.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 + response: + 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 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-ratelimit-remaining-subscription-writes: ['1153'] + 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.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-05-01-preview + response: + 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 22:31: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: ['1137'] + 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.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-05-01-preview + response: + 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 22:31: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] + x-ms-ratelimit-remaining-subscription-writes: ['1155'] + status: {code: 200, message: OK} +- request: + 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] + 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: '{"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/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 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: ['1092'] + 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/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/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 22:31: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 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/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://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: ['1060'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:31: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 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/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://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: ['1060'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:31: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 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/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://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: ['1060'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:31: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: 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/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005/getFullUrl?api-version=2018-05-01-preview + response: + body: {string: '{"endpointUrl":"https://kalsfunc1.azurewebsites.net/api/HttpTriggerCSharp1?code=D5/lX4xgFOvJrgvgZsjhMpg9h/eC3XVdQzGuDvwQuGmrDUfxFNeyiQ=="}'} + headers: + cache-control: [no-cache] + content-length: ['138'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:31: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] + x-ms-ratelimit-remaining-subscription-writes: ['1164'] + 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/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://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: ['1060'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:31:47 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=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: ['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.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/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://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/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 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: ['1125'] + 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.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: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/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 22:34:01 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.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/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://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: ['1060'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:34:01 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.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?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://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: ['1072'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:34: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 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/topics/cli000002/providers/Microsoft.EventGrid/eventSubscriptions/cli000005?api-version=2018-05-01-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + 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/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: ['1102'] + 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/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 22:34:15 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: [eventgrid topic 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/topics/cli000002?api-version=2018-05-01-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + 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/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: ['1126'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [eventgrid topic 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/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 + period."}}'} + headers: + cache-control: [no-cache] + connection: [close] + content-length: ['147'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 25 Apr 2018 22:35:26 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 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/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 22:35:27 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 22:35:28 GMT'] + expires: ['-1'] + 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: ['1175'] + 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..bbe096695d7 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py @@ -0,0 +1,313 @@ +# -------------------------------------------------------------------------------------------- +# 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 +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({ + '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): + 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, + '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=[ + 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']), + ]) + + # Test various failure conditions + # Input mappings cannot be provided when input schema is not customeventschema + 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): + 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): + 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'}), + ]) + + 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 {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', self.kwargs['endpoint_baseurl']) + ]) + + 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', 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 {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', self.kwargs['endpoint_baseurl']) + ]) + + 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://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_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_baseurl']) + ]) + + 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 {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', self.kwargs['endpoint_baseurl']), + 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}') + + @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, + '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 {endpoint_url}', 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', self.kwargs['endpoint_url']), + ]) + + 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', self.kwargs['endpoint_baseurl']), + 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://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' + label_1 = 'Finance' + label_2 = 'HR' + + 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, + '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}') + + @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/hybridConnections/kalstest' + + 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): + 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): + 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}') 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..12a7ef59458 --- /dev/null +++ b/src/eventgrid/setup.py @@ -0,0 +1,42 @@ +#!/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='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', + 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 +) diff --git a/src/image-copy/azext_imagecopy/__init__.py b/src/image-copy/azext_imagecopy/__init__.py index 9525a5baaa7..fc0c43d50b5 100644 --- a/src/image-copy/azext_imagecopy/__init__.py +++ b/src/image-copy/azext_imagecopy/__init__.py @@ -39,6 +39,8 @@ def load_arguments(self, _): help='Number of parallel copy operations') c.argument('cleanup', options_list=['--cleanup'], action='store_true', default=False, help='Include this switch to delete temporary resources upon completion') + c.argument('target_name', options_list=['--target-name'], + help='Name of the final image that will be created') COMMAND_LOADER_CLS = ImageCopyCommandsLoader diff --git a/src/image-copy/azext_imagecopy/cli_utils.py b/src/image-copy/azext_imagecopy/cli_utils.py index fe163c464dc..28e92747636 100644 --- a/src/image-copy/azext_imagecopy/cli_utils.py +++ b/src/image-copy/azext_imagecopy/cli_utils.py @@ -12,6 +12,8 @@ from knack.log import get_logger logger = get_logger(__name__) +EXTENSION_TAG_STRING = 'created_by=image-copy-extension' + # pylint: disable=inconsistent-return-statements def run_cli_command(cmd, return_as_json=False): @@ -36,7 +38,7 @@ def run_cli_command(cmd, return_as_json=False): raise -def prepare_cli_command(cmd, output_as_json=True): +def prepare_cli_command(cmd, output_as_json=True, tags=None): full_cmd = [sys.executable, '-m', 'azure.cli'] + cmd if output_as_json: @@ -46,6 +48,9 @@ def prepare_cli_command(cmd, output_as_json=True): # tag newly created resources, containers don't have tags if 'create' in cmd and ('container' not in cmd): - full_cmd += ['--tags', 'created_by=image-copy-extension'] + full_cmd += ['--tags', EXTENSION_TAG_STRING] + + if tags is not None: + full_cmd += tags.split() return full_cmd diff --git a/src/image-copy/azext_imagecopy/create_target.py b/src/image-copy/azext_imagecopy/create_target.py index 71673d34bcc..d09f8772bef 100644 --- a/src/image-copy/azext_imagecopy/create_target.py +++ b/src/image-copy/azext_imagecopy/create_target.py @@ -12,19 +12,20 @@ from knack.log import get_logger logger = get_logger(__name__) -PROGRESS_LINE_LENGTH = 40 +STORAGE_ACCOUNT_NAME_LENGTH = 24 # pylint: disable=too-many-locals def create_target_image(location, transient_resource_group_name, source_type, source_object_name, source_os_disk_snapshot_name, source_os_disk_snapshot_url, source_os_type, - target_resource_group_name, azure_pool_frequency): + target_resource_group_name, azure_pool_frequency, tags, target_name): subscription_id = get_subscription_id() subscription_hash = hashlib.sha1( subscription_id.encode("UTF-8")).hexdigest() - unique_subscription_string = subscription_hash[:7] + unique_subscription_string = subscription_hash[:( + STORAGE_ACCOUNT_NAME_LENGTH - len(location))] # create the target storage account logger.warn( @@ -92,7 +93,7 @@ def create_target_image(location, transient_resource_group_name, source_type, so wait_for_blob_copy_operation(blob_name, target_container_name, target_storage_account_name, azure_pool_frequency, location) msg = "{0} - Copy time: {1}".format( - location, datetime.datetime.now() - start_datetime).ljust(PROGRESS_LINE_LENGTH) + location, datetime.datetime.now() - start_datetime) logger.warn(msg) # Create the snapshot in the target region from the copied blob @@ -112,10 +113,13 @@ def create_target_image(location, transient_resource_group_name, source_type, so # Create the final image logger.warn("%s - Creating final image", location) - target_image_name = source_object_name - if source_type != 'image': - target_image_name += '-image' - target_image_name += '-' + location + if target_name is None: + target_image_name = source_object_name + if source_type != 'image': + target_image_name += '-image' + target_image_name += '-' + location + else: + target_image_name = target_name cli_cmd = prepare_cli_command(['image', 'create', '--resource-group', target_resource_group_name, @@ -123,7 +127,7 @@ def create_target_image(location, transient_resource_group_name, source_type, so '--location', location, '--source', target_blob_path, '--os-type', source_os_type, - '--source', target_snapshot_id]) + '--source', target_snapshot_id], tags=tags) run_cli_command(cli_cmd) @@ -147,8 +151,7 @@ def wait_for_blob_copy_operation(blob_name, target_container_name, target_storag if current_progress != prev_progress: msg = "{0} - Copy progress: {1}%"\ - .format(location, str(current_progress))\ - .ljust(PROGRESS_LINE_LENGTH) # need to justify since messages overide each other + .format(location, str(current_progress)) logger.warn(msg) prev_progress = current_progress diff --git a/src/image-copy/azext_imagecopy/custom.py b/src/image-copy/azext_imagecopy/custom.py index 7a503982b54..bc8b6f04a5b 100644 --- a/src/image-copy/azext_imagecopy/custom.py +++ b/src/image-copy/azext_imagecopy/custom.py @@ -8,13 +8,15 @@ from azext_imagecopy.cli_utils import run_cli_command, prepare_cli_command from azext_imagecopy.create_target import create_target_image +from knack.util import CLIError from knack.log import get_logger logger = get_logger(__name__) # pylint: disable=too-many-statements def imagecopy(source_resource_group_name, source_object_name, target_location, - target_resource_group_name, source_type='image', cleanup='false', parallel_degree=-1): + target_resource_group_name, source_type='image', cleanup='false', + parallel_degree=-1, tags=None, target_name=None): # get the os disk id from source vm/image logger.warn("Getting os disk id of the source vm/image") @@ -24,6 +26,14 @@ def imagecopy(source_resource_group_name, source_object_name, target_location, json_cmd_output = run_cli_command(cli_cmd, return_as_json=True) + if 'id' not in json_cmd_output['storageProfile']['osDisk']['managedDisk']: + logger.error( + "It looks like the source resource isn't backed by a managed OS disk. Quitting...") + raise CLIError('Source with no Managed OS disk') + + if json_cmd_output['storageProfile']['dataDisks']: + logger.warn("Data disks in the source detected, but are ignored by this extension!") + source_os_disk_id = json_cmd_output['storageProfile']['osDisk']['managedDisk']['id'] source_os_type = json_cmd_output['storageProfile']['osDisk']['osType'] logger.debug("source_os_disk_id: %s. source_os_type: %s", @@ -80,7 +90,8 @@ def imagecopy(source_resource_group_name, source_object_name, target_location, location = location.strip() tasks.append((location, transient_resource_group_name, source_type, source_object_name, source_os_disk_snapshot_name, source_os_disk_snapshot_url, - source_os_type, target_resource_group_name, azure_pool_frequency)) + source_os_type, target_resource_group_name, azure_pool_frequency, + tags, target_name)) logger.warn("Starting async process for all locations") diff --git a/src/image-copy/setup.py b/src/image-copy/setup.py index 986ffc256d9..46b084c9c13 100644 --- a/src/image-copy/setup.py +++ b/src/image-copy/setup.py @@ -8,7 +8,7 @@ from codecs import open from setuptools import setup, find_packages -VERSION = "0.0.5" +VERSION = "0.0.6" CLASSIFIERS = [ 'Development Status :: 4 - Beta', @@ -29,8 +29,8 @@ setup( name='image-copy-extension', version=VERSION, - description='An Azure CLI Extension that copies images from region to region.', - long_description='An Azure CLI Extension that copies images from region to region.', + description='Support for copying managed vm images between regions', + long_description='Support for copying managed vm images between regions', license='MIT', author='Tamir Kamara', author_email='tamir.kamara@microsoft.com', diff --git a/src/index.json b/src/index.json index f9534f8fc5e..b512142120f 100644 --- a/src/index.json +++ b/src/index.json @@ -231,6 +231,50 @@ "summary": "An Azure CLI Extension that copies images from region to region.", "version": "0.0.5" } + }, + { + "filename": "image_copy_extension-0.0.6-py2.py3-none-any.whl", + "sha256Digest": "986ab7ab186974bb2c365bf4092ed5dd554b00017ddf4c70ea07a53bcaa6bcc7", + "downloadUrl": "https://files.pythonhosted.org/packages/ed/60/306879ce292e087d329ed15c7c63f42e880371ec8cc624c17bb28a1f937b/image_copy_extension-0.0.6-py2.py3-none-any.whl", + "metadata": { + "azext.minCliCoreVersion": "2.0.24", + "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" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "tamir.kamara@microsoft.com", + "name": "Tamir Kamara", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "image-copy-extension", + "summary": "Support for copying managed vm images between regions", + "version": "0.0.6" + } } ], "aem": [ @@ -281,9 +325,9 @@ ], "webapp": [ { - "filename": "webapp-0.2.1-py2.py3-none-any.whl", - "sha256Digest": "fe3b28cc9cb2272a36c395ed6279b2a9f925b16877962bf2448a3fa56819bfa4", - "downloadUrl": "https://github.com/panchagnula/azure-cli-extensions/raw/sisirap-extensions-whl/dist/webapp-0.2.1-py2.py3-none-any.whl", + "filename": "webapp-0.2.2-py2.py3-none-any.whl", + "sha256Digest": "db8bdba11e6814ceeff37063d0e7548dab42f9e33a64b4c4a5b7ffea0bc93884", + "downloadUrl": "https://github.com/panchagnula/azure-cli-extensions/raw/sisirap-extensions-whl/dist/webapp-0.2.2-py2.py3-none-any.whl", "metadata": { "azext.isPreview": true, "azext.minCliCoreVersion": "2.0.24", @@ -322,7 +366,7 @@ "metadata_version": "2.0", "name": "webapp", "summary": "An Azure CLI Extension to manage appservice resources", - "version": "0.2.1" + "version": "0.2.2" } } ], @@ -655,9 +699,9 @@ ], "keyvault-preview": [ { - "filename": "keyvault_preview-0.1.1-py2.py3-none-any.whl", - "sha256Digest": "be43e972cfd75797db01af7fcf99e086a9bf9ce4b3f8cadce0bab4e60e1d374a", - "downloadUrl": "https://github.com/Azure/azure-keyvault-cli-extension/releases/download/keyvault-preview_0.1.1/keyvault_preview-0.1.1-py2.py3-none-any.whl", + "filename": "keyvault_preview-0.1.2-py2.py3-none-any.whl", + "sha256Digest": "80ca613072fd06fb1c0ed6e9096d10809f1f7b972f141e78393743c2d89b91f8", + "downloadUrl": "https://github.com/Azure/azure-keyvault-cli-extension/releases/download/keyvault-preview_0.1.2/keyvault_preview-0.1.2-py2.py3-none-any.whl", "metadata": { "azext.isPreview": true, "classifiers": [ @@ -695,7 +739,54 @@ "metadata_version": "2.0", "name": "keyvault-preview", "summary": "Preview Azure Key Vault commands.", - "version": "0.1.1" + "version": "0.1.2" + } + } + ], + "eventgrid": [ + { + "filename": "eventgrid-0.2.0-py2.py3-none-any.whl", + "sha256Digest": "c26ee3b5bc9e8f109b370ec20b25697d71fc9d4e8700f5f03e452b66c9eaedb2", + "downloadUrl": "https://eventgridcliextension.blob.core.windows.net/cli/eventgrid-0.2.0-py2.py3-none-any.whl", + "metadata": { + "azext.minCliCoreVersion": "2.0.24", + "azext.isPreview": true, + "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" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "kalyanaj@microsoft.com", + "name": "J. Kalyana Sundaram", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "eventgrid", + "summary": "Support for Azure EventGrid 2018-05-01-preview features", + "version": "0.2.0" } } ] diff --git a/src/webapp/azext_webapp/__init__.py b/src/webapp/azext_webapp/__init__.py index a5777d75e55..f2f3b0d04bf 100644 --- a/src/webapp/azext_webapp/__init__.py +++ b/src/webapp/azext_webapp/__init__.py @@ -24,6 +24,8 @@ def load_command_table(self, _): with self.command_group('webapp') as g: g.custom_command('up', 'create_deploy_webapp') g.custom_command('tunnel create','create_tunnel') + g.custom_command('config snapshot list', 'list_webapp_snapshots') + g.custom_command('config snapshot restore', 'restore_webapp_snapshot') return self.command_table def load_arguments(self, _): @@ -34,6 +36,19 @@ def load_arguments(self, _): default=False, action='store_true') with self.argument_contect('webapp tunnel create') as c: c.argument('port',options_list=['--port', '-p'], help='Port for the remote connection', type=int) + with self.argument_context('webapp config snapshot list') as c: + c.argument('resource_group', options_list=['--resource-group', '-g'], help='Name of resource group.') + c.argument('name', options_list=['--webapp-name', '-n'], help='Name of the webapp.') + c.argument('slot', options_list=['--slot', '-s'], help='Name of the webapp slot.') + with self.argument_context('webapp config snapshot restore') as c: + c.argument('resource_group', options_list=['--resource-group', '-g'], help='Name of resource group to restore to.') + c.argument('name', options_list=['--webapp-name', '-n'], help='Name of the webapp to restore to.') + c.argument('time', options_list=['--time', '-t'], help='Timestamp of the snapshot to restore.') + c.argument('slot', options_list=['--slot', '-s'], help='Name of the webapp slot to restore to.') + c.argument('restore_config', options_list=['--restore-config'], help='Restore the previous configuration along with web app content.') + c.argument('source_resource_group', options_list=['--source-resource-group'], help='Name of the resource group to retrieve snapshot from.') + c.argument('source_name', options_list=['--source-webapp-name'], help='Name of the webapp to retrieve snapshot from.') + c.argument('source_slot', options_list=['--source-slot'], help='Name of the webapp slot to retrieve snapshot from.') COMMAND_LOADER_CLS = WebappExtCommandLoader diff --git a/src/webapp/azext_webapp/_help.py b/src/webapp/azext_webapp/_help.py index ea682c09e07..c8d9cb2f065 100644 --- a/src/webapp/azext_webapp/_help.py +++ b/src/webapp/azext_webapp/_help.py @@ -24,4 +24,26 @@ helps['webapp tunnel create'] = """ type: command short-summary: Create a remote connection using a tcp tunnel to your app + +helps['webapp config snapshot list'] = """ + type: command + short-summary: List the snapshots available for a web app. + Snapshots are automatically managed backups of web app content and configuration. + examples: + - name: List the snapshots available for a web app named MyApp. + text: > + az webapp config snapshot list -g Default-Web-WestUS -n MyApp +""" + +helps['webapp config snapshot restore'] = """ + type: command + short-summary: Restore a snapshot to a web app. + A snapshot from a different web app or slot can be restored by specifying the source. + examples: + - name: Overwrite a web app with its own snapshot. + text: > + az webapp config snapshot restore -g Default-Web-WestUS -n MyApp -t 2018-04-25T00:09:20.8736381Z + - name: Overwrite a web app's staging slot with a snapshot from its production slot. + text: > + az webapp config snapshot restore -g Default-Web-WestUS -n MyApp -s staging -t 2018-04-25T00:09:20.8736381Z --source-resource-group Default-Web-WestUS --source-name MyApp --restore-config """ diff --git a/src/webapp/azext_webapp/custom.py b/src/webapp/azext_webapp/custom.py index cc3244a6cbf..5e34b234bd2 100644 --- a/src/webapp/azext_webapp/custom.py +++ b/src/webapp/azext_webapp/custom.py @@ -5,8 +5,11 @@ from __future__ import print_function from knack.log import get_logger +from knack.util import CLIError -from azure.mgmt.web.models import (AppServicePlan, SkuDescription) +from azure.mgmt.web.models import (AppServicePlan, SkuDescription, SnapshotRecoveryRequest, SnapshotRecoveryTarget) + +from azure.cli.core.commands.client_factory import get_subscription_id from azure.cli.command_modules.appservice.custom import ( enable_zip_deploy, @@ -212,4 +215,35 @@ def create_tunnel(cmd, resource_group_name, name, port, slot=None): if _check_for_ready_tunnel(cmd, resource_group_name, name, config.remote_debugging_enabled, slot): break print('Tunnel is ready! Creating on port {}'.format(port)) - tunnel_server.start_server() \ No newline at end of file + tunnel_server.start_server() + +def list_webapp_snapshots(cmd, resource_group, name, slot=None): + client = web_client_factory(cmd.cli_ctx) + if slot is None: + return client.web_apps.list_snapshots(resource_group, name) + else: + return client.web_apps.list_snapshots_slot(resource_group, name, slot) + + +def restore_webapp_snapshot(cmd, resource_group, name, time, slot=None, restore_config=False, source_resource_group=None, source_name=None, source_slot=None): + client = web_client_factory(cmd.cli_ctx) + + if all([source_resource_group, source_name]): + sub_id = get_subscription_id(cmd.cli_ctx) + target_id = "/subscriptions/" + sub_id + "/resourceGroups/" + resource_group + "/providers/Microsoft.Web/sites/" + name + if slot: + target_id = target_id + "/slots/" + slot + target = SnapshotRecoveryTarget(id=target_id) + request = SnapshotRecoveryRequest(False, snapshot_time=time, recovery_target=target, recover_configuration=restore_config) + if source_slot: + return client.web_apps.recover_slot(source_resource_group, source_name, request, source_slot) + else: + return client.web_apps.recover(source_resource_group, source_name, request) + elif any([source_resource_group, source_name]): + raise CLIError('usage error: --source-resource-group and --source-name must both be specified if one is used') + else: + request = SnapshotRecoveryRequest(True, snapshot_time=time, recover_configuration=restore_config) + if slot: + return client.web_apps.recover_slot(resource_group, name, request, slot) + else: + return client.web_apps.recover(resource_group, name, request) diff --git a/src/webapp/setup.py b/src/webapp/setup.py index 6dc1e9a56f9..a5c94a56fb2 100644 --- a/src/webapp/setup.py +++ b/src/webapp/setup.py @@ -8,7 +8,7 @@ from codecs import open from setuptools import setup, find_packages -VERSION = "0.2.1" +VERSION = "0.2.2" CLASSIFIERS = [ 'Development Status :: 4 - Beta',