From b14f04b6bd92b4dd6e3ed511ef5334db02e0b1ea Mon Sep 17 00:00:00 2001 From: Renu Kumari Date: Mon, 28 Mar 2022 10:22:41 -0400 Subject: Update CM-Handle registration response - update openapi.yml with new response structure - send only details of failed cm-handle operations - updated csit to validate 200 status Issue-ID: CPS-896 Signed-off-by: Renu Kumari Change-Id: I3b868bcc5b8ff488c31faef51edc82c771452234 --- cps-ncmp-rest/docs/openapi/components.yaml | 48 +++++++++++++++++++++++++++ cps-ncmp-rest/docs/openapi/ncmp-inventory.yml | 7 ++-- 2 files changed, 53 insertions(+), 2 deletions(-) (limited to 'cps-ncmp-rest/docs') diff --git a/cps-ncmp-rest/docs/openapi/components.yaml b/cps-ncmp-rest/docs/openapi/components.yaml index 69225aed2..ddce05242 100644 --- a/cps-ncmp-rest/docs/openapi/components.yaml +++ b/cps-ncmp-rest/docs/openapi/components.yaml @@ -70,6 +70,54 @@ components: items: type: string example: [my-cm-handle1, my-cm-handle2, my-cm-handle3] + DmiPluginRegistrationErrorResponse: + type: object + properties: + failedCreatedCmHandles: + type: array + items: + $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse' + example: [ + { + "cmHandle": "my-cm-handle-01", + "errorCode": "01", + "errorText": "cm-handle already exists" + } + ] + failedUpdatedCmHandles: + type: array + items: + $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse' + example: [ + { + "cmHandle": "my-cm-handle-02", + "errorCode": "02", + "errorText": "cm-handle does not exist" + } + ] + failedRemovedCmHandles: + type: array + items: + $ref: '#/components/schemas/CmHandlerRegistrationErrorResponse' + example: [ + { + "cmHandle": "my-cm-handle-02", + "errorCode": "02", + "errorText": "cm-handle does not exist" + } + ] + CmHandlerRegistrationErrorResponse: + type: object + properties: + cmHandle: + type: string + example: my-cm-handle + errorCode: + type: string + example: '01' + errorText: + type: string + example: 'cm-handle already exists' RestInputCmHandle: required: diff --git a/cps-ncmp-rest/docs/openapi/ncmp-inventory.yml b/cps-ncmp-rest/docs/openapi/ncmp-inventory.yml index 3cd8e8baf..5e61d0962 100755 --- a/cps-ncmp-rest/docs/openapi/ncmp-inventory.yml +++ b/cps-ncmp-rest/docs/openapi/ncmp-inventory.yml @@ -31,7 +31,7 @@ updateDmiRegistration: schema: $ref: 'components.yaml#/components/schemas/RestDmiPluginRegistration' responses: - 204: + 200: $ref: 'components.yaml#/components/responses/NoContent' 400: $ref: 'components.yaml#/components/responses/BadRequest' @@ -40,4 +40,7 @@ updateDmiRegistration: 403: $ref: 'components.yaml#/components/responses/Forbidden' 500: - $ref: 'components.yaml#/components/responses/InternalServerError' + content: + application/json: + schema: + $ref: 'components.yaml#/components/schemas/DmiPluginRegistrationErrorResponse' -- cgit 1.2.3-korg