From 51c8535277afa16b8dc8680f9340e9202a34fbb5 Mon Sep 17 00:00:00 2001 From: Renan de Andrade Date: Wed, 18 Oct 2023 08:54:30 -0300 Subject: [PATCH 1/2] doc: add certificates openapi documentation --- docs/openapi.yaml | 101 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/docs/openapi.yaml b/docs/openapi.yaml index 7c90ab65d..4275e331f 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -590,6 +590,86 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + + /resources/{instance}/certificate: + parameters: + - in: path + name: instance + example: my-instance + schema: + type: string + required: true + description: Instance name + get: + summary: Get instance certificates + description: This endpoint is exclusive for RPaaS v2 API. + operationId: GetCertificates + tags: + - rpaas + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CertificateData' + post: + summary: Create instance certificate + description: This endpoint is exclusive for RPaaS v2 API. + operationId: CreateCertificate + tags: + - rpaas + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/CertificateData' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/CertificateData' + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CertificateData' + + /resources/{instance}/certificate/{name}: + parameters: + - in: path + name: instance + example: my-instance + schema: + type: string + required: true + description: Instance name + - in: path + name: name + example: my-instance.example.com + schema: + type: string + required: true + description: Certificate name + delete: + summary: Delete instance certificate + description: This endpoint is exclusive for RPaaS v2 API. + operationId: DeleteCertificate + tags: + - rpaas + responses: + '200': + description: Succesfully removed + default: + description: Something wrong happened + content: + application/json: + schema: + $ref: "#/components/schemas/Error" components: securitySchemes: @@ -1037,3 +1117,24 @@ components: lb-name: type: string example: my-instance.custom.example.com + + CertificateData: + type: object + properties: + name: + type: string + example: my-instance.example.com + certificate: + type: string + example: |- + -----BEGIN CERTIFICATE----- + MIIBhTCCASugAwIBAgIQIRi6zePL6mKjOipnWf86aX6PepsntZv2GYlA5UpabfT2EZICICpJ5h/iI+i341gBmLiAFQOyTDT+/wQc + -----END CERTIFICATE----- + key: + type: string + example: |- + -----BEGIN EC PRIVATE KEY----- + MHcCAQEEIIrYSSNQFaA2Hwf1duRSxKtLYX5CB04fSeQ6tF1aY/PuoAoGCCqGSM49 + AwEHoUQDQgAEPR3tU2Fta9ktY+6P9G0cWO+0kETA6SFs38GecTyudlHz6xvCdz8q + EKTcWGekdmdDPsHloRNtsiCa697B2O9IFA== + -----END EC PRIVATE KEY----- From 948768a68eaf2585f0a7f62d9a0db6489eb512d7 Mon Sep 17 00:00:00 2001 From: Renan de Andrade Date: Wed, 18 Oct 2023 09:06:38 -0300 Subject: [PATCH 2/2] doc: fix post certificates response --- docs/openapi.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/openapi.yaml b/docs/openapi.yaml index 4275e331f..2024b9266 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -632,12 +632,12 @@ paths: responses: '200': description: OK + '400': + description: Validation error content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/CertificateData' + $ref: '#/components/schemas/Error' /resources/{instance}/certificate/{name}: parameters: