Skip to content

Commit

Permalink
[Azure Event Grid] Add new data plane GA api-version 2024-06-01 (#29060)
Browse files Browse the repository at this point in the history
* Add new GA api-version=2024-06-01

* Change ReleaseDelay enum values to string from number

* regenerate with newest doc changes

---------

Co-authored-by: Laurent Mazuel <laurent.mazuel@gmail.com>
Co-authored-by: l0lawrence <llawrence@microsoft.com>
  • Loading branch information
3 people committed May 22, 2024
1 parent 592bb66 commit 9f08437
Show file tree
Hide file tree
Showing 15 changed files with 1,275 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"operationId": "AcknowledgeCloudEvents",
"title": "Acknowledge Cloud Event",
"parameters": {
"endpoint": "myNamespaceName.westus-1.eventgrid.azure.net",
"topicName": "myTopic",
"eventSubscriptionName": "myEventSubscription",
"content-type": "application/json",
"authorization": "SharedAccessKey 123",
"api-version": "2024-06-01",
"acknowledgeOptions": {
"lockTokens": [
"CgMKATESCQoHdG9rZW4tMQ=="
]
}
},
"responses": {
"200": {
"body": {
"failedLockTokens": [
{
"lockToken": "CgMKATESCQoHdG9rZW4tMQ==",
"error": {
"code": "BadToken",
"message": ""
}
}
],
"succeededLockTokens": [
"CgMKATESCQoHdG9rZW4tMQ=="
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"operationId": "PublishCloudEvents",
"title": "Publish Cloud Event",
"parameters": {
"endpoint": "myNamespaceName.westus-1.eventgrid.azure.net",
"topicName": "myTopic",
"content-type": "application/cloudevents-batch+json",
"authorization": "SharedAccessKey 123",
"api-version": "2024-06-01",
"events": [
{
"id": "b3ccc7e3-c1cb-49bf-b7c8-0d4e60980616",
"source": "/microsoft/autorest/examples/eventgrid/cloud-events/publish",
"specversion": "1.0",
"data": {
"Property1": "Value1",
"Property2": "Value2"
},
"type": "Microsoft.Contoso.TestEvent",
"time": "2023-05-04T23:06:09.147165Z"
}
]
},
"responses": {
"200": {
"body": {}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"operationId": "ReceiveCloudEvents",
"title": "Receive Cloud Event",
"parameters": {
"endpoint": "myNamespaceName.westus-1.eventgrid.azure.net",
"topicName": "myTopic",
"eventSubscriptionName": "myEventSubscription",
"content-type": "application/json",
"authorization": "SharedAccessKey 123",
"api-version": "2024-06-01",
"maxEvents": 1,
"maxWaitTime": 60
},
"responses": {
"200": {
"body": {
"value": [
{
"brokerProperties": {
"lockToken": "CgMKATESCQoHdG9rZW4tMQ==",
"deliveryCount": 1
},
"event": {
"specversion": "1.0",
"type": "demo-started",
"source": "/test",
"subject": "all-hands-0405",
"id": "e770f36b-381a-41db-8b2b-b7199daeb202",
"time": "2023-05-05T17:31:00Z",
"datacontenttype": "application/json",
"data": "test"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"operationId": "RejectCloudEvents",
"title": "Reject Cloud Event",
"parameters": {
"endpoint": "myNamespaceName.westus-1.eventgrid.azure.net",
"topicName": "myTopic",
"eventSubscriptionName": "myEventSubscription",
"content-type": "application/json",
"authorization": "SharedAccessKey 123",
"api-version": "2024-06-01",
"rejectOptions": {
"lockTokens": [
"CgMKATESCQoHdG9rZW4tMQ=="
]
}
},
"responses": {
"200": {
"body": {
"failedLockTokens": [],
"succeededLockTokens": [
"CgMKATESCQoHdG9rZW4tMQ=="
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"operationId": "ReleaseCloudEvents",
"title": "Release Cloud Event with an optional delay.",
"parameters": {
"endpoint": "myNamespaceName.westus-1.eventgrid.azure.net",
"topicName": "myTopic",
"eventSubscriptionName": "myEventSubscription",
"content-type": "application/json",
"authorization": "SharedAccessKey 123",
"api-version": "2024-06-01",
"releaseDelayInSeconds": 10,
"releaseOptions": {
"lockTokens": [
"CgMKATESCQoHdG9rZW4tMQ=="
]
}
},
"responses": {
"200": {
"body": {
"failedLockTokens": [],
"succeededLockTokens": [
"CgMKATESCQoHdG9rZW4tMQ=="
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"operationId": "RenewCloudEventLocks",
"title": "Renew lock for batch of Cloud Events",
"parameters": {
"endpoint": "myNamespaceName.westus-1.eventgrid.azure.net",
"topicName": "myTopic",
"eventSubscriptionName": "myEventSubscription",
"content-type": "application/json",
"authorization": "SharedAccessKey 123",
"api-version": "2024-06-01",
"renewLockOptions": {
"lockTokens": [
"CgMKATESCQoHdG9rZW4tMQ=="
]
}
},
"responses": {
"200": {
"body": {
"failedLockTokens": [],
"succeededLockTokens": [
"CgMKATESCQoHdG9rZW4tMQ=="
]
}
}
}
}
17 changes: 11 additions & 6 deletions specification/eventgrid/Azure.Messaging.EventGrid/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ namespace Microsoft.EventGrid {

@useDependency(Azure.Core.Versions.v1_0_Preview_2)
v2023_11_01: "2023-11-01",

@useDependency(Azure.Core.Versions.v1_0_Preview_2)
v2024_06_01: "2024-06-01",
}

alias StandardOperations = Azure.Core.StandardResourceOperations;
Expand Down Expand Up @@ -129,22 +132,22 @@ namespace Microsoft.EventGrid {

@doc("Supported delays for release operation.")
union ReleaseDelay {
int32,
string,

@doc("Release the event after 0 seconds.")
By0Seconds: 0,
By0Seconds: "0",

@doc("Release the event after 10 seconds.")
By10Seconds: 10,
By10Seconds: "10",

@doc("Release the event after 60 seconds.")
By60Seconds: 60,
By60Seconds: "60",

@doc("Release the event after 600 seconds.")
By600Seconds: 600,
By600Seconds: "600",

@doc("Release the event after 3600 seconds.")
By3600Seconds: 3600,
By3600Seconds: "3600",
}

@doc("The result of the Publish operation.")
Expand Down Expand Up @@ -322,6 +325,7 @@ namespace Microsoft.EventGrid {

@added(ServiceApiVersions.v2023_10_01_preview)
@removed(ServiceApiVersions.v2023_11_01)
@added(ServiceApiVersions.v2024_06_01)
@doc("Release cloud events with the specified delay in seconds.")
@query
releaseDelayInSeconds?: ReleaseDelay;
Expand All @@ -348,6 +352,7 @@ namespace Microsoft.EventGrid {
// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:renewLock?api-version={apiVersion}
@added(ServiceApiVersions.v2023_10_01_preview)
@removed(ServiceApiVersions.v2023_11_01)
@added(ServiceApiVersions.v2024_06_01)
@doc("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.")
@action("renewLock")
op renewCloudEventLocks is StandardOperations.ResourceAction<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,41 +258,41 @@
"in": "query",
"description": "Release cloud events with the specified delay in seconds.",
"required": false,
"type": "number",
"type": "string",
"enum": [
0,
10,
60,
600,
3600
"0",
"10",
"60",
"600",
"3600"
],
"x-ms-enum": {
"name": "ReleaseDelay",
"modelAsString": true,
"values": [
{
"name": "By0Seconds",
"value": 0,
"value": "0",
"description": "Release the event after 0 seconds."
},
{
"name": "By10Seconds",
"value": 10,
"value": "10",
"description": "Release the event after 10 seconds."
},
{
"name": "By60Seconds",
"value": 60,
"value": "60",
"description": "Release the event after 60 seconds."
},
{
"name": "By600Seconds",
"value": 600,
"value": "600",
"description": "Release the event after 600 seconds."
},
{
"name": "By3600Seconds",
"value": 3600,
"value": "3600",
"description": "Release the event after 3600 seconds."
}
]
Expand Down
Loading

0 comments on commit 9f08437

Please sign in to comment.