From a6e58e73589e12cd52992bdf6177971dc88dd4c5 Mon Sep 17 00:00:00 2001 From: "rajesh.kumar" Date: Tue, 24 Dec 2024 13:40:06 +0530 Subject: Add APIs to control notification subscription - Add API for notification subscription - Add API for notification unsubscription - Add API for getting notification subscription information Issue-ID: CPS-2428 Change-Id: I56c34400dc73c71b936a51260efd241224dccdba Signed-off-by: rajesh.kumar --- docs/api/swagger/cps/openapi.yaml | 224 +++++++++++++++++++++++++++++++++++++- 1 file changed, 223 insertions(+), 1 deletion(-) (limited to 'docs/api/swagger') diff --git a/docs/api/swagger/cps/openapi.yaml b/docs/api/swagger/cps/openapi.yaml index 330c2ca7f7..154548797b 100644 --- a/docs/api/swagger/cps/openapi.yaml +++ b/docs/api/swagger/cps/openapi.yaml @@ -332,7 +332,7 @@ paths: - cps-admin /{apiVersion}/admin/dataspaces/{dataspace-name}/actions/clean: post: - description: Clean the dataspace (remove orphaned modules) + description: Clean the dataspace (remove orphaned schema sets and modules) operationId: cleanDataspace parameters: - description: apiVersion @@ -2562,6 +2562,208 @@ paths: tags: - cps-query x-codegen-request-body-name: xpath + /v2/notification-subscription: + delete: + description: Delete cps notification subscription + operationId: deleteNotificationSubscription + parameters: + - description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/xpath.html" + examples: + subscription by dataspace xpath: + value: "/dataspaces/dataspace[@name='dataspace01']" + subscription by anchor xpath: + value: "/dataspaces/dataspace[@name='dataspace01']/anchors/anchor[@name='anchor01']" + in: query + name: xpath + required: true + schema: + default: /dataspaces + type: string + responses: + "204": + content: {} + description: No Content + "400": + content: + application/json: + example: + status: 400 + message: Bad Request + details: The provided request is not valid + schema: + $ref: '#/components/schemas/ErrorMessage' + description: Bad Request + "403": + content: + application/json: + example: + status: 403 + message: Request Forbidden + details: This request is forbidden + schema: + $ref: '#/components/schemas/ErrorMessage' + description: Forbidden + "409": + content: + application/json: + example: + status: 409 + message: Conflicting request + details: The request cannot be processed as the resource is in use. + schema: + $ref: '#/components/schemas/ErrorMessage' + description: Conflict + "500": + content: + application/json: + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occurred + schema: + $ref: '#/components/schemas/ErrorMessage' + description: Internal Server Error + summary: Delete cps notification subscription + tags: + - cps-admin + get: + description: Get cps notification subscription + operationId: getNotificationSubscription + parameters: + - description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/xpath.html" + examples: + subscription by dataspace xpath: + value: "/dataspaces/dataspace[@name='dataspace01']" + subscription by anchor xpath: + value: "/dataspaces/dataspace[@name='dataspace01']/anchors/anchor[@name='anchor01']" + in: query + name: xpath + required: true + schema: + default: /dataspaces + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationSubscriptionsDataSample' + description: OK + "400": + content: + application/json: + example: + status: 400 + message: Bad Request + details: The provided request is not valid + schema: + $ref: '#/components/schemas/ErrorMessage' + description: Bad Request + "403": + content: + application/json: + example: + status: 403 + message: Request Forbidden + details: This request is forbidden + schema: + $ref: '#/components/schemas/ErrorMessage' + description: Forbidden + "409": + content: + application/json: + example: + status: 409 + message: Conflicting request + details: The request cannot be processed as the resource is in use. + schema: + $ref: '#/components/schemas/ErrorMessage' + description: Conflict + "500": + content: + application/json: + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occurred + schema: + $ref: '#/components/schemas/ErrorMessage' + description: Internal Server Error + summary: Get cps notification subscription + tags: + - cps-admin + post: + description: Create cps notification subscription + operationId: createNotificationSubscription + parameters: + - description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/xpath.html" + examples: + subscription by dataspace xpath: + value: "/dataspaces/dataspace[@name='dataspace01']" + subscription by anchor xpath: + value: "/dataspaces/dataspace[@name='dataspace01']/anchors/anchor[@name='anchor01']" + in: query + name: xpath + required: true + schema: + default: /dataspaces + type: string + requestBody: + content: + application/json: + examples: + dataSample: + $ref: '#/components/examples/NotificationSubscriptionsDataSample' + value: null + schema: + type: object + required: true + responses: + "201": + description: Created without response body + "400": + content: + application/json: + example: + status: 400 + message: Bad Request + details: The provided request is not valid + schema: + $ref: '#/components/schemas/ErrorMessage' + description: Bad Request + "403": + content: + application/json: + example: + status: 403 + message: Request Forbidden + details: This request is forbidden + schema: + $ref: '#/components/schemas/ErrorMessage' + description: Forbidden + "409": + content: + application/json: + example: + status: 409 + message: Conflicting request + details: The request cannot be processed as the resource is in use. + schema: + $ref: '#/components/schemas/ErrorMessage' + description: Conflict + "500": + content: + application/json: + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occurred + schema: + $ref: '#/components/schemas/ErrorMessage' + description: Internal Server Error + summary: Create cps notification subscription + tags: + - cps-admin components: examples: dataSample: @@ -2615,6 +2817,12 @@ components: name: SciFi - code: 2 name: kids + NotificationSubscriptionsDataSample: + value: + cps-notification-subscriptions:dataspaces: + dataspace: + - name: dataspace01 + - name: dataspace02 parameters: dataspaceNameInQuery: description: dataspace-name @@ -2795,6 +3003,19 @@ components: schema: example: 10 type: integer + notificationSubscriptionXpathInQuery: + description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/xpath.html" + examples: + subscription by dataspace xpath: + value: "/dataspaces/dataspace[@name='dataspace01']" + subscription by anchor xpath: + value: "/dataspaces/dataspace[@name='dataspace01']/anchors/anchor[@name='anchor01']" + in: query + name: xpath + required: true + schema: + default: /dataspaces + type: string responses: Created: content: @@ -2956,6 +3177,7 @@ components: type: string title: Module reference object type: object + NotificationSubscriptionsDataSample: {} getDeltaByDataspaceAnchorAndPayload_request: properties: json: -- cgit