From 409f581e458eb3914486b7555dc54087f88b1a78 Mon Sep 17 00:00:00 2001 From: Jack Ding Date: Fri, 3 May 2024 19:58:48 -0400 Subject: [PATCH] update swagger.json Update swagger and remove Golang specific extensions Signed-off-by: Jack Ding --- swagger.json | 116 +++++++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 55 deletions(-) diff --git a/swagger.json b/swagger.json index a382929..b112c94 100644 --- a/swagger.json +++ b/swagger.json @@ -104,114 +104,123 @@ } } } + }, + "/subscriptions/status": { + "post": { + "description": "If publisher status ping is success, call will be returned with status accepted.", + "tags": [ + "subscriptions" + ], + "summary": "Get status of publishing events.", + "operationId": "pingForSubscribedEventStatus", + "parameters": [ + { + "description": "subscription id to check status for", + "name": "subscriptionid" + } + ], + "responses": { + "201": { + "$ref": "#/responses/pubSubResp" + }, + "400": { + "$ref": "#/responses/badReq" + } + } + } } }, "definitions": { "Data": { - "description": "Data ... cloud native events data\nData Json payload is as follows,\n{\n\"version\": \"v1.0\",\n\"values\": [{\n\"resource\": \"/cluster/node/ptp\",\n\"dataType\": \"notification\",\n\"valueType\": \"enumeration\",\n\"value\": \"ACQUIRING-SYNC\"\n}, {\n\"resource\": \"/cluster/node/clock\",\n\"dataType\": \"metric\",\n\"valueType\": \"decimal64.3\",\n\"value\": 100.3\n}]\n}", + "description": "{\n\"version\": \"v1.0\",\n\"values\": [{\n\"resource\": \"/sync/sync-status/sync-state\",\n\"dataType\": \"notification\",\n\"valueType\": \"enumeration\",\n\"value\": \"ACQUIRING-SYNC\"\n}, {\n\"resource\": \"/sync/sync-status/sync-state\",\n\"dataType\": \"metric\",\n\"valueType\": \"decimal64.3\",\n\"value\": 100.3\n}, {\n\"resource\": \"/redfish/v1/Systems\",\n\"dataType\": \"notification\",\n\"valueType\": \"redfish-event\",\n\"value\": {\n\"@odata.context\": \"/redfish/v1/$metadata#Event.Event\",\n\"@odata.type\": \"#Event.v1_3_0.Event\",\n\"Context\": \"any string is valid\",\n\"Events\": [{\"EventId\": \"2162\", \"MemberId\": \"615703\", \"MessageId\": \"TMP0100\"}],\n\"Id\": \"5e004f5a-e3d1-11eb-ae9c-3448edf18a38\",\n\"Name\": \"Event Array\"\n}\n}]\n}", "type": "object", + "title": "Data ... cloud native events data\nData Json payload is as follows,", "properties": { "values": { "type": "array", "items": { "$ref": "#/definitions/DataValue" - }, - "x-go-name": "Values" + } }, "version": { - "type": "string", - "x-go-name": "Version" + "type": "string" } - }, - "x-go-package": "github.com/redhat-cne/sdk-go/pkg/event" + } }, "DataType": { "type": "string", - "title": "DataType ...", - "x-go-package": "github.com/redhat-cne/sdk-go/pkg/event" + "title": "DataType ..." }, "DataValue": { - "description": "DataValue Json payload is as follows,\n{\n\"resource\": \"/cluster/node/ptp\",\n\"dataType\": \"notification\",\n\"valueType\": \"enumeration\",\n\"value\": \"ACQUIRING-SYNC\"\n}", + "description": "{\n\"resource\": \"/cluster/node/ptp\",\n\"dataType\": \"notification\",\n\"valueType\": \"enumeration\",\n\"value\": \"ACQUIRING-SYNC\"\n}", "type": "object", - "title": "DataValue ...", + "title": "DataValue ...\nDataValue Json payload is as follows,", "properties": { "dataType": { "$ref": "#/definitions/DataType" }, "resource": { - "type": "string", - "x-go-name": "Resource" - }, - "value": { - "type": "object", - "x-go-name": "Value" + "type": "string" }, + "value": {}, "valueType": { "$ref": "#/definitions/ValueType" } - }, - "x-go-package": "github.com/redhat-cne/sdk-go/pkg/event" + } }, "Event": { - "description": "Event Json payload is as follows,\n{\n\"id\": \"5ce55d17-9234-4fee-a589-d0f10cb32b8e\",\n\"type\": \"event.synchronization-state-chang\",\n\"time\": \"2021-02-05T17:31:00Z\",\n\"data\": {\n\"version\": \"v1.0\",\n\"values\": [{\n\"resource\": \"/cluster/node/ptp\",\n\"dataType\": \"notification\",\n\"valueType\": \"enumeration\",\n\"value\": \"ACQUIRING-SYNC\"\n}, {\n\"resource\": \"/cluster/node/clock\",\n\"dataType\": \"metric\",\n\"valueType\": \"decimal64.3\",\n\"value\": 100.3\n}]\n}\n}\nEvent request model", + "description": "{\n\"id\": \"5ce55d17-9234-4fee-a589-d0f10cb32b8e\",\n\"type\": \"event.sync.sync-status.synchronization-state-change\",\n\"source\": \"/cluster/node/example.com/ptp/clock_realtime\",\n\"time\": \"2021-02-05T17:31:00Z\",\n\"data\": {\n\"version\": \"v1.0\",\n\"values\": [{\n\"resource\": \"/sync/sync-status/sync-state\",\n\"dataType\": \"notification\",\n\"valueType\": \"enumeration\",\n\"value\": \"ACQUIRING-SYNC\"\n}, {\n\"resource\": \"/sync/sync-status/sync-state\",\n\"dataType\": \"metric\",\n\"valueType\": \"decimal64.3\",\n\"value\": 100.3\n}]\n}\n}\n\nEvent request model", "type": "object", - "title": "Event represents the canonical representation of a Cloud Native Event.", + "title": "Event represents the canonical representation of a Cloud Native Event.\nEvent Json payload is as follows,", "properties": { "data": { "$ref": "#/definitions/Data" }, "dataContentType": { "description": "DataContentType - the Data content type\n+required", - "type": "string", - "x-go-name": "DataContentType" + "type": "string" }, "dataSchema": { "$ref": "#/definitions/URI" }, "id": { "description": "ID of the event; must be non-empty and unique within the scope of the producer.\n+required", - "type": "string", - "x-go-name": "ID" + "type": "string" + }, + "source": { + "description": "Source - The source of the occurrence which has happened.\n+required", + "type": "string" }, "time": { - "$ref": "#/definitions/Timestamp" + "description": "Time - A Timestamp when the event happened.\n+required", + "type": "string" }, "type": { "description": "Type - The type of the occurrence which has happened.\n+required", - "type": "string", - "x-go-name": "Type" + "type": "string" } - }, - "x-go-package": "github.com/redhat-cne/sdk-go/pkg/event" + } }, "PubSub": { - "description": "PubSub Json request payload is as follows,\n{\n\"id\": \"789be75d-7ac3-472e-bbbc-6d62878aad4a\",\n\"endpointUri\": \"http://localhost:9090/ack/event\",\n\"uriLocation\": \"http://localhost:8080/api/ocloudNotifications/v1/publishers/{publisherid}\",\n\"resource\": \"/east-edge-10/vdu3/o-ran-sync/sync-group/sync-status/sync-state\"\n}\nPubSub request model", + "description": "{\n\"id\": \"789be75d-7ac3-472e-bbbc-6d62878aad4a\",\n\"endpointUri\": \"http://localhost:9090/ack/event\",\n\"uriLocation\": \"http://localhost:8080/api/ocloudNotifications/v1/publishers/{publisherid}\",\n\"resource\": \"/east-edge-10/vdu3/o-ran-sync/sync-group/sync-status/sync-state\"\n}\n\nPubSub request model", "type": "object", - "title": "PubSub represents the canonical representation of a Cloud Native Event Publisher and Subscribers .", + "title": "PubSub represents the canonical representation of a Cloud Native Event Publisher and Sender .\nPubSub Json request payload is as follows,", "properties": { "endpointUri": { "$ref": "#/definitions/URI" }, "id": { "description": "ID of the pub/sub; is updated on successful creation of publisher/subscription.", - "type": "string", - "x-go-name": "ID" + "type": "string" }, "resource": { "description": "Resource - The type of the Resource.\n+required", - "type": "string", - "x-go-name": "Resource" + "type": "string" }, "uriLocation": { "$ref": "#/definitions/URI" } - }, - "x-go-package": "github.com/redhat-cne/sdk-go/pkg/pubsub" - }, - "Timestamp": { - "description": "Timestamp wraps time.Time to normalize the time layout to RFC3339. It is\nintended to enforce compliance with the Cloud Native events spec for their\ndefinition of Timestamp. Custom marshal methods are implemented to ensure\nthe outbound Timestamp is a string in the RFC3339 layout.", - "type": "object", - "x-go-package": "github.com/redhat-cne/sdk-go/pkg/types" + } }, "URI": { "description": "URI is a wrapper to url.URL. It is intended to enforce compliance with\nthe Cloud Native Events spec for their definition of URI. Custom\nmarshal methods are implemented to ensure the outbound URI object\nis a flat string.", @@ -226,6 +235,9 @@ "Host": { "type": "string" }, + "OmitHost": { + "type": "boolean" + }, "Opaque": { "type": "string" }, @@ -247,18 +259,15 @@ "User": { "$ref": "#/definitions/Userinfo" } - }, - "x-go-package": "github.com/redhat-cne/sdk-go/pkg/types" + } }, "Userinfo": { "description": "The Userinfo type is an immutable encapsulation of username and\npassword details for a URL. An existing Userinfo value is guaranteed\nto have a username set (potentially empty, as allowed by RFC 2396),\nand optionally a password.", - "type": "object", - "x-go-package": "net/url" + "type": "object" }, "ValueType": { "type": "string", - "title": "ValueType ...", - "x-go-package": "github.com/redhat-cne/sdk-go/pkg/event" + "title": "ValueType ..." } }, "responses": { @@ -270,8 +279,7 @@ "code": { "description": "HTTP status code 202 - Accepted", "type": "integer", - "format": "int64", - "x-go-name": "Code" + "format": "int64" } } } @@ -284,8 +292,7 @@ "code": { "description": "HTTP status code 400 - Bad Request", "type": "integer", - "format": "int64", - "x-go-name": "Code" + "format": "int64" } } } @@ -304,8 +311,7 @@ "code": { "description": "HTTP status code 404 - Not Found", "type": "integer", - "format": "int64", - "x-go-name": "Code" + "format": "int64" } } }