Skip to content

Commit b457d86

Browse files
VidyaKukkekairu-ms
andauthored
{EventGrid} Add support for delivery attribute mapping, topicKind (Azure#17496)
* Add support for delivery attribute mapping, topicKind * Fix linter, test issues * Fix pipeline errors * Fix Linter errors * Linter fix * Update linter_exclusions.yml * Update linter_exclusions.yml * Update linter_exclusions.yml * Address review comments * Fix style error Co-authored-by: kai ru <[email protected]>
1 parent e536c7e commit b457d86

12 files changed

+829
-651
lines changed

linter_exclusions.yml

+18
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,9 @@ eventgrid event-subscription create:
16211621
preferred_batch_size_in_kilobytes:
16221622
rule_exclusions:
16231623
- option_length_too_long
1624+
delivery_attribute_mapping:
1625+
rule_exclusions:
1626+
- option_length_too_long
16241627
eventgrid event-subscription show:
16251628
parameters:
16261629
include_full_endpoint_url:
@@ -1640,6 +1643,9 @@ eventgrid event-subscription update:
16401643
endpoint_type:
16411644
rule_exclusions:
16421645
- no_parameter_defaults_for_update_commands
1646+
delivery_attribute_mapping:
1647+
rule_exclusions:
1648+
- option_length_too_long
16431649
eventgrid partner namespace create:
16441650
parameters:
16451651
partner_registration_id:
@@ -1722,6 +1728,9 @@ eventgrid partner topic event-subscription create:
17221728
preferred_batch_size_in_kilobytes:
17231729
rule_exclusions:
17241730
- option_length_too_long
1731+
delivery_attribute_mapping:
1732+
rule_exclusions:
1733+
- option_length_too_long
17251734
eventgrid partner topic event-subscription show:
17261735
parameters:
17271736
include_full_endpoint_url:
@@ -1732,6 +1741,9 @@ eventgrid partner topic event-subscription update:
17321741
endpoint_type:
17331742
rule_exclusions:
17341743
- no_parameter_defaults_for_update_commands
1744+
delivery_attribute_mapping:
1745+
rule_exclusions:
1746+
- option_length_too_long
17351747
eventgrid system-topic event-subscription create:
17361748
parameters:
17371749
azure_active_directory_application_id_or_uri:
@@ -1752,6 +1764,9 @@ eventgrid system-topic event-subscription create:
17521764
preferred_batch_size_in_kilobytes:
17531765
rule_exclusions:
17541766
- option_length_too_long
1767+
delivery_attribute_mapping:
1768+
rule_exclusions:
1769+
- option_length_too_long
17551770
eventgrid system-topic event-subscription show:
17561771
parameters:
17571772
include_full_endpoint_url:
@@ -1762,6 +1777,9 @@ eventgrid system-topic event-subscription update:
17621777
endpoint_type:
17631778
rule_exclusions:
17641779
- no_parameter_defaults_for_update_commands
1780+
delivery_attribute_mapping:
1781+
rule_exclusions:
1782+
- option_length_too_long
17651783
eventgrid topic create:
17661784
parameters:
17671785
input_mapping_default_values:

src/azure-cli/azure/cli/command_modules/eventgrid/_help.py

+73
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,15 @@
457457
Example: --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/containerName
458458
- name: --endpoint-type
459459
short-summary: The type of the destination endpoint.
460+
- name: --delivery-attribute-mapping
461+
short-summary: 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.
462+
long-summary: |
463+
Usage: --delivery-attribute-mapping attribute-name attribute-type attribute-value [attribute-is-secret]
464+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue
465+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue false
466+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue true
467+
Dynamic Attribute Mapping: --delivery-attribute-mapping somename dynamic somevalue
468+
Both Static and Dynamic: --delivery-attribute-mapping somename dynamic somevalue --delivery-attribute-mapping somename2 static somevalue
460469
examples:
461470
- name: Create a new event subscription for an Event Grid system topic, using default filters.
462471
text: |
@@ -537,6 +546,10 @@
537546
text: |
538547
az eventgrid system-topic event-subscription show --name es1 \\
539548
-g rg1 --system-topic-name systemtopic1
549+
- name: Show the details of an event subscription for an Event Grid system topic include any static delivery attribute secrets.
550+
text: |
551+
az eventgrid system-topic event-subscription show --name es1 \\
552+
-g rg1 --system-topic-name systemtopic1 --include-attrib-secret
540553
"""
541554

542555
helps['eventgrid system-topic event-subscription update'] = """
@@ -569,6 +582,15 @@
569582
IsNullOrUndefined: --advanced-filter data.property3 IsNullOrUndefined
570583
IsNotNull: --advanced-filter data.property3 IsNotNull
571584
Multiple advanced filters can be specified by using more than one `--advanced-filter` argument.
585+
- name: --delivery-attribute-mapping
586+
short-summary: 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.
587+
long-summary: |
588+
Usage: --delivery-attribute-mapping attribute-name attribute-type attribute-value [attribute-is-secret]
589+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue
590+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue false
591+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue true
592+
Dynamic Attribute Mapping: --delivery-attribute-mapping somename dynamic somevalue
593+
Both Static and Dynamic: --delivery-attribute-mapping somename dynamic somevalue --delivery-attribute-mapping somename2 static somevalue
572594
examples:
573595
- name: Update an event subscription for an Event Grid system topic to specify a new endpoint.
574596
text: |
@@ -649,6 +671,15 @@
649671
Example: --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/containerName
650672
- name: --endpoint-type
651673
short-summary: The type of the destination endpoint.
674+
- name: --delivery-attribute-mapping
675+
short-summary: 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.
676+
long-summary: |
677+
Usage: --delivery-attribute-mapping attribute-name attribute-type attribute-value [attribute-is-secret]
678+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue
679+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue false
680+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue true
681+
Dynamic Attribute Mapping: --delivery-attribute-mapping somename dynamic somevalue
682+
Both Static and Dynamic: --delivery-attribute-mapping somename dynamic somevalue --delivery-attribute-mapping somename2 static somevalue
652683
examples:
653684
- name: Create a new event subscription for an Event Grid partner topic, using default filters.
654685
text: |
@@ -729,6 +760,10 @@
729760
text: |
730761
az eventgrid partner topic event-subscription show --name es1 \\
731762
-g rg1 --partner-topic-name partnertopic1
763+
- name: Show the details of an event subscription for an Event Grid partner topic and include static delivery attribute secrets
764+
text: |
765+
az eventgrid partner topic event-subscription show --name es1 \\
766+
-g rg1 --partner-topic-name partnertopic1 --include-static-delivery-attribute-secret
732767
"""
733768

734769
helps['eventgrid partner topic event-subscription update'] = """
@@ -761,6 +796,15 @@
761796
IsNullOrUndefined: --advanced-filter data.property3 IsNullOrUndefined
762797
IsNotNull: --advanced-filter data.property3 IsNotNull
763798
Multiple advanced filters can be specified by using more than one `--advanced-filter` argument.
799+
- name: --delivery-attribute-mapping
800+
short-summary: 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.
801+
long-summary: |
802+
Usage: --delivery-attribute-mapping attribute-name attribute-type attribute-value [attribute-is-secret]
803+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue
804+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue false
805+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue true
806+
Dynamic Attribute Mapping: --delivery-attribute-mapping somename dynamic somevalue
807+
Both Static and Dynamic: --delivery-attribute-mapping somename dynamic somevalue --delivery-attribute-mapping somename2 static somevalue
764808
examples:
765809
- name: Update an event subscription for an Event Grid partner topic to specify a new endpoint.
766810
text: |
@@ -859,6 +903,15 @@
859903
short-summary: The type of the destination endpoint.
860904
- name: --delivery-identity-endpoint-type
861905
short-summary: The type of the destination endpoint with resource identity.
906+
- name: --delivery-attribute-mapping
907+
short-summary: 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.
908+
long-summary: |
909+
Usage: --delivery-attribute-mapping attribute-name attribute-type attribute-value [attribute-is-secret]
910+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue
911+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue false
912+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue true
913+
Dynamic Attribute Mapping: --delivery-attribute-mapping somename dynamic somevalue
914+
Both Static and Dynamic: --delivery-attribute-mapping somename dynamic somevalue --delivery-attribute-mapping somename2 static somevalue
862915
examples:
863916
- name: Create a new event subscription for an Event Grid topic, using default filters.
864917
text: |
@@ -1118,6 +1171,11 @@
11181171
text: |
11191172
az eventgrid event-subscription show --name es3 \\
11201173
--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/microsoft.storage/storageaccounts/kalsegblob
1174+
- name: Show the details of an event subscription for a resource group including any static delivery attribute secrets.
1175+
text: |
1176+
az eventgrid event-subscription show --name es3 \\
1177+
--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 \\
1178+
--include-static-delivery-attribute-secret
11211179
"""
11221180

11231181
helps['eventgrid event-subscription update'] = """
@@ -1162,6 +1220,15 @@
11621220
IsNullOrUndefined: --advanced-filter data.property3 IsNullOrUndefined
11631221
IsNotNull: --advanced-filter data.property3 IsNotNull
11641222
Multiple advanced filters can be specified by using more than one `--advanced-filter` argument.
1223+
- name: --delivery-attribute-mapping
1224+
short-summary: 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.
1225+
long-summary: |
1226+
Usage: --delivery-attribute-mapping attribute-name attribute-type attribute-value [attribute-is-secret]
1227+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue
1228+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue false
1229+
Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue true
1230+
Dynamic Attribute Mapping: --delivery-attribute-mapping somename dynamic somevalue
1231+
Both Static and Dynamic: --delivery-attribute-mapping somename dynamic somevalue --delivery-attribute-mapping somename2 static somevalue
11651232
examples:
11661233
- name: Update an event subscription for an Event Grid topic to specify a new endpoint.
11671234
text: |
@@ -1243,6 +1310,12 @@
12431310
text: az eventgrid topic create -g rg1 --name topic1 -l westus2 --input-schema cloudeventschemav1_0
12441311
- name: Create a new topic which allows specific inbound ip rules with Basic Sku and system assigned identity
12451312
text: az eventgrid topic create -g rg1 --name topic1 -l westus2 --public-network-access enabled --inbound-ip-rules 10.0.0.0/8 Allow --inbound-ip-rules 10.2.0.0/8 Allow --sku Basic --identity systemassigned
1313+
- name: Create a new topic in Azure.
1314+
text: az eventgrid topic create -g rg1 --name topic1 -l westus2
1315+
- name: Create a new topic in Azure.
1316+
text: az eventgrid topic create -g rg1 --name topic1 -l westus2 --kind azure
1317+
- name: Create a new topic in AzureArc targeting a custom location.
1318+
text: az eventgrid topic create -g rg1 --name topic1 -l eastus2euap --kind azurearc --extended-location-name /subscriptions/<subid>/resourcegroups/<rgname>/providers/microsoft.extendedlocation/customlocations/<cust-loc-name> --extended-location-type customlocation
12461319
"""
12471320

12481321
helps['eventgrid topic delete'] = """

0 commit comments

Comments
 (0)