Skip to content

Commit e81c2f0

Browse files
authored
Merge pull request #267470 from spelluru/egridschema0227
Making "Cloud event schema" as the first tab
2 parents babf83f + 37d8e8a commit e81c2f0

25 files changed

+1471
-1397
lines changed

articles/event-grid/event-domains.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,65 +48,66 @@ Event domains also allow for domain-scope subscriptions. An event subscription o
4848

4949
When you create an event domain, you're given a publishing endpoint similar to if you had created a topic in Event Grid. To publish events to any topic in an event domain, push the events to the domain's endpoint the [same way you would for a custom topic](./post-to-custom-topic.md). The only difference is that you must specify the topic you'd like the event to be delivered to. For example, publishing the following array of events would send event with `"id": "1111"` to topic `foo` while the event with `"id": "2222"` would be sent to topic `bar`.
5050

51-
# [Event Grid event schema](#tab/event-grid-event-schema)
52-
When using the **Event Grid event schema**, specify the name of the Event Grid topic in the domain as a value for the `topic` property. In the following example, `topic` property is set to `foo` for the first event and to `bar` for the second event.
51+
# [Cloud event schema](#tab/cloud-event-schema)
52+
53+
When using the **cloud event schema**, specify the name of the Event Grid topic in the domain as a value for the `source` property. In the following example, `source` property is set to `foo` for the first event and to `bar` for the second event.
54+
55+
If you want to use a different field to specify the intended topic in the domain, specify input schema mapping when creating the domain. For example, if you're using the REST API, use the [properties.inputSchemaMapping](/rest/api/eventgrid/controlplane-preview/domains/create-or-update#jsoninputschemamapping) property when to map that field to `properties.topic`. If you're using the .NET SDK, use [`EventGridJsonInputSchemaMapping`](/dotnet/api/azure.resourcemanager.eventgrid.models.eventgridjsoninputschemamapping). Other SDKs also support the schema mapping.
5356

5457
```json
5558
[{
56-
"topic": "foo",
59+
"source": "foo",
5760
"id": "1111",
58-
"eventType": "maintenanceRequested",
61+
"type": "maintenanceRequested",
5962
"subject": "myapp/vehicles/diggers",
60-
"eventTime": "2018-10-30T21:03:07+00:00",
63+
"time": "2018-10-30T21:03:07+00:00",
6164
"data": {
6265
"make": "Contoso",
6366
"model": "Small Digger"
6467
},
65-
"dataVersion": "1.0"
68+
"specversion": "1.0"
6669
},
6770
{
68-
"topic": "bar",
71+
"source": "bar",
6972
"id": "2222",
70-
"eventType": "maintenanceCompleted",
73+
"type": "maintenanceCompleted",
7174
"subject": "myapp/vehicles/tractors",
72-
"eventTime": "2018-10-30T21:04:12+00:00",
75+
"time": "2018-10-30T21:04:12+00:00",
7376
"data": {
7477
"make": "Contoso",
7578
"model": "Big Tractor"
7679
},
77-
"dataVersion": "1.0"
80+
"specversion": "1.0"
7881
}]
7982
```
80-
# [Cloud event schema](#tab/cloud-event-schema)
81-
82-
When using the **cloud event schema**, specify the name of the Event Grid topic in the domain as a value for the `source` property. In the following example, `source` property is set to `foo` for the first event and to `bar` for the second event.
8383

84-
If you want to use a different field to specify the intended topic in the domain, specify input schema mapping when creating the domain. For example, if you're using the REST API, use the [properties.inputSchemaMapping](/rest/api/eventgrid/controlplane-preview/domains/create-or-update#jsoninputschemamapping) property when to map that field to `properties.topic`. If you're using the .NET SDK, use [`EventGridJsonInputSchemaMapping`](/dotnet/api/azure.resourcemanager.eventgrid.models.eventgridjsoninputschemamapping). Other SDKs also support the schema mapping.
84+
# [Event Grid event schema](#tab/event-grid-event-schema)
85+
When using the **Event Grid event schema**, specify the name of the Event Grid topic in the domain as a value for the `topic` property. In the following example, `topic` property is set to `foo` for the first event and to `bar` for the second event.
8586

8687
```json
8788
[{
88-
"source": "foo",
89+
"topic": "foo",
8990
"id": "1111",
90-
"type": "maintenanceRequested",
91+
"eventType": "maintenanceRequested",
9192
"subject": "myapp/vehicles/diggers",
92-
"time": "2018-10-30T21:03:07+00:00",
93+
"eventTime": "2018-10-30T21:03:07+00:00",
9394
"data": {
9495
"make": "Contoso",
9596
"model": "Small Digger"
9697
},
97-
"specversion": "1.0"
98+
"dataVersion": "1.0"
9899
},
99100
{
100-
"source": "bar",
101+
"topic": "bar",
101102
"id": "2222",
102-
"type": "maintenanceCompleted",
103+
"eventType": "maintenanceCompleted",
103104
"subject": "myapp/vehicles/tractors",
104-
"time": "2018-10-30T21:04:12+00:00",
105+
"eventTime": "2018-10-30T21:04:12+00:00",
105106
"data": {
106107
"make": "Contoso",
107108
"model": "Big Tractor"
108109
},
109-
"specversion": "1.0"
110+
"dataVersion": "1.0"
110111
}]
111112
```
112113

articles/event-grid/event-schema-aks.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,78 +25,80 @@ AKS emits the following event types
2525
| Microsoft.ContainerService.NodePoolRollingSucceeded| Triggered when NodepoolRolling succeeded as a result of upgrade or an update |
2626
## Properties common to all events
2727

28-
# [Event Grid event schema](#tab/event-grid-event-schema)
28+
# [Cloud event schema](#tab/cloud-event-schema)
29+
2930
When an event is triggered, the Event Grid service sends data about that event to subscribing endpoint.
3031
This section contains an example of what that data would look like for each event. Each event has the following top-level data:
3132

3233
| Property | Type | Description |
3334
|-----------------------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------|
34-
| `topic` | string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
35+
| `source` | string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
3536
| `subject` | string | Publisher-defined path to the event subject. |
36-
| `eventType` | string | One of the registered event types for this event source. |
37-
| `eventTime` | string | The time the event is generated based on the provider's UTC time. |
37+
| `type` | string | One of the registered event types for this event source. |
38+
| `time` | string | The time the event is generated based on the provider's UTC time. |
3839
| `id` | string | Unique identifier for the event. |
3940
| `data` | object | Blob storage event data. |
40-
| `dataVersion` | string | The schema version of the data object. The publisher defines the schema version. |
41-
| `metadataVersion` | string | The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. |
42-
43-
# [Cloud event schema](#tab/cloud-event-schema)
41+
| `specversion` | string | CloudEvents schema specification version. |
4442

43+
# [Event Grid event schema](#tab/event-grid-event-schema)
4544
When an event is triggered, the Event Grid service sends data about that event to subscribing endpoint.
4645
This section contains an example of what that data would look like for each event. Each event has the following top-level data:
4746

4847
| Property | Type | Description |
4948
|-----------------------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------|
50-
| `source` | string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
49+
| `topic` | string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
5150
| `subject` | string | Publisher-defined path to the event subject. |
52-
| `type` | string | One of the registered event types for this event source. |
53-
| `time` | string | The time the event is generated based on the provider's UTC time. |
51+
| `eventType` | string | One of the registered event types for this event source. |
52+
| `eventTime` | string | The time the event is generated based on the provider's UTC time. |
5453
| `id` | string | Unique identifier for the event. |
5554
| `data` | object | Blob storage event data. |
56-
| `specversion` | string | CloudEvents schema specification version. |
55+
| `dataVersion` | string | The schema version of the data object. The publisher defines the schema version. |
56+
| `metadataVersion` | string | The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. |
57+
58+
5759

5860
---
5961

6062
## Example events
6163

6264
### NewKubernetesVersionAvailable
6365

64-
# [Event Grid event schema](#tab/event-grid-event-schema)
66+
# [Cloud event schema](#tab/cloud-event-schema)
6567

6668
```json
69+
6770
{
68-
"topic": "/subscriptions/<id>/resourceGroups<rg>/providers/Microsoft.ContainerService/managedClusters/<cluster>",
71+
"source": "/subscriptions/<id>/resourceGroups<rg>/providers/Microsoft.ContainerService/managedClusters/<cluster>",
6972
"subject": "<cluster>",
70-
"eventType": "Microsoft.ContainerService.NewKubernetesVersionAvailable",
73+
"type": "Microsoft.ContainerService.NewKubernetesVersionAvailable",
7174
"id": "1234567890abcdef1234567890abcdef12345678",
7275
"data": {
7376
"latestSupportedKubernetesVersion": "1.20.7",
7477
"latestStableKubernetesVersion": "1.19.11",
7578
"lowestMinorKubernetesVersion": "1.18.19",
7679
"latestPreviewKubernetesVersion": "1.21.1"
7780
},
78-
"dataVersion": "1",
79-
"metadataVersion": "1",
80-
"eventTime": "2021-07-01T04:52:57.0000000Z"
81+
"specversion": "1.0",
82+
"time": "2021-07-01T04:52:57.0000000Z"
8183
}
8284
```
83-
# [Cloud event schema](#tab/cloud-event-schema)
85+
# [Event Grid event schema](#tab/event-grid-event-schema)
8486

8587
```json
86-
8788
{
88-
"source": "/subscriptions/<id>/resourceGroups<rg>/providers/Microsoft.ContainerService/managedClusters/<cluster>",
89+
"topic": "/subscriptions/<id>/resourceGroups<rg>/providers/Microsoft.ContainerService/managedClusters/<cluster>",
8990
"subject": "<cluster>",
90-
"type": "Microsoft.ContainerService.NewKubernetesVersionAvailable",
91+
"eventType": "Microsoft.ContainerService.NewKubernetesVersionAvailable",
9192
"id": "1234567890abcdef1234567890abcdef12345678",
9293
"data": {
9394
"latestSupportedKubernetesVersion": "1.20.7",
9495
"latestStableKubernetesVersion": "1.19.11",
9596
"lowestMinorKubernetesVersion": "1.18.19",
9697
"latestPreviewKubernetesVersion": "1.21.1"
9798
},
98-
"specversion": "1.0",
99-
"time": "2021-07-01T04:52:57.0000000Z"
99+
"dataVersion": "1",
100+
"metadataVersion": "1",
101+
"eventTime": "2021-07-01T04:52:57.0000000Z"
100102
}
101103
```
102104

articles/event-grid/event-schema-api-management.md

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,6 @@ API Management emits the following event types:
4646

4747
## Example event
4848

49-
# [Event Grid event schema](#tab/event-grid-event-schema)
50-
The following example shows the schema of a product created event. The schema of other API Management resource created events is similar.
51-
52-
```json
53-
[{
54-
"id": "92c502f2-a966-42a7-a428-d3b319844544",
55-
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
56-
"subject": "/products/myproduct",
57-
"data": {
58-
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/products/myproduct"
59-
},
60-
"eventType": "Microsoft.ApiManagement.ProductCreated",
61-
"dataVersion": "1",
62-
"metadataVersion": "1",
63-
"eventTime": "2021-07-02T00:47:47.8536532Z"
64-
}]
65-
```
6649

6750
# [Cloud event schema](#tab/cloud-event-schema)
6851

@@ -81,26 +64,28 @@ The following example shows the schema of a product created event. The schema of
8164
"specversion":"1.0"
8265
}]
8366
```
84-
---
8567

8668
# [Event Grid event schema](#tab/event-grid-event-schema)
87-
The following example shows the schema of a user deleted event. The schema of other API Management resource deleted events is similar.
69+
The following example shows the schema of a product created event. The schema of other API Management resource created events is similar.
8870

8971
```json
9072
[{
9173
"id": "92c502f2-a966-42a7-a428-d3b319844544",
9274
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
93-
"subject": "/users/apimuser-contoso-com",
75+
"subject": "/products/myproduct",
9476
"data": {
95-
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/users/apimuser-contoso-com"
77+
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/products/myproduct"
9678
},
97-
"eventType": "Microsoft.ApiManagement.UserDeleted",
79+
"eventType": "Microsoft.ApiManagement.ProductCreated",
9880
"dataVersion": "1",
9981
"metadataVersion": "1",
10082
"eventTime": "2021-07-02T00:47:47.8536532Z"
10183
}]
10284
```
10385

86+
---
87+
88+
10489
# [Cloud event schema](#tab/cloud-event-schema)
10590

10691
The following example shows the schema of a user deleted event. The schema of other API Management resource deleted events is similar.
@@ -118,26 +103,27 @@ The following example shows the schema of a user deleted event. The schema of ot
118103
"specversion":"1.0"
119104
}]
120105
```
121-
---
122106

123107
# [Event Grid event schema](#tab/event-grid-event-schema)
108+
The following example shows the schema of a user deleted event. The schema of other API Management resource deleted events is similar.
124109

125-
The following example shows the schema of an API updated event. The schema of other API Management resource updated events is similar.
126110
```json
127111
[{
128-
"id": "95015754-aa51-4eb6-98d9-9ee322b82ad7",
112+
"id": "92c502f2-a966-42a7-a428-d3b319844544",
129113
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
130-
"subject": "/apis/myapi;Rev=1",
114+
"subject": "/users/apimuser-contoso-com",
131115
"data": {
132-
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/apis/myapi;Rev=1"
116+
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/users/apimuser-contoso-com"
133117
},
134-
"eventType": "Microsoft.ApiManagement.APIUpdated",
118+
"eventType": "Microsoft.ApiManagement.UserDeleted",
135119
"dataVersion": "1",
136120
"metadataVersion": "1",
137-
"eventTime": "2021-07-12T23:13:44.9048323Z"
121+
"eventTime": "2021-07-02T00:47:47.8536532Z"
138122
}]
139123
```
140124

125+
---
126+
141127
# [Cloud event schema](#tab/cloud-event-schema)
142128

143129
The following example shows the schema of an API updated event. The schema of other API Management resource updated events is similar.
@@ -155,38 +141,58 @@ The following example shows the schema of an API updated event. The schema of ot
155141
"specversion":1.0
156142
}]
157143
```
144+
145+
# [Event Grid event schema](#tab/event-grid-event-schema)
146+
147+
The following example shows the schema of an API updated event. The schema of other API Management resource updated events is similar.
148+
```json
149+
[{
150+
"id": "95015754-aa51-4eb6-98d9-9ee322b82ad7",
151+
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
152+
"subject": "/apis/myapi;Rev=1",
153+
"data": {
154+
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/apis/myapi;Rev=1"
155+
},
156+
"eventType": "Microsoft.ApiManagement.APIUpdated",
157+
"dataVersion": "1",
158+
"metadataVersion": "1",
159+
"eventTime": "2021-07-12T23:13:44.9048323Z"
160+
}]
161+
```
162+
158163
---
159164

160165
## Event properties
161166

162-
# [Event Grid event schema](#tab/event-grid-event-schema)
167+
168+
# [Cloud event schema](#tab/cloud-event-schema)
163169

164170
An event has the following top-level data:
165171

166172
| Property | Type | Description |
167173
| -------- | ---- | ----------- |
168-
| `topic` | string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
174+
| `source` | string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
169175
| `subject` | string | Publisher-defined path to the event subject. |
170-
| `eventType` | string | One of the registered event types for this event source. |
171-
| `eventTime` | string | The time the event is generated based on the provider's UTC time. |
176+
| `type` | string | One of the registered event types for this event source. |
177+
| `time` | string | The time the event is generated based on the provider's UTC time. |
172178
| `id` | string | Unique identifier for the event. |
173179
| `data` | object | API Management event data. |
174-
| `dataVersion` | string | The schema version of the data object. The publisher defines the schema version. |
175-
| `metadataVersion` | string | The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. |
180+
| `specversion` | string | CloudEvents schema specification version. |
176181

177-
# [Cloud event schema](#tab/cloud-event-schema)
182+
# [Event Grid event schema](#tab/event-grid-event-schema)
178183

179184
An event has the following top-level data:
180185

181186
| Property | Type | Description |
182187
| -------- | ---- | ----------- |
183-
| `source` | string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
188+
| `topic` | string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
184189
| `subject` | string | Publisher-defined path to the event subject. |
185-
| `type` | string | One of the registered event types for this event source. |
186-
| `time` | string | The time the event is generated based on the provider's UTC time. |
190+
| `eventType` | string | One of the registered event types for this event source. |
191+
| `eventTime` | string | The time the event is generated based on the provider's UTC time. |
187192
| `id` | string | Unique identifier for the event. |
188193
| `data` | object | API Management event data. |
189-
| `specversion` | string | CloudEvents schema specification version. |
194+
| `dataVersion` | string | The schema version of the data object. The publisher defines the schema version. |
195+
| `metadataVersion` | string | The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. |
190196

191197
---
192198

0 commit comments

Comments
 (0)