1# -------------------------------------------------------------------------------------------- 2# Copyright (c) Microsoft Corporation. All rights reserved. 3# Licensed under the MIT License. See License.txt in the project root for license information. 4# -------------------------------------------------------------------------------------------- 5 6# pylint: disable=line-too-long 7 8from knack.arguments import CLIArgumentType 9 10from azure.cli.core.commands.parameters import ( 11 resource_group_name_type, 12 get_resource_name_completion_list, 13 get_three_state_flag, 14 get_location_type, 15 get_enum_type, 16 tags_type, 17 name_type 18) 19 20from .advanced_filter import EventSubscriptionAddFilter 21from .event_channel_filter import EventChannelAddFilter 22from .inbound_ip_rules import AddInboundIpRule 23from .delivery_attribute_mapping import AddDeliveryAttributeMapping 24 25included_event_types_type = CLIArgumentType( 26 help="A space-separated list of event types (e.g., Microsoft.Storage.BlobCreated and Microsoft.Storage.BlobDeleted). In order to subscribe to all default event types, do not specify any value for this argument. For event grid topics, event types are customer defined. For Azure events, e.g., Storage Accounts, IoT Hub, etc., you can query their event types using this CLI command 'az eventgrid topic-type list-event-types'.", 27 nargs='+' 28) 29 30labels_type = CLIArgumentType( 31 help="A space-separated list of labels to associate with this event subscription.", 32 nargs='+' 33) 34 35authorized_subscription_ids_type = CLIArgumentType( 36 help="A space-separated list of Azure subscription Ids that are authorized to create a partner namespace associated with this partner registration. This is an optional property. Creating partner namespaces is always permitted under the same Azure subscription as the one used for creating the partner registration.", 37 nargs='+' 38) 39 40input_schema_type = CLIArgumentType( 41 help="Schema in which incoming events will be published to this topic/domain. If you specify customeventschema as the value for this parameter, you must also provide values for at least one of --input_mapping_default_values / --input_mapping_fields.", 42 arg_type=get_enum_type(['eventgridschema', 'customeventschema', 'cloudeventschemav1_0'], default='eventgridschema') 43) 44 45public_network_access_type = CLIArgumentType( 46 help="This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring.", 47 arg_type=get_enum_type(['enabled', 'disabled']), 48 options_list=['--public-network-access'] 49) 50 51sku_type = CLIArgumentType( 52 help="The Sku name of the resource.", 53 arg_type=get_enum_type(['basic', 'premium']), 54 options_list=['--sku'], 55 is_preview=True 56) 57 58identity_type = CLIArgumentType( 59 help="The managed identity type for the resource.", 60 arg_type=get_enum_type(['noidentity', 'systemassigned']), 61 options_list=['--identity'], 62 is_preview=True 63) 64 65delivery_identity_type = CLIArgumentType( 66 help="The identity type of the delivery destination resource (e.g., storage queue, or eventhub).", 67 arg_type=get_enum_type(['systemassigned']), 68 options_list=['--delivery-identity'], 69 is_preview=True 70) 71 72deadletter_identity_type = CLIArgumentType( 73 help="The identity type of the deadletter destination resource.", 74 arg_type=get_enum_type(['systemassigned']), 75 options_list=['--deadletter-identity'], 76 is_preview=True 77) 78 79input_mapping_fields_type = CLIArgumentType( 80 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. If a mapping for either 'id' or 'eventtime' is not provided, Event Grid will auto-generate a default value for these two fields.", 81 arg_type=tags_type 82) 83 84input_mapping_default_values_type = CLIArgumentType( 85 help="When input-schema is specified as customeventschema, this parameter can be used to specify input mappings based on default values. You can use this parameter when your custom schema does not include a field that corresponds to one of the three fields supported by this parameter. 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 and they will be used only when the published event doesn't have a valid mapping for a particular field.", 86 arg_type=tags_type 87) 88 89odata_query_type = CLIArgumentType( 90 help="The OData query used for filtering the list results. Filtering is currently allowed on the Name property only. The supported operations include: CONTAINS, eq (for equal), ne (for not equal), AND, OR and NOT.", 91 options_list=['--odata-query'] 92) 93 94topic_name_type = CLIArgumentType( 95 help='Name of the topic.', 96 arg_type=name_type, 97 options_list=['--topic-name'], 98 completer=get_resource_name_completion_list('Microsoft.EventGrid/topics')) 99 100domain_name_type = CLIArgumentType( 101 help='Name of the domain.', 102 arg_type=name_type, 103 options_list=['--domain-name'], 104 completer=get_resource_name_completion_list('Microsoft.EventGrid/domains')) 105 106domain_topic_name_type = CLIArgumentType( 107 help='Name of the domain topic.', 108 arg_type=name_type, 109 options_list=['--domain-topic-name'], 110 completer=get_resource_name_completion_list('Microsoft.EventGrid/domains/topic')) 111 112system_topic_name_type = CLIArgumentType( 113 help='Name of the system topic.', 114 arg_type=name_type, 115 options_list=['--system-topic-name'], 116 completer=get_resource_name_completion_list('Microsoft.EventGrid/systemtopics')) 117 118partner_registration_name_type = CLIArgumentType( 119 help='Name of the partner registration.', 120 arg_type=name_type, 121 options_list=['--partner-registration-name'], 122 completer=get_resource_name_completion_list('Microsoft.EventGrid/partnerregistrations')) 123 124partner_namespace_name_type = CLIArgumentType( 125 help='Name of the partner namespace.', 126 arg_type=name_type, 127 options_list=['--partner-namespace-name'], 128 completer=get_resource_name_completion_list('Microsoft.EventGrid/partnernamespaces')) 129 130event_channel_name_type = CLIArgumentType( 131 help='Name of the event channel.', 132 arg_type=name_type, 133 options_list=['--event-channel-name'], 134 completer=get_resource_name_completion_list('Microsoft.EventGrid/partnernamespaces/eventchannels')) 135 136partner_topic_name_type = CLIArgumentType( 137 help='Name of the partner topic.', 138 arg_type=name_type, 139 options_list=['--partner-topic-name'], 140 completer=get_resource_name_completion_list('Microsoft.EventGrid/partnertopics')) 141 142partner_topic_source_type = CLIArgumentType( 143 help='The identifier of the resource that forms the partner source of the events. This represents a unique resource in the partner\'s resource model.', 144 arg_type=name_type, 145 options_list=['--partner-topic-source']) 146 147phone_number_type = CLIArgumentType( 148 help='The customer service number of the publisher. The expected phone format should start with a \'+\' sign' 149 ' followed by the country code. The remaining digits are then followed. Only digits and spaces are allowed and its' 150 ' length cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 4567 and' 151 ' +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43.') 152 153phone_extension_type = CLIArgumentType( 154 help='The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not exceed 10.') 155 156kind_type = CLIArgumentType( 157 help="The kind of topic resource.", 158 arg_type=get_enum_type(['azure', 'azurearc']), 159 options_list=['--kind'], 160 is_preview=True 161) 162 163extended_location_name = CLIArgumentType( 164 help="The extended location name if kind==azurearc.", 165 options_list=['--extended-location-name'], 166 arg_group="Azure Arc", 167 is_preview=True 168) 169 170extended_location_type = CLIArgumentType( 171 help="The extended location type if kind==azurearc.", 172 arg_type=get_enum_type(['customlocation']), 173 arg_group="Azure Arc", 174 options_list=['--extended-location-type'], 175 is_preview=True 176) 177 178 179def load_arguments(self, _): # pylint: disable=too-many-statements 180 with self.argument_context('eventgrid') as c: 181 c.argument('resource_group_name', arg_type=resource_group_name_type) 182 c.argument('location', arg_type=get_location_type(self.cli_ctx)) 183 c.argument('tags', arg_type=tags_type) 184 c.argument('included_event_types', arg_group="Filtering", arg_type=included_event_types_type) 185 c.argument('labels', arg_type=labels_type) 186 c.argument('endpoint_type', arg_type=get_enum_type(['webhook', 'eventhub', 'storagequeue', 'hybridconnection', 'servicebusqueue', 'servicebustopic', 'azurefunction'], default='webhook')) 187 c.argument('delivery_identity_endpoint_type', arg_type=get_enum_type(['webhook', 'eventhub', 'storagequeue', 'hybridconnection', 'servicebusqueue', 'servicebustopic', 'azurefunction'], default=None), is_preview=True) 188 c.argument('source_resource_id', help="Fully qualified identifier of the source Azure resource.") 189 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. It is expected that the destination endpoint to be already created and available for use before executing any Event Grid command.") 190 c.argument('delivery_identity_endpoint', help="Endpoint with identity 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.", is_preview=True) 191 c.argument('event_subscription_name', help="Name of the event subscription.") 192 c.argument('subject_begins_with', arg_group="Filtering", help="An optional string to filter events for an event subscription based on a prefix. Wildcard characters are not supported.") 193 c.argument('subject_ends_with', arg_group="Filtering", help="An optional string to filter events for an event subscription based on a suffix. Wildcard characters are not supported.") 194 c.argument('topic_type_name', help="Name of the topic type.") 195 c.argument('is_subject_case_sensitive', arg_group="Filtering", 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.", ) 196 c.argument('input_mapping_fields', arg_type=input_mapping_fields_type) 197 c.argument('input_mapping_default_values', arg_type=input_mapping_default_values_type) 198 c.argument('input_schema', arg_type=input_schema_type) 199 c.argument('odata_query', arg_type=odata_query_type) 200 c.argument('domain_name', arg_type=domain_name_type) 201 c.argument('domain_topic_name', arg_type=domain_topic_name_type) 202 c.argument('system_topic_name', arg_type=system_topic_name_type) 203 c.argument('source', help="The ARM Id for the topic, e.g., /subscriptions/{SubId}/resourceGroups/{RgName}/providers/Microsoft.Storage/storageAccounts/{AccountName}") 204 c.argument('public_network_access', arg_type=public_network_access_type) 205 c.argument('inbound_ip_rules', action=AddInboundIpRule, nargs='+') 206 c.argument('sku', arg_type=sku_type) 207 c.argument('identity', arg_type=identity_type) 208 c.argument('delivery_identity', arg_type=delivery_identity_type) 209 c.argument('deadletter_identity', arg_type=deadletter_identity_type) 210 c.argument('partner_registration_name', arg_type=partner_registration_name_type) 211 c.argument('partner_namespace_name', arg_type=partner_namespace_name_type) 212 c.argument('event_channel_name', arg_type=event_channel_name_type) 213 c.argument('partner_topic_name', arg_type=partner_topic_name_type) 214 c.argument('authorized_subscription_ids', arg_type=authorized_subscription_ids_type) 215 c.argument('partner_name', help="Official name of the partner.") 216 c.argument('display_name', help="Display name for the partner topic type.") 217 c.argument('resource_type_name', help="Name of the partner topic resource type. This name should be unique among all partner topic types names.") 218 c.argument('description', help="Description of the partner topic type.") 219 c.argument('logo_uri', help="URI of the partner logo.") 220 c.argument('setup_uri', help="URI of the partner website that can be used by Azure customers to setup Event Grid integration on an event source.") 221 c.argument('partner_registration_id', help="The fully qualified ARM Id of the partner registration that should be associated with this partner namespace. This takes the following format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}.") 222 c.argument('partner_topic_source', arg_type=partner_topic_source_type) 223 c.argument('destination_topic_name', help="Name of the partner topic associated with the event channel.") 224 c.argument('destination_resource_group_name', help="Azure Resource Group of the customer creating the event channel. The partner topic associated with the event channel will be created under this resource group.") 225 c.argument('destination_subscription_id', help="Azure subscription Id of the customer creating the event channel. The partner topic associated with the event channel will be created under this Azure subscription.") 226 c.argument('topic_type', help="Name of the topic type.", completer=get_resource_name_completion_list('Microsoft.EventGrid/topictypes')) 227 228 with self.argument_context('eventgrid topic') as c: 229 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')) 230 c.argument('kind', arg_type=kind_type) 231 c.argument('extended_location_name', arg_type=extended_location_name) 232 c.argument('extended_location_type', arg_type=extended_location_type) 233 234 with self.argument_context('eventgrid topic key') as c: 235 c.argument('topic_name', arg_type=name_type, help='Name of the topic', id_part=None, completer=get_resource_name_completion_list('Microsoft.EventGrid/topics')) 236 c.argument('key_name', help='Key name to regenerate key1 or key2') 237 238 with self.argument_context('eventgrid topic list') as c: 239 c.argument('odata_query', arg_type=odata_query_type, id_part=None) 240 241 with self.argument_context('eventgrid domain') as c: 242 c.argument('domain_name', arg_type=domain_name_type, options_list=['--name', '-n'], id_part='name') 243 244 with self.argument_context('eventgrid domain list') as c: 245 c.argument('odata_query', arg_type=odata_query_type, id_part=None) 246 247 with self.argument_context('eventgrid domain key') as c: 248 c.argument('domain_name', arg_type=domain_name_type, options_list=['--name', '-n'], id_part=None) 249 c.argument('key_name', help='Key name to regenerate key1 or key2') 250 251 with self.argument_context('eventgrid domain topic') as c: 252 c.argument('domain_name', arg_type=domain_name_type, id_part='name') 253 c.argument('domain_topic_name', arg_type=domain_topic_name_type, options_list=['--name', '-n'], id_part='topics') 254 255 with self.argument_context('eventgrid domain topic list') as c: 256 c.argument('domain_name', arg_type=domain_name_type, id_part=None) 257 c.argument('odata_query', arg_type=odata_query_type, id_part=None) 258 259 with self.argument_context('eventgrid system-topic') as c: 260 c.argument('system_topic_name', arg_type=system_topic_name_type, options_list=['--name', '-n'], id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/systemtopics')) 261 262 with self.argument_context('eventgrid system-topic create') as c: 263 c.argument('source', help="The ARM Id for the topic, e.g., /subscriptions/{SubId}/resourceGroups/{RgName}/providers/Microsoft.Storage/storageAccounts/{AccountName}") 264 265 with self.argument_context('eventgrid system-topic list') as c: 266 c.argument('odata_query', arg_type=odata_query_type, id_part=None) 267 268 with self.argument_context('eventgrid partner registration') as c: 269 c.argument('partner_registration_name', arg_type=partner_registration_name_type, options_list=['--name', '-n'], id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/partnerregistrations')) 270 c.argument('long_description', help='Description of the custom scenarios and integration. Length of this description should not exceed 2048 characters', id_part=None) 271 c.argument('customer_service_number', arg_type=phone_number_type, id_part=None) 272 c.argument('customer_service_extension', arg_type=phone_extension_type, id_part=None) 273 c.argument('customer_service_uri', help='The customer service URI of the publisher.', id_part=None) 274 275 with self.argument_context('eventgrid partner registration list') as c: 276 c.argument('odata_query', arg_type=odata_query_type, id_part=None) 277 278 with self.argument_context('eventgrid partner namespace') as c: 279 c.argument('partner_namespace_name', arg_type=partner_namespace_name_type, options_list=['--name', '-n'], id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/partnernamespaces')) 280 281 with self.argument_context('eventgrid partner namespace key') as c: 282 c.argument('partner_namespace_name', arg_type=partner_namespace_name_type, help='Name of the partner namespace', id_part=None, completer=get_resource_name_completion_list('Microsoft.EventGrid/partnernamespaces')) 283 c.argument('key_name', help='Key name to regenerate key1 or key2') 284 285 with self.argument_context('eventgrid partner namespace show') as c: 286 c.argument('partner_namespace_name', arg_type=partner_namespace_name_type, options_list=['--name', '-n'], id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/partnernamespaces')) 287 288 with self.argument_context('eventgrid partner namespace list') as c: 289 c.argument('odata_query', arg_type=odata_query_type, id_part=None) 290 291 with self.argument_context('eventgrid partner namespace event-channel') as c: 292 c.argument('partner_namespace_name', arg_type=partner_namespace_name_type, id_part='name') 293 c.argument('event_channel_name', arg_type=event_channel_name_type, options_list=['--name', '-n'], id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/partnernamespaes/eventchannels')) 294 c.argument('partner_topic_source', arg_type=partner_topic_source_type, options_list=['--source']) 295 c.argument('activation_expiration_date', help="Date or datetime in UTC ISO 8601 format (e.g., '2022-02-17T01:59:59+00:00' or '2022-02-17') after which the event channel and corresponding partner topic would expire and get auto deleted. If this time is not specified, the expiration date is set to seven days by default.") 296 c.argument('partner_topic_description', help="Friendly description of the corresponding partner topic. This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer.") 297 c.argument('publisher_filter', action=EventChannelAddFilter, nargs='+') 298 299 with self.argument_context('eventgrid partner namespace event-channel show') as c: 300 c.argument('partner_namespace_name', arg_type=partner_namespace_name_type, id_part='name') 301 302 with self.argument_context('eventgrid partner namespace event-channel list') as c: 303 c.argument('partner_namespace_name', arg_type=partner_namespace_name_type, id_part=None) 304 c.argument('odata_query', arg_type=odata_query_type, id_part=None) 305 306 with self.argument_context('eventgrid partner topic') as c: 307 c.argument('partner_topic_name', arg_type=partner_topic_name_type, options_list=['--name', '-n'], id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/partnertopics')) 308 309 with self.argument_context('eventgrid partner topic list') as c: 310 c.argument('odata_query', arg_type=odata_query_type, id_part=None) 311 312 with self.argument_context('eventgrid event-subscription') as c: 313 c.argument('event_subscription_name', arg_type=name_type, help='Name of the event subscription.') 314 c.argument('event_delivery_schema', arg_type=get_enum_type(['eventgridschema', 'custominputschema', 'cloudeventschemav1_0']), help='The schema in which events should be delivered for this event subscription. By default, events will be delivered in the same schema in which they are published (based on the corresponding topic\'s input schema).') 315 c.argument('max_delivery_attempts', type=int, help="Maximum number of delivery attempts. Must be a number between 1 and 30.") 316 c.argument('max_events_per_batch', type=int, help="Maximum number of events in a batch. Must be a number between 1 and 5000.") 317 c.argument('preferred_batch_size_in_kilobytes', type=int, help="Preferred batch size in kilobytes. Must be a number between 1 and 1024.") 318 c.argument('event_ttl', type=int, help="Event time to live (in minutes). Must be a number between 1 and 1440.") 319 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.") 320 c.argument('deadletter_identity_endpoint', help="The Azure resource ID of an Azure Storage blob container destination with identity where EventGrid should deadletter undeliverable events for this event subscription.") 321 c.argument('advanced_filter', arg_group="Filtering", action=EventSubscriptionAddFilter, nargs='+') 322 c.argument('expiration_date', help="Date or datetime (in UTC, e.g. '2018-11-30T11:59:59+00:00' or '2018-11-30') after which the event subscription would expire. By default, there is no expiration for the event subscription.") 323 c.argument('azure_active_directory_tenant_id', help="The Azure Active Directory Tenant Id to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination") 324 c.argument('azure_active_directory_application_id_or_uri', help="The Azure Active Directory Application Id or Uri to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination") 325 c.argument('delivery_identity', arg_type=delivery_identity_type) 326 c.argument('deadletter_identity', arg_type=deadletter_identity_type) 327 c.argument('delivery_identity_endpoint', help="Endpoint with identity 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.", is_preview=True) 328 c.argument('delivery_identity_endpoint_type', arg_type=get_enum_type(['webhook', 'eventhub', 'storagequeue', 'hybridconnection', 'servicebusqueue', 'servicebustopic', 'azurefunction'], default=None), is_preview=True) 329 c.argument('enable_advanced_filtering_on_arrays', is_preview=True, arg_type=get_three_state_flag(), 330 options_list=['--enable-advanced-filtering-on-arrays', '--enable-af-arr'], arg_group="Filtering", 331 help="Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.") 332 c.argument('storage_queue_msg_ttl', 333 help="Storage queue message time to live in seconds.", 334 type=int, 335 options_list=['--storage-queue-msg-ttl', '--qttl'], 336 is_preview=True) 337 c.argument('delivery_attribute_mapping', 338 action=AddDeliveryAttributeMapping, 339 nargs='+', 340 is_preview=True, 341 help='Add delivery attribute mapping to send additional information via HTTP headers when delivering events. This attribute is valid for all destination types except StorageQueue. Multiple attributes can be specified by using more than one `--delivery-attribute-mapping` argument', 342 options_list=['--delivery-attribute-mapping']) 343 344 with self.argument_context('eventgrid event-subscription list') as c: 345 c.argument('odata_query', arg_type=odata_query_type, id_part=None) 346 347 with self.argument_context('eventgrid event-subscription show') as c: 348 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.") 349 c.argument('include_static_delivery_attribute_secret', arg_type=get_three_state_flag(), options_list=['--include-static-delivery-attribute-secret', '--include-attrib-secret'], help="Indicate whether any static delivery attribute secrets should be returned. True if flag present.", is_preview=True) 350 351 with self.argument_context('eventgrid system-topic event-subscription') as c: 352 c.argument('system_topic_name', arg_type=system_topic_name_type, id_part=None, completer=get_resource_name_completion_list('Microsoft.EventGrid/systemtopics')) 353 c.argument('event_subscription_name', arg_type=name_type, options_list=['--name', '-n'], help='Name of the event subscription.') 354 c.argument('endpoint_type', arg_type=get_enum_type(['webhook', 'eventhub', 'storagequeue', 'hybridconnection', 'servicebusqueue', 'servicebustopic', 'azurefunction'], default='webhook')) 355 c.argument('event_delivery_schema', arg_type=get_enum_type(['eventgridschema', 'custominputschema', 'cloudeventschemav1_0']), help='The schema in which events should be delivered for this event subscription. By default, events will be delivered in the same schema in which they are published (based on the corresponding topic\'s input schema).') 356 c.argument('max_delivery_attempts', type=int, help="Maximum number of delivery attempts. Must be a number between 1 and 30.") 357 c.argument('max_events_per_batch', type=int, help="Maximum number of events in a batch. Must be a number between 1 and 5000.") 358 c.argument('preferred_batch_size_in_kilobytes', type=int, help="Preferred batch size in kilobytes. Must be a number between 1 and 1024.") 359 c.argument('event_ttl', type=int, help="Event time to live (in minutes). Must be a number between 1 and 1440.") 360 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.") 361 c.argument('advanced_filter', arg_group="Filtering", action=EventSubscriptionAddFilter, nargs='+') 362 c.argument('expiration_date', help="Date or datetime (in UTC, e.g. '2018-11-30T11:59:59+00:00' or '2018-11-30') after which the event subscription would expire. By default, there is no expiration for the event subscription.") 363 c.argument('azure_active_directory_tenant_id', help="The Azure Active Directory Tenant Id to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination") 364 c.argument('azure_active_directory_application_id_or_uri', help="The Azure Active Directory Application Id or Uri to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination") 365 c.argument('resource_group_name', arg_type=resource_group_name_type) 366 c.argument('enable_advanced_filtering_on_arrays', is_preview=True, arg_type=get_three_state_flag(), 367 options_list=['--enable-advanced-filtering-on-arrays', '--enable-af-arr'], arg_group="Filtering", 368 help="Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.") 369 c.argument('storage_queue_msg_ttl', 370 help="Storage queue message time to live in seconds.", 371 type=int, 372 options_list=['--storage-queue-msg-ttl', '--qttl'], 373 is_preview=True) 374 c.argument('delivery_attribute_mapping', 375 action=AddDeliveryAttributeMapping, 376 nargs='+', 377 is_preview=True, 378 help='Add delivery attribute mapping to send additional information via HTTP headers when delivering events. This attribute is valid for all destination types except StorageQueue. Multiple attributes can be specified by using more than one `--delivery-attribute-mapping` argument', 379 options_list=['--delivery-attribute-mapping']) 380 381 with self.argument_context('eventgrid system-topic event-subscription list') as c: 382 c.argument('odata_query', arg_type=odata_query_type, id_part=None) 383 384 with self.argument_context('eventgrid system-topic event-subscription show') as c: 385 c.argument('system_topic_name', arg_type=system_topic_name_type, completer=get_resource_name_completion_list('Microsoft.EventGrid/systemtopics')) 386 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.") 387 c.argument('include_static_delivery_attribute_secret', arg_type=get_three_state_flag(), options_list=['--include-static-delivery-attribute-secret', '--include-attrib-secret'], help="Indicate whether any static delivery attribute secrets should be returned. True if flag present.", is_preview=True) 388 389 with self.argument_context('eventgrid partner topic event-subscription') as c: 390 c.argument('partner_topic_name', arg_type=partner_topic_name_type, id_part=None, completer=get_resource_name_completion_list('Microsoft.EventGrid/partnertopics')) 391 c.argument('event_subscription_name', arg_type=name_type, options_list=['--name', '-n'], help='Name of the event subscription.') 392 c.argument('endpoint_type', arg_type=get_enum_type(['webhook', 'eventhub', 'storagequeue', 'hybridconnection', 'servicebusqueue', 'servicebustopic', 'azurefunction'], default='webhook')) 393 c.argument('event_delivery_schema', arg_type=get_enum_type(['eventgridschema', 'custominputschema', 'cloudeventschemav1_0']), help='The schema in which events should be delivered for this event subscription. By default, events will be delivered in the same schema in which they are published (based on the corresponding topic\'s input schema).') 394 c.argument('max_delivery_attempts', type=int, help="Maximum number of delivery attempts. Must be a number between 1 and 30.") 395 c.argument('max_events_per_batch', type=int, help="Maximum number of events in a batch. Must be a number between 1 and 5000.") 396 c.argument('preferred_batch_size_in_kilobytes', type=int, help="Preferred batch size in kilobytes. Must be a number between 1 and 1024.") 397 c.argument('event_ttl', type=int, help="Event time to live (in minutes). Must be a number between 1 and 1440.") 398 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.") 399 c.argument('advanced_filter', arg_group="Filtering", action=EventSubscriptionAddFilter, nargs='+') 400 c.argument('expiration_date', help="Date or datetime (in UTC, e.g. '2018-11-30T11:59:59+00:00' or '2018-11-30') after which the event subscription would expire. By default, there is no expiration for the event subscription.") 401 c.argument('azure_active_directory_tenant_id', help="The Azure Active Directory Tenant Id to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination") 402 c.argument('azure_active_directory_application_id_or_uri', help="The Azure Active Directory Application Id or Uri to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination") 403 c.argument('resource_group_name', arg_type=resource_group_name_type) 404 c.argument('enable_advanced_filtering_on_arrays', is_preview=True, arg_type=get_three_state_flag(), 405 options_list=['--enable-advanced-filtering-on-arrays', '--enable-af-arr'], arg_group="Filtering", 406 help="Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.") 407 c.argument('storage_queue_msg_ttl', 408 help="Storage queue message time to live in seconds.", 409 type=int, 410 options_list=['--storage-queue-msg-ttl', '--qttl'], 411 is_preview=True) 412 c.argument('delivery_attribute_mapping', 413 action=AddDeliveryAttributeMapping, 414 nargs='+', 415 is_preview=True, 416 help='Add delivery attribute mapping to send additional information via HTTP headers when delivering events. This attribute is valid for all destination types except StorageQueue. Multiple attributes can be specified by using more than one `--delivery-attribute-mapping` argument', 417 options_list=['--delivery-attribute-mapping']) 418 419 with self.argument_context('eventgrid partner topic event-subscription list') as c: 420 c.argument('odata_query', arg_type=odata_query_type, id_part=None) 421 422 with self.argument_context('eventgrid partner topic event-subscription show') as c: 423 c.argument('partner_topic_name', arg_type=partner_topic_name_type, completer=get_resource_name_completion_list('Microsoft.EventGrid/partnertopics')) 424 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.") 425 c.argument('include_static_delivery_attribute_secret', arg_type=get_three_state_flag(), options_list=['--include-static-delivery-attribute-secret', '--include-attrib-secret'], help="Indicate whether any static delivery attribute secrets should be returned. True if flag present.", is_preview=True) 426 427 with self.argument_context('eventgrid topic-type') as c: 428 c.argument('topic_type_name', arg_type=name_type, help="Name of the topic type.", completer=get_resource_name_completion_list('Microsoft.EventGrid/topictypes')) 429