-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Azure Event Grid] Adding new public preview api version for new data-plane operations, release with delay and renew lock operations #25421
Merged
lmazuel
merged 20 commits into
Azure:main
from
batrived:users/batrived/releaseWithDelay
Oct 20, 2023
Merged
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
e66c1f7
Adding new api version, release with delay and renew lock operations
batrived 7e65da5
Removing unnecessary changes
batrived cecbcc1
ran prettier
batrived 0145080
Changing delay values
batrived a1c20e4
Adding the new api version in data-plane
batrived c9dafee
Adding the generated folder
batrived ced24ac
Fixing pr comment
batrived 6813c1d
Updating api version and suggestions from api review board
batrived 2d55d3e
Fixing PR comment
batrived dcdd4f1
Merge branch 'main' of https://github.com/batrived/azure-rest-api-spe…
batrived 641d9dc
Fixing build errors
batrived 4429357
Fixing build issue
batrived a9251da
Incorporating feedbacks
batrived 8dcd31c
Fixing a comment
batrived fe675da
Updating examples
batrived a571086
Reverting to FailedLockToken model
batrived 9e456be
Using Azure.Core.Foundations.Error to represent error
batrived 1579f9c
Merge branch 'main' of https://github.com/batrived/azure-rest-api-spe…
batrived 6785060
Fixing build issue
batrived b0d62af
Renaming Delay to ReleaseDelay
batrived File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ import "@azure-tools/typespec-azure-core"; | |
// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}:publish?api-version={apiVersion} | ||
// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive?api-Version={apiVersion}&maxWaitTime=60&maxEvents={maxEvents} | ||
// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge?api-Version={apiVersion} | ||
// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} | ||
// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion}&releaseDelayInSeconds={delay} | ||
// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject?api-version={apiVersion} | ||
@server( | ||
"{endpoint}", | ||
|
@@ -43,14 +43,15 @@ namespace Microsoft.EventGrid { | |
using TypeSpec.Versioning; | ||
using Azure.Core; | ||
using Azure.Core.Foundations; | ||
using Azure; | ||
|
||
#suppress "@azure-tools/typespec-azure-core/documentation-required" "https://github.com/Azure/typespec-azure/issues/3107" | ||
enum ServiceApiVersions { | ||
@useDependency(Azure.Core.Versions.v1_0_Preview_2) | ||
v2023_06_01_preview: "2023-06-01-preview", | ||
|
||
@useDependency(Azure.Core.Versions.v1_0_Preview_2) | ||
v2023_09_01_preview: "2023-10-01-preview", | ||
v2023_10_01_preview: "2023-10-01-preview", | ||
} | ||
|
||
alias StandardOperations = Azure.Core.StandardResourceOperations; | ||
|
@@ -114,34 +115,31 @@ namespace Microsoft.EventGrid { | |
value: ReceiveDetails[]; | ||
} | ||
|
||
@doc("Failed lock token information.") | ||
@doc("Failed LockToken information.") | ||
model FailedLockToken { | ||
@doc("The lock token of an entry in the request.") | ||
@doc("LockToken value") | ||
lockToken: string; | ||
|
||
@doc("Error code related to the lock token. Example of such error codes are TokenLost: which indicates that token is not found, and InternalServerError: For any internal server errors.") | ||
errorCode: string; | ||
|
||
@doc("Description of the lock token error.") | ||
errorDescription: string; | ||
@doc("Error information of the failed operation result for the lock token in the request.") | ||
error: Azure.Core.Foundations.Error; | ||
} | ||
|
||
@doc("Supported delays for release operation.") | ||
batrived marked this conversation as resolved.
Show resolved
Hide resolved
|
||
enum ReleaseDelay { | ||
enum Delay { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not blocking, but this will be too general for an SDK. |
||
@doc("Release the event after 0 seconds.") | ||
l0lawrence marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ReleaseEventIn0Seconds: 0, | ||
By0Seconds: 0, | ||
|
||
@doc("Release the event after 10 seconds.") | ||
ReleaseEventIn10Seconds: 10, | ||
By10Seconds: 10, | ||
|
||
@doc("Release the event after 60 seconds.") | ||
ReleaseEventIn60Seconds: 60, | ||
By60Seconds: 60, | ||
|
||
@doc("Release the event after 600 seconds.") | ||
ReleaseEventIn600Seconds: 600, | ||
By600Seconds: 600, | ||
|
||
@doc("Release the event after 3600 seconds.") | ||
ReleaseEventIn3600Seconds: 3600, | ||
By3600Seconds: 3600, | ||
} | ||
|
||
@doc("The result of the Publish operation.") | ||
|
@@ -298,36 +296,28 @@ namespace Microsoft.EventGrid { | |
op acknowledgeCloudEvents is StandardOperations.ResourceAction< | ||
EventSubscription, | ||
{ | ||
@doc("content type") | ||
@header("content-type") | ||
contentType: "application/json"; | ||
|
||
@doc("AcknowledgeOptions.") | ||
@body | ||
lockTokens: AcknowledgeOptions; | ||
acknowledgeOptions: AcknowledgeOptions; | ||
}, | ||
AcknowledgeResult | ||
>; | ||
|
||
// Release Operation: | ||
// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} | ||
// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion}&releaseDelayInSeconds={delay} | ||
|
||
@doc("Release batch of Cloud Events with an optional delay in seconds. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information.") | ||
@doc("Release batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information.") | ||
@action("release") | ||
op releaseCloudEvents is StandardOperations.ResourceAction< | ||
EventSubscription, | ||
{ | ||
@doc("content type") | ||
@header("content-type") | ||
contentType: "application/json"; | ||
|
||
@doc("ReleaseOptions") | ||
@body | ||
lockTokens: ReleaseOptions; | ||
releaseOptions: ReleaseOptions; | ||
|
||
@doc("Release cloud events with the specified delay in seconds.") | ||
@query | ||
delayInSeconds?: ReleaseDelay; | ||
releaseDelayInSeconds?: Delay; | ||
}, | ||
ReleaseResult | ||
>; | ||
|
@@ -340,32 +330,24 @@ namespace Microsoft.EventGrid { | |
op rejectCloudEvents is StandardOperations.ResourceAction< | ||
EventSubscription, | ||
{ | ||
@doc("content type") | ||
@header("content-type") | ||
contentType: "application/json"; | ||
|
||
@doc("RejectOptions") | ||
@body | ||
lockTokens: RejectOptions; | ||
rejectOptions: RejectOptions; | ||
}, | ||
RejectResult | ||
>; | ||
|
||
// RenewLock Operation: | ||
// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:renewlock?api-version={apiVersion} | ||
// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:renewLock?api-version={apiVersion} | ||
|
||
@doc("Renew lock for batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully renewed lockTokens, along with other failed lockTokens with their corresponding error information.") | ||
@action("renewlock") | ||
@action("renewLock") | ||
op renewCloudEventLocks is StandardOperations.ResourceAction< | ||
EventSubscription, | ||
{ | ||
@doc("content type") | ||
@header("content-type") | ||
contentType: "application/json"; | ||
|
||
@doc("RenewLockOptions") | ||
@body | ||
lockTokens: RenewLockOptions; | ||
renewLockOptions: RenewLockOptions; | ||
}, | ||
RenewCloudEventLocksResult | ||
>; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That just reiterates the property name. It doesn't describe what the value is. Maybe expand on this more, at least for GA (not blocking)?