Skip to content

Commit

Permalink
swagger changes for containerservice event resources (#31271)
Browse files Browse the repository at this point in the history
* swagger changes for containerservice event resources

* included containerserviceeventresources json file in readme

* changed event type name per discussion with API reviewers from
ResourceNotificationsContainerServiceEventResourcesScheduledEventEmittedEventData
to ResourceNotificationsContainerServiceEventResourcesScheduledEventData

* included typespec files for scheduledeventemitted event type for
containerserviceeventresources system topic

* included the containerserviceeventresources typespec file in main.tsp
for generating the swaggers
  • Loading branch information
Supriya-R-Dixit authored Nov 13, 2024
1 parent 6d1ddf2 commit e089938
Show file tree
Hide file tree
Showing 10 changed files with 173 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import "@typespec/versioning";
import "./common.tsp";
using TypeSpec.Versioning;

/**
Describes the schema of the Container Service events published to Azure
Event Grid. This corresponds to the Data property of an EventGridEvent.
*/
namespace Microsoft.EventGrid.SystemEvents;

/**
Schema of the Data property of an event grid event for a Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted preview event.
*/
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "Maintain compatibility with existing models."
model ResourceNotificationsContainerServiceEventResourcesScheduledEventData
extends ResourceNotificationsResourceUpdatedEventData {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
//Models
@@usage(Microsoft.EventGrid.SystemEvents.ResourceNotificationsContainerServiceEventResourcesScheduledEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ResourceNotificationsContainerServiceEventResourcesScheduledEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData,
Usage.output
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"id": "5bdb52cf-5489-4845-86c8-7fe94a4fc6c1",
"source": "/subscriptions/{subscription-id}",
"subject": "/subscriptions/{subscription-id}/resourceGroups/{rg-name}/providers/Microsoft.ContainerService/managedClusters/{managedcluster-name}/scheduledEvents/{event-id}",
"data": {
"resourceInfo": {
"id": "/subscriptions/{subscription-id}/resourceGroups/{rg-name}/providers/Microsoft.ContainerService/managedClusters/{managedcluster-name}/scheduledEvents/{event-id}",
"name": "{event-id}",
"type": "Microsoft.ContainerService/managedClusters/scheduledEvents",
"properties": {
"description": "ScheduledEvents",
"eventId": "bbe82027-0444-4f73-897a-0bbfe3af66f1",
"eventSource": "AutoUprader",
"eventStatus": "Started",
"eventDetails": "Start to upgrade security vhd",
"scheduledTime": "2024-04-16T22:17:12.103268606Z",
"startTime": "0001-01-01T00:00:00.0000000Z",
"lastUpdateTime": "0001-01-01T00:00:00.0000000Z",
"resources": [
"/subscriptions/{subscription-id}/resourcegroups/{rg-name}/providers/Microsoft.ContainerService/managedClusters/{managedcluster-name}"
],
"resourceType": "ManagedCluster"
}
},
"operationalInfo": {
"resourceEventTime": "2024-04-16T22:17:12.1032748"
},
"apiVersion": "2023-11-02-preview"
},
"type": "Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted",
"specversion": "1.0",
"time": "2024-04-16T22:17:12.1032748Z",
"operationId": "ContainerServiceEventResourcesScheduledEventEmittedEventName",
"title": "ContainerServiceEventResourcesScheduledEventEmitted"
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import "./Microsoft.Web/Web.tsp";
import "./Microsoft.EventGrid/EventGrid.tsp";
import "./Microsoft.ResourceNotifications/HealthResources.tsp";
import "./Microsoft.ResourceNotifications/Resources.tsp";
import "./Microsoft.ResourceNotifications/ContainerServiceEventResources.tsp";

import "./propertyNameOverride.tsp";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7509,6 +7509,15 @@
}
}
},
"ResourceNotificationsContainerServiceEventResourcesScheduledEventData": {
"type": "object",
"description": "Schema of the Data property of an event grid event for a Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted preview event.",
"allOf": [
{
"$ref": "#/definitions/ResourceNotificationsResourceUpdatedEventData"
}
]
},
"ResourceNotificationsHealthResourcesAnnotatedEventData": {
"type": "object",
"description": "Schema of the Data property of an EventGridEvent for a\nMicrosoft.ResourceNotifications.HealthResources.ResourceAnnotated event.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7641,6 +7641,15 @@
}
}
},
"ResourceNotificationsContainerServiceEventResourcesScheduledEventData": {
"type": "object",
"description": "Schema of the Data property of an event grid event for a Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted preview event.",
"allOf": [
{
"$ref": "#/definitions/ResourceNotificationsResourceUpdatedEventData"
}
]
},
"ResourceNotificationsHealthResourcesAnnotatedEventData": {
"type": "object",
"description": "Schema of the Data property of an EventGridEvent for a\nMicrosoft.ResourceNotifications.HealthResources.ResourceAnnotated event.",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"swagger": "2.0",
"info": {
"version": "2018-01-01",
"title": "Schema of Container Service events published to Azure Event Grid via Azure Resource Notifications",
"description": "Describes the schema of the Container Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent."
},
"paths": {},
"definitions": {
"ResourceNotificationsContainerServiceEventResourcesScheduledEventData": {
"description": "Schema of the Data property of an event grid event for a Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted preview event.",
"type": "object",
"allOf": [
{
"$ref": "./common.json#/definitions/ResourceNotificationsResourceUpdatedEventData"
}
],
"x-ms-examples": {
"ResourceNotificationsContainerServiceEventResourcesScheduledEmittedEventGridSchema": {
"$ref": "./examples/event-grid-schema/ContainerServiceEventResources_ScheduledEventEmitted.json"
},
"ResourceNotificationsContainerServiceEventResourcesScheduledEventEmittedCloudEventsSchema": {
"$ref": "./examples/cloud-events-schema/ContainerServiceEventResources_ScheduledEventEmitted.json"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": "5bdb52cf-5489-4845-86c8-7fe94a4fc6c1",
"source": "/subscriptions/{subscription-id}",
"subject": "/subscriptions/{subscription-id}/resourceGroups/{rg-name}/providers/Microsoft.ContainerService/managedClusters/{managedcluster-name}/scheduledEvents/{event-id}",
"data": {
"resourceInfo": {
"id": "/subscriptions/{subscription-id}/resourceGroups/{rg-name}/providers/Microsoft.ContainerService/managedClusters/{managedcluster-name}/scheduledEvents/{event-id}",
"name": "{event-id}",
"type": "Microsoft.ContainerService/managedClusters/scheduledEvents",
"properties": {
"description": "ScheduledEvents",
"eventId": "bbe82027-0444-4f73-897a-0bbfe3af66f1",
"eventSource": "AutoUprader",
"eventStatus": "Started",
"eventDetails": "Start to upgrade security vhd",
"scheduledTime": "2024-04-16T22:17:12.103268606Z",
"startTime": "0001-01-01T00:00:00.0000000Z",
"lastUpdateTime": "0001-01-01T00:00:00.0000000Z",
"resources": [
"/subscriptions/{subscription-id}/resourcegroups/{rg-name}/providers/Microsoft.ContainerService/managedClusters/{managedcluster-name}"
],
"resourceType": "ManagedCluster"
}
},
"operationalInfo": {
"resourceEventTime": "2024-04-16T22:17:12.1032748"
},
"apiVersion": "2023-11-02-preview"
},
"type": "Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted",
"specversion": "1.0",
"time": "2024-04-16T22:17:12.1032748Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"id": "5bdb52cf-5489-4845-86c8-7fe94a4fc6c1",
"topic": "/subscriptions/{subscription-id}",
"subject": "/subscriptions/{subscription-id}/resourcegroups/{rg-name}/providers/Microsoft.ContainerService/managedClusters/{managedcluster-id}/scheduledEvents/{event-id}",
"data": {
"resourceInfo": {
"id": "/subscriptions/{subscription-id}/resourcegroups/{rg-name}/providers/Microsoft.ContainerService/managedClusters/{managedcluster-id}/scheduledEvents/{event-id}",
"name": "{event-id}",
"type": "Microsoft.ContainerService/managedClusters/scheduledEvents",
"location": "westus2",
"properties": {
"description": "ScheduledEvents",
"eventId": "bbe82027-0444-4f73-897a-0bbfe3af66f1",
"eventSource": "AutoUprader",
"eventStatus": "Started",
"eventDetails": "Start to upgrade security vhd",
"scheduledTime": "2024-04-16T22:17:12.103268606Z",
"startTime": "0001-01-01T00:00:00.0000000Z",
"lastUpdateTime": "0001-01-01T00:00:00.0000000Z",
"resources": [
"/subscriptions/{subscription-id}/resourcegroups/{rg-name}/providers/Microsoft.ContainerService/managedClusters/{managedcluster-id}"
],
"resourceType": "ManagedCluster"
}
},
"operationalInfo": {
"resourceEventTime": "2024-04-16T22:17:12.1032748"
},
"apiVersion": "2023-11-02-preview"
},
"eventType": "Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted",
"dataVersion": "1",
"metadataVersion": "1",
"eventTime": "2024-04-16T22:17:12.1032748Z"
}
1 change: 1 addition & 0 deletions specification/eventgrid/data-plane/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ input-file:
- Microsoft.ResourceNotifications/stable/2018-01-01/common.json
- Microsoft.ResourceNotifications/stable/2018-01-01/HealthResources.json
- Microsoft.ResourceNotifications/stable/2018-01-01/Resources.json
- Microsoft.ResourceNotifications/stable/2018-01-01/ContainerServiceEventResources.json
- Microsoft.AVS/stable/2018-01-01/PrivateCloud.json
- Microsoft.ApiCenter/stable/2018-01-01/ApiCenter.json
```
Expand Down

0 comments on commit e089938

Please sign in to comment.