From e089938733153cb23b13f541961ce4e3d9870f2a Mon Sep 17 00:00:00 2001 From: Supriya Ramachandra Dixit <49291167+Supriya-R-Dixit@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:08:04 -0800 Subject: [PATCH] swagger changes for containerservice event resources (#31271) * 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 --- .../ContainerServiceEventResources.tsp | 16 +++++++++ .../client.tsp | 6 ++++ ...eEventResources_ScheduledEventEmitted.json | 35 +++++++++++++++++++ .../main.tsp | 1 + .../2018-01-01/GeneratedSystemEvents.json | 9 +++++ .../2024-01-01/GeneratedSystemEvents.json | 9 +++++ .../ContainerServiceEventResources.json | 28 +++++++++++++++ ...eEventResources_ScheduledEventEmitted.json | 33 +++++++++++++++++ ...eEventResources_ScheduledEventEmitted.json | 35 +++++++++++++++++++ specification/eventgrid/data-plane/readme.md | 1 + 10 files changed, 173 insertions(+) create mode 100644 specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.ResourceNotifications/ContainerServiceEventResources.tsp create mode 100644 specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/examples/2024-01-01/ContainerServiceEventResources_ScheduledEventEmitted.json create mode 100644 specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/ContainerServiceEventResources.json create mode 100644 specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/examples/cloud-events-schema/ContainerServiceEventResources_ScheduledEventEmitted.json create mode 100644 specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/examples/event-grid-schema/ContainerServiceEventResources_ScheduledEventEmitted.json diff --git a/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.ResourceNotifications/ContainerServiceEventResources.tsp b/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.ResourceNotifications/ContainerServiceEventResources.tsp new file mode 100644 index 000000000000..acd1866838d5 --- /dev/null +++ b/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.ResourceNotifications/ContainerServiceEventResources.tsp @@ -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 {} diff --git a/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.ResourceNotifications/client.tsp b/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.ResourceNotifications/client.tsp index 8783a167984a..6fb9f8c92f70 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.ResourceNotifications/client.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.ResourceNotifications/client.tsp @@ -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 ); diff --git a/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/examples/2024-01-01/ContainerServiceEventResources_ScheduledEventEmitted.json b/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/examples/2024-01-01/ContainerServiceEventResources_ScheduledEventEmitted.json new file mode 100644 index 000000000000..b58a3dc264ad --- /dev/null +++ b/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/examples/2024-01-01/ContainerServiceEventResources_ScheduledEventEmitted.json @@ -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" +} diff --git a/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/main.tsp index 09516b08cdc7..2529f98683c5 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/main.tsp @@ -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"; diff --git a/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/GeneratedSystemEvents.json b/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/GeneratedSystemEvents.json index 6d2ef8958c3b..dacc3067b0b6 100644 --- a/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/GeneratedSystemEvents.json +++ b/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/GeneratedSystemEvents.json @@ -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.", diff --git a/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2024-01-01/GeneratedSystemEvents.json b/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2024-01-01/GeneratedSystemEvents.json index 2686688afd8b..769555c8707b 100644 --- a/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2024-01-01/GeneratedSystemEvents.json +++ b/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2024-01-01/GeneratedSystemEvents.json @@ -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.", diff --git a/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/ContainerServiceEventResources.json b/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/ContainerServiceEventResources.json new file mode 100644 index 000000000000..090af0983a97 --- /dev/null +++ b/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/ContainerServiceEventResources.json @@ -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" + } + } + } + } +} diff --git a/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/examples/cloud-events-schema/ContainerServiceEventResources_ScheduledEventEmitted.json b/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/examples/cloud-events-schema/ContainerServiceEventResources_ScheduledEventEmitted.json new file mode 100644 index 000000000000..e3766239a8e3 --- /dev/null +++ b/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/examples/cloud-events-schema/ContainerServiceEventResources_ScheduledEventEmitted.json @@ -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" +} diff --git a/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/examples/event-grid-schema/ContainerServiceEventResources_ScheduledEventEmitted.json b/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/examples/event-grid-schema/ContainerServiceEventResources_ScheduledEventEmitted.json new file mode 100644 index 000000000000..3b58707cfd3e --- /dev/null +++ b/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/examples/event-grid-schema/ContainerServiceEventResources_ScheduledEventEmitted.json @@ -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" +} diff --git a/specification/eventgrid/data-plane/readme.md b/specification/eventgrid/data-plane/readme.md index 43b0465c00e3..372db9e9e967 100644 --- a/specification/eventgrid/data-plane/readme.md +++ b/specification/eventgrid/data-plane/readme.md @@ -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 ```