From 32c60285e397db85d9d1951ea577654623c81a36 Mon Sep 17 00:00:00 2001 From: Bogumil Zebek Date: Fri, 27 Mar 2020 09:27:39 +0100 Subject: Add swagger documentation Issue-ID: AAF-1107 Signed-off-by: Zebek Bogumil Change-Id: I3b22d2d17e4cec0f925e08e55c233f50f94f1e4b --- docs/sections/architecture.rst | 2 +- docs/sections/img/certservice_high_level.jpg | Bin 24640 -> 0 bytes docs/sections/offeredapis.rst | 2 +- docs/sections/openapi.yaml | 158 --------------------- docs/sections/resources/OpenAPI.yaml | 158 +++++++++++++++++++++ docs/sections/resources/certservice_high_level.jpg | Bin 0 -> 24640 bytes 6 files changed, 160 insertions(+), 160 deletions(-) delete mode 100644 docs/sections/img/certservice_high_level.jpg delete mode 100644 docs/sections/openapi.yaml create mode 100644 docs/sections/resources/OpenAPI.yaml create mode 100644 docs/sections/resources/certservice_high_level.jpg (limited to 'docs/sections') diff --git a/docs/sections/architecture.rst b/docs/sections/architecture.rst index 654208d1..9b1b481e 100644 --- a/docs/sections/architecture.rst +++ b/docs/sections/architecture.rst @@ -12,7 +12,7 @@ End component is an ONAP component (e.g. DCAE collector or controller) which req to protect external traffic and uses CertService's client to get it. CertService's client communicates with CertService via REST API over HTTPS, while CertService with CMPv2 server via CMP over HTTP. -.. image:: img/certservice_high_level.jpg +.. image:: resources/certservice_high_level.jpg :width: 855px :height: 178px :alt: Interaction between components diff --git a/docs/sections/img/certservice_high_level.jpg b/docs/sections/img/certservice_high_level.jpg deleted file mode 100644 index 11466983..00000000 Binary files a/docs/sections/img/certservice_high_level.jpg and /dev/null differ diff --git a/docs/sections/offeredapis.rst b/docs/sections/offeredapis.rst index fe5807a8..31e53bc5 100644 --- a/docs/sections/offeredapis.rst +++ b/docs/sections/offeredapis.rst @@ -8,4 +8,4 @@ Offered APIs AAF Cert Service Api -------------------- -.. openapi:: ../../certService/OpenAPI.yaml +.. openapi:: resources/OpenAPI.yaml diff --git a/docs/sections/openapi.yaml b/docs/sections/openapi.yaml deleted file mode 100644 index cee5a402..00000000 --- a/docs/sections/openapi.yaml +++ /dev/null @@ -1,158 +0,0 @@ -openapi: 3.0.1 -info: - title: CertService Documentation - description: Certification service API documentation - version: 1.0.0 -servers: - - url: http://localhost:8080 - description: Generated server url -tags: - - name: Actuator - description: Monitor and interact - externalDocs: - description: Spring Boot Actuator Web API Documentation - url: https://docs.spring.io/spring-boot/docs/current/actuator-api/html/ -paths: - /v1/certificate/{caName}: - get: - tags: - - CertificationService - summary: sign certificate - description: Web endpoint for requesting certificate signing. Used by system - components to gain certificate signed by CA. - operationId: signCertificate - parameters: - - name: caName - in: path - description: Name of certification authority that will sign CSR. - required: true - schema: - type: string - - name: CSR - in: header - description: Certificate signing request in form of PEM object encoded in - Base64 (with header and footer). - required: true - schema: - type: string - - name: PK - in: header - description: Private key in form of PEM object encoded in Base64 (with header - and footer). - required: true - schema: - type: string - responses: - "200": - description: certificate successfully signed - content: - application/json; charset=utf-8: - schema: - $ref: '#/components/schemas/CertificationModel' - "500": - description: something went wrong during connecting to cmp client - content: - application/json; charset=utf-8: - schema: - $ref: '#/components/schemas/ErrorResponseModel' - "404": - description: CA not found for given name - content: - application/json; charset=utf-8: - schema: - $ref: '#/components/schemas/ErrorResponseModel' - "400": - description: given CSR or/and PK is incorrect - content: - application/json; charset=utf-8: - schema: - $ref: '#/components/schemas/ErrorResponseModel' - /ready: - get: - tags: - - CertificationService - summary: check is container is ready - description: Web endpoint for checking if service is ready to be used. - operationId: checkReady - responses: - "200": - description: configuration is loaded and service is ready to use - content: - application/json; charset=utf-8: - schema: - type: string - "503": - description: configuration loading failed and service is unavailable - content: - application/json; charset=utf-8: - schema: - type: string - /reload: - get: - tags: - - CertificationService - summary: reload service configuration from file - description: Web endpoint for performing configuration reload. Used to reload - configuration file from file. - operationId: reloadConfiguration - responses: - "200": - description: configuration has been successfully reloaded - content: - application/json; charset=utf-8: - schema: - type: string - "500": - description: something went wrong during configuration loading - content: - application/json; charset=utf-8: - schema: - $ref: '#/components/schemas/ErrorResponseModel' - /actuator/health: - get: - tags: - - Actuator - summary: Actuator web endpoint 'health' - operationId: handle_0 - responses: - "200": - description: default response - content: {} - /actuator/health/**: - get: - tags: - - Actuator - summary: Actuator web endpoint 'health-path' - operationId: handle_1 - responses: - "200": - description: default response - content: {} - /actuator: - get: - tags: - - Actuator - summary: Actuator root web endpoint - operationId: links_2 - responses: - "200": - description: default response - content: {} -components: - schemas: - ErrorResponseModel: - type: object - properties: - errorMessage: - type: string - CertificationModel: - type: object - properties: - certificateChain: - type: array - items: - type: string - trustedCertificates: - type: array - items: - type: string diff --git a/docs/sections/resources/OpenAPI.yaml b/docs/sections/resources/OpenAPI.yaml new file mode 100644 index 00000000..cee5a402 --- /dev/null +++ b/docs/sections/resources/OpenAPI.yaml @@ -0,0 +1,158 @@ +openapi: 3.0.1 +info: + title: CertService Documentation + description: Certification service API documentation + version: 1.0.0 +servers: + - url: http://localhost:8080 + description: Generated server url +tags: + - name: Actuator + description: Monitor and interact + externalDocs: + description: Spring Boot Actuator Web API Documentation + url: https://docs.spring.io/spring-boot/docs/current/actuator-api/html/ +paths: + /v1/certificate/{caName}: + get: + tags: + - CertificationService + summary: sign certificate + description: Web endpoint for requesting certificate signing. Used by system + components to gain certificate signed by CA. + operationId: signCertificate + parameters: + - name: caName + in: path + description: Name of certification authority that will sign CSR. + required: true + schema: + type: string + - name: CSR + in: header + description: Certificate signing request in form of PEM object encoded in + Base64 (with header and footer). + required: true + schema: + type: string + - name: PK + in: header + description: Private key in form of PEM object encoded in Base64 (with header + and footer). + required: true + schema: + type: string + responses: + "200": + description: certificate successfully signed + content: + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/CertificationModel' + "500": + description: something went wrong during connecting to cmp client + content: + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/ErrorResponseModel' + "404": + description: CA not found for given name + content: + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/ErrorResponseModel' + "400": + description: given CSR or/and PK is incorrect + content: + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/ErrorResponseModel' + /ready: + get: + tags: + - CertificationService + summary: check is container is ready + description: Web endpoint for checking if service is ready to be used. + operationId: checkReady + responses: + "200": + description: configuration is loaded and service is ready to use + content: + application/json; charset=utf-8: + schema: + type: string + "503": + description: configuration loading failed and service is unavailable + content: + application/json; charset=utf-8: + schema: + type: string + /reload: + get: + tags: + - CertificationService + summary: reload service configuration from file + description: Web endpoint for performing configuration reload. Used to reload + configuration file from file. + operationId: reloadConfiguration + responses: + "200": + description: configuration has been successfully reloaded + content: + application/json; charset=utf-8: + schema: + type: string + "500": + description: something went wrong during configuration loading + content: + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/ErrorResponseModel' + /actuator/health: + get: + tags: + - Actuator + summary: Actuator web endpoint 'health' + operationId: handle_0 + responses: + "200": + description: default response + content: {} + /actuator/health/**: + get: + tags: + - Actuator + summary: Actuator web endpoint 'health-path' + operationId: handle_1 + responses: + "200": + description: default response + content: {} + /actuator: + get: + tags: + - Actuator + summary: Actuator root web endpoint + operationId: links_2 + responses: + "200": + description: default response + content: {} +components: + schemas: + ErrorResponseModel: + type: object + properties: + errorMessage: + type: string + CertificationModel: + type: object + properties: + certificateChain: + type: array + items: + type: string + trustedCertificates: + type: array + items: + type: string diff --git a/docs/sections/resources/certservice_high_level.jpg b/docs/sections/resources/certservice_high_level.jpg new file mode 100644 index 00000000..11466983 Binary files /dev/null and b/docs/sections/resources/certservice_high_level.jpg differ -- cgit 1.2.3-korg