Skip to content
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

api management events schema #15987

Merged
merged 15 commits into from
Sep 23, 2021
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"swagger": "2.0",
"info": {
"version": "2018-01-01",
"title": "Schema of Azure API Management events published to Azure Event Grid",
"description": "Describes the schema of the Azure API Management events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent."
},
"paths": {},
"definitions": {
"ApiManagementUserCreatedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementUserUpdatedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementUserDeletedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementSubscriptionCreatedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementSubscriptionUpdatedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementSubscriptionDeletedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementProductCreatedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementProductUpdatedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementProductDeletedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementApiCreatedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementApiUpdatedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that for some events API is capitalized, and in other cases, it's spell Api (e.g. APIUpdated vs ApiReleaseUpdated) I just want to confirm that the difference in casing between these event is expected.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, curious about this - We would likely need to rename this via swagger transforms in .NET. It also seems odd that we have API (in whatever casing) twice in the name of the events.

Copy link
Member

@JoshLove-msft JoshLove-msft Sep 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense but the casing should be consistent, right?

We will have to transform it anyway to use "Api" everywhere if we leave it as "API" in the swagger.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApiManagement is the name of our service that hosts "API" entities. API is an abbreviation so we normally spell it with all caps.
Renaming "ApiManagementAPI" to "ApiManagementApi" requires an extra rollout train to all our services. We prefer to stay as it is.

"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementApiDeletedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementApiReleaseCreatedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementApiReleaseUpdatedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
},
"ApiManagementApiReleaseDeletedEventData": {
"description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event.",
"type": "object",
"properties": {
"resourceUri": {
"description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`",
"type": "string"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "95015754-aa51-4eb6-98d9-9ee322b82ad7",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/apis/myapi",
"data": {
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/apis/myapi"
},
"eventType": "Microsoft.ApiManagement.APICreated",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-12T23:13:44.9048323Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "95015754-aa51-4eb6-98d9-9ee322b82ad7",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/apis/myapi;Rev=1",
"data": {
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/apis/myapi;Rev=1"
},
"eventType": "Microsoft.ApiManagement.APIDeleted",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-12T23:13:44.9048323Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "95015754-aa51-4eb6-98d9-9ee322b82ad7",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/apis/myapi;Rev=1",
"data": {
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/apis/myapi;Rev=1"
},
"eventType": "Microsoft.ApiManagement.APIUpdated",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-12T23:13:44.9048323Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "95015754-aa51-4eb6-98d9-9ee322b82ad7",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/apis/{apiId}/releases/{releaseId}",
"data": {
"resourceUri": "/subscriptions/subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/apis/{apiId}/releases/{releaseId}"
},
"eventType": "Microsoft.ApiManagement.APIReleaseCreated",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-12T23:13:44.9048323Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "95015754-aa51-4eb6-98d9-9ee322b82ad7",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/apis/{apiId}/releases/{releaseId}",
"data": {
"resourceUri": "/subscriptions/subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/apis/{apiId}/releases/{releaseId}"
},
"eventType": "Microsoft.ApiManagement.APIReleaseDeleted",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to check - are the event types still using "API" or were they also updated to "Api" to match the event names?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @KacieKK

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake - I see that the event names were updated, but the event descriptions were left in the API casing. Please disregard my question.

"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-12T23:13:44.9048323Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "95015754-aa51-4eb6-98d9-9ee322b82ad7",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/apis/{apiId}/releases/{releaseId}",
"data": {
"resourceUri": "/subscriptions/subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/apis/{apiId}/releases/{releaseId}"
},
"eventType": "Microsoft.ApiManagement.APIReleaseUpdated",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-12T23:13:44.9048323Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "92c502f2-a966-42a7-a428-d3b319844544",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/products/myproduct",
"data": {
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/products/myproduct"
},
"eventType": "Microsoft.ApiManagement.ProductCreated",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-02T00:47:47.8536532Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "92c502f2-a966-42a7-a428-d3b319844544",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/products/myproduct",
"data": {
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/products/myproduct"
},
"eventType": "Microsoft.ApiManagement.ProductDeleted",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-02T00:47:47.8536532Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "92c502f2-a966-42a7-a428-d3b319844544",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/products/myproduct",
"data": {
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/products/myproduct"
},
"eventType": "Microsoft.ApiManagement.ProductUpdated",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-02T00:47:47.8536532Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "831e1650-001e-001b-66ab-eeb76e069631",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/subscriptions/{subscriptionId}",
"data": {
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/subscriptions/{subscriptionId}"
},
"eventType": "Microsoft.ApiManagement.SubscriptionCreated",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-02T00:47:47.8536532Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "831e1650-001e-001b-66ab-eeb76e069631",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/subscriptions/{subscriptionId}",
"data": {
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/subscriptions/{subscriptionId}"
},
"eventType": "Microsoft.ApiManagement.SubscriptionDeleted",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-02T00:47:47.8536532Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "831e1650-001e-001b-66ab-eeb76e069631",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/subscriptions/{subscriptionId}",
"data": {
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/subscriptions/{subscriptionId}"
},
"eventType": "Microsoft.ApiManagement.SubscriptionUpdated",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-02T00:47:47.8536532Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "92c502f2-a966-42a7-a428-d3b319844544",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/users/apimuser-contoso-com",
"data": {
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/users/apimuser-contoso-com"
},
"eventType": "Microsoft.ApiManagement.UserCreated",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-02T00:47:47.8237532Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "92c502f2-a966-42a7-a428-d3b319844544",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/users/apimuser-contoso-com",
"data": {
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/users/apimuser-contoso-com"
},
"eventType": "Microsoft.ApiManagement.UserDeleted",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-02T00:47:47.8536532Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "92c502f2-a966-42a7-a428-d3b319844544",
"topic": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}",
"subject": "/users/apimuser-contoso-com",
"data": {
"resourceUri": "/subscriptions/{subscription-id}/resourceGroups/{your-rg}/providers/Microsoft.ApiManagement/service/{your-APIM-instance}/users/apimuser-contoso-com"
},
"eventType": "Microsoft.ApiManagement.UserUpdated",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2021-07-02T00:47:48.8269769Z"
}
3 changes: 3 additions & 0 deletions specification/eventgrid/data-plane/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ input-file:
- Microsoft.Communication/stable/2018-01-01/AzureCommunicationServices.json
- Microsoft.PolicyInsights/stable/2018-01-01/PolicyInsights.json
- Microsoft.ContainerService/stable/2018-01-01/ContainerService.json
- Microsoft.ApiManagement/stable/2018-01-01/APIManagement.json

```

### Suppression
Expand Down Expand Up @@ -227,6 +229,7 @@ input-file:
- $(this-folder)/Microsoft.Web/stable/2018-01-01/Web.json
- $(this-folder)/Microsoft.Communication/stable/2018-01-01/AzureCommunicationServices.json
- $(this-folder)/Microsoft.ContainerService/stable/2018-01-01/ContainerService.json
- $(this-folder)/Microsoft.ApiManagement/stable/2018-01-01/APIManagement.json

```

Expand Down