-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
EventGrid.json
865 lines (865 loc) · 26.8 KB
/
EventGrid.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
{
"swagger": "2.0",
"info": {
"title": "Azure.Messaging.EventGridClient",
"version": "2024-06-01",
"description": "Azure Messaging EventGrid Client",
"x-typespec-generated": [
{
"emitter": "@azure-tools/typespec-autorest"
}
]
},
"schemes": [
"https"
],
"x-ms-parameterized-host": {
"hostTemplate": "{endpoint}",
"useSchemePrefix": false,
"parameters": [
{
"name": "endpoint",
"in": "path",
"description": "The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net",
"required": true,
"type": "string",
"format": "uri",
"x-ms-skip-url-encoding": true
}
]
},
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"security": [
{
"OAuth2Auth": [
"https://eventgrid.azure.net/.default"
]
}
],
"securityDefinitions": {
"OAuth2Auth": {
"type": "oauth2",
"flow": "implicit",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"scopes": {
"https://eventgrid.azure.net/.default": ""
}
}
},
"tags": [],
"paths": {
"/topics/{topicName}:publish": {
"post": {
"operationId": "PublishCloudEvent",
"description": "Publish a single Cloud Event to a namespace topic.",
"consumes": [
"application/cloudevents+json; charset=utf-8"
],
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "topicName",
"in": "path",
"description": "Topic Name.",
"required": true,
"type": "string"
},
{
"name": "event",
"in": "body",
"description": "Single Cloud Event being published.",
"required": true,
"schema": {
"$ref": "#/definitions/CloudEvent"
}
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/PublishResult"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
}
}
},
"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive": {
"post": {
"operationId": "ReceiveCloudEvents",
"description": "Receive a batch of Cloud Events from a subscription.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "topicName",
"in": "path",
"description": "Topic Name.",
"required": true,
"type": "string"
},
{
"name": "eventSubscriptionName",
"in": "path",
"description": "Event Subscription Name.",
"required": true,
"type": "string"
},
{
"name": "maxEvents",
"in": "query",
"description": "Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1.",
"required": false,
"type": "integer",
"format": "int32",
"default": 1,
"minimum": 1,
"maximum": 100
},
{
"name": "maxWaitTime",
"in": "query",
"description": "Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds.",
"required": false,
"type": "integer",
"format": "int32"
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/ReceiveResult"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
},
"x-ms-examples": {
"Receive Cloud Event": {
"$ref": "./examples/receive.json"
}
}
}
},
"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge": {
"post": {
"operationId": "AcknowledgeCloudEvents",
"description": "Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "topicName",
"in": "path",
"description": "Topic Name.",
"required": true,
"type": "string"
},
{
"name": "eventSubscriptionName",
"in": "path",
"description": "Event Subscription Name.",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"lockTokens": {
"type": "array",
"description": "Array of lock tokens.",
"items": {
"type": "string"
}
}
},
"required": [
"lockTokens"
]
}
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/AcknowledgeResult"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
},
"x-ms-examples": {
"Acknowledge Cloud Event": {
"$ref": "./examples/ack.json"
}
}
}
},
"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release": {
"post": {
"operationId": "ReleaseCloudEvents",
"description": "Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "topicName",
"in": "path",
"description": "Topic Name.",
"required": true,
"type": "string"
},
{
"name": "eventSubscriptionName",
"in": "path",
"description": "Event Subscription Name.",
"required": true,
"type": "string"
},
{
"name": "releaseDelayInSeconds",
"in": "query",
"description": "Release cloud events with the specified delay in seconds.",
"required": false,
"type": "string",
"enum": [
"0",
"10",
"60",
"600",
"3600"
],
"x-ms-enum": {
"name": "ReleaseDelay",
"modelAsString": true,
"values": [
{
"name": "By0Seconds",
"value": "0",
"description": "Release the event after 0 seconds."
},
{
"name": "By10Seconds",
"value": "10",
"description": "Release the event after 10 seconds."
},
{
"name": "By60Seconds",
"value": "60",
"description": "Release the event after 60 seconds."
},
{
"name": "By600Seconds",
"value": "600",
"description": "Release the event after 600 seconds."
},
{
"name": "By3600Seconds",
"value": "3600",
"description": "Release the event after 3600 seconds."
}
]
}
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"lockTokens": {
"type": "array",
"description": "Array of lock tokens.",
"items": {
"type": "string"
}
}
},
"required": [
"lockTokens"
]
}
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/ReleaseResult"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
},
"x-ms-examples": {
"Release Cloud Event with an optional delay.": {
"$ref": "./examples/release.json"
}
}
}
},
"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject": {
"post": {
"operationId": "RejectCloudEvents",
"description": "Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "topicName",
"in": "path",
"description": "Topic Name.",
"required": true,
"type": "string"
},
{
"name": "eventSubscriptionName",
"in": "path",
"description": "Event Subscription Name.",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"lockTokens": {
"type": "array",
"description": "Array of lock tokens.",
"items": {
"type": "string"
}
}
},
"required": [
"lockTokens"
]
}
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/RejectResult"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
},
"x-ms-examples": {
"Reject Cloud Event": {
"$ref": "./examples/reject.json"
}
}
}
},
"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:renewLock": {
"post": {
"operationId": "RenewCloudEventLocks",
"description": "Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "topicName",
"in": "path",
"description": "Topic Name.",
"required": true,
"type": "string"
},
{
"name": "eventSubscriptionName",
"in": "path",
"description": "Event Subscription Name.",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"lockTokens": {
"type": "array",
"description": "Array of lock tokens.",
"items": {
"type": "string"
}
}
},
"required": [
"lockTokens"
]
}
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/RenewCloudEventLocksResult"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
},
"x-ms-examples": {
"Renew lock for batch of Cloud Events": {
"$ref": "./examples/renewlock.json"
}
}
}
}
},
"x-ms-paths": {
"/topics/{topicName}:publish?_overload=publishCloudEvents": {
"post": {
"operationId": "PublishCloudEvents",
"description": "Publish a batch of Cloud Events to a namespace topic.",
"consumes": [
"application/cloudevents-batch+json; charset=utf-8"
],
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "topicName",
"in": "path",
"description": "Topic Name.",
"required": true,
"type": "string"
},
{
"name": "events",
"in": "body",
"description": "Array of Cloud Events being published.",
"required": true,
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/CloudEvent"
}
}
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/PublishResult"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
},
"x-ms-examples": {
"Publish Cloud Event": {
"$ref": "./examples/publish.json"
}
}
}
}
},
"definitions": {
"AcknowledgeResult": {
"type": "object",
"description": "The result of the Acknowledge operation.",
"properties": {
"failedLockTokens": {
"type": "array",
"description": "Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description).",
"items": {
"$ref": "#/definitions/FailedLockToken"
},
"x-ms-identifiers": []
},
"succeededLockTokens": {
"type": "array",
"description": "Array of lock tokens for the successfully acknowledged cloud events.",
"items": {
"type": "string"
}
}
},
"required": [
"failedLockTokens",
"succeededLockTokens"
]
},
"Azure.Core.Foundations.Error": {
"type": "object",
"description": "The error object.",
"properties": {
"code": {
"type": "string",
"description": "One of a server-defined set of error codes."
},
"message": {
"type": "string",
"description": "A human-readable representation of the error."
},
"target": {
"type": "string",
"description": "The target of the error."
},
"details": {
"type": "array",
"description": "An array of details about specific errors that led to this reported error.",
"items": {
"$ref": "#/definitions/Azure.Core.Foundations.Error"
},
"x-ms-identifiers": []
},
"innererror": {
"$ref": "#/definitions/Azure.Core.Foundations.InnerError",
"description": "An object containing more specific information than the current object about the error."
}
},
"required": [
"code",
"message"
]
},
"Azure.Core.Foundations.ErrorResponse": {
"type": "object",
"description": "A response containing error details.",
"properties": {
"error": {
"$ref": "#/definitions/Azure.Core.Foundations.Error",
"description": "The error object."
}
},
"required": [
"error"
]
},
"Azure.Core.Foundations.InnerError": {
"type": "object",
"description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.",
"properties": {
"code": {
"type": "string",
"description": "One of a server-defined set of error codes."
},
"innererror": {
"$ref": "#/definitions/Azure.Core.Foundations.InnerError",
"description": "Inner error."
}
}
},
"BrokerProperties": {
"type": "object",
"description": "Properties of the Event Broker operation.",
"properties": {
"lockToken": {
"type": "string",
"description": "The token of the lock on the event."
},
"deliveryCount": {
"type": "integer",
"format": "int32",
"description": "The attempt count for delivering the event."
}
},
"required": [
"lockToken",
"deliveryCount"
]
},
"CloudEvent": {
"type": "object",
"description": "Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema.",
"properties": {
"id": {
"type": "string",
"description": "An identifier for the event. The combination of id and source must be unique for each distinct event."
},
"source": {
"type": "string",
"description": "Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event."
},
"data": {
"description": "Event data specific to the event type."
},
"data_base64": {
"type": "string",
"format": "byte",
"description": "Event data specific to the event type, encoded as a base64 string."
},
"type": {
"type": "string",
"description": "Type of event related to the originating occurrence."
},
"time": {
"type": "string",
"format": "date-time",
"description": "The time (in UTC) the event was generated, in RFC3339 format."
},
"specversion": {
"type": "string",
"description": "The version of the CloudEvents specification which the event uses."
},
"dataschema": {
"type": "string",
"description": "Identifies the schema that data adheres to."
},
"datacontenttype": {
"type": "string",
"description": "Content type of data value."
},
"subject": {
"type": "string",
"description": "This describes the subject of the event in the context of the event producer (identified by source)."
}
},
"required": [
"id",
"source",
"type",
"specversion"
]
},
"FailedLockToken": {
"type": "object",
"description": "Failed LockToken information.",
"properties": {
"lockToken": {
"type": "string",
"description": "The lock token of an entry in the request."
},
"error": {
"$ref": "#/definitions/Azure.Core.Foundations.Error",
"description": "Error information of the failed operation result for the lock token in the request."
}
},
"required": [
"lockToken",
"error"
]
},
"PublishResult": {
"type": "object",
"description": "The result of the Publish operation."
},
"ReceiveDetails": {
"type": "object",
"description": "Receive operation details per Cloud Event.",
"properties": {
"brokerProperties": {
"$ref": "#/definitions/BrokerProperties",
"description": "The Event Broker details."
},
"event": {
"$ref": "#/definitions/CloudEvent",
"description": "Cloud Event details."
}
},
"required": [
"brokerProperties",
"event"
]
},
"ReceiveResult": {
"type": "object",
"description": "Details of the Receive operation response.",
"properties": {
"value": {
"type": "array",
"description": "Array of receive responses, one per cloud event.",
"items": {
"$ref": "#/definitions/ReceiveDetails"
},
"x-ms-identifiers": []
}
},
"required": [
"value"
]
},
"RejectResult": {
"type": "object",
"description": "The result of the Reject operation.",
"properties": {
"failedLockTokens": {
"type": "array",
"description": "Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description).",
"items": {
"$ref": "#/definitions/FailedLockToken"
},
"x-ms-identifiers": []
},
"succeededLockTokens": {
"type": "array",
"description": "Array of lock tokens for the successfully rejected cloud events.",
"items": {
"type": "string"
}
}
},
"required": [
"failedLockTokens",
"succeededLockTokens"
]
},
"ReleaseResult": {
"type": "object",
"description": "The result of the Release operation.",
"properties": {
"failedLockTokens": {
"type": "array",
"description": "Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description).",
"items": {
"$ref": "#/definitions/FailedLockToken"
},
"x-ms-identifiers": []
},
"succeededLockTokens": {
"type": "array",
"description": "Array of lock tokens for the successfully released cloud events.",
"items": {
"type": "string"
}
}
},
"required": [
"failedLockTokens",
"succeededLockTokens"
]
},
"RenewCloudEventLocksResult": {
"type": "object",
"description": "The result of the RenewLock operation.",
"properties": {
"failedLockTokens": {
"type": "array",
"description": "Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description).",
"items": {
"$ref": "#/definitions/FailedLockToken"
},
"x-ms-identifiers": []
},
"succeededLockTokens": {
"type": "array",
"description": "Array of lock tokens for the successfully renewed locks.",
"items": {
"type": "string"
}
}
},
"required": [
"failedLockTokens",
"succeededLockTokens"
]
}
},
"parameters": {
"Azure.Core.Foundations.ApiVersionParameter": {
"name": "api-version",
"in": "query",
"description": "The API version to use for this operation.",
"required": true,
"type": "string",
"minLength": 1,
"x-ms-parameter-location": "method",
"x-ms-client-name": "apiVersion"
}
}
}