Skip to content

Commit

Permalink
api management events schema (Azure#15987)
Browse files Browse the repository at this point in the history
* add swagger

* align

* rephrase

* resolvemergeconflict

* comments

* examples

* prettier

* comments

* pascal

Co-authored-by: Kacie Kang <jikang@microsoft.com>
  • Loading branch information
2 people authored and LeiWang3 committed Mar 31, 2022
1 parent 9063c52 commit c000369
Show file tree
Hide file tree
Showing 17 changed files with 344 additions and 0 deletions.
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.",
"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",
"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

0 comments on commit c000369

Please sign in to comment.