cee5a402c6e73d338d62ac6cb050d14f3e40133d
[oom/platform/cert-service.git] / docs / sections / resources / OpenAPI.yaml
1 openapi: 3.0.1
2 info:
3   title: CertService Documentation
4   description: Certification service API documentation
5   version: 1.0.0
6 servers:
7   - url: http://localhost:8080
8     description: Generated server url
9 tags:
10   - name: Actuator
11     description: Monitor and interact
12     externalDocs:
13       description: Spring Boot Actuator Web API Documentation
14       url: https://docs.spring.io/spring-boot/docs/current/actuator-api/html/
15 paths:
16   /v1/certificate/{caName}:
17     get:
18       tags:
19         - CertificationService
20       summary: sign certificate
21       description: Web endpoint for requesting certificate signing. Used by system
22         components to gain certificate signed by CA.
23       operationId: signCertificate
24       parameters:
25         - name: caName
26           in: path
27           description: Name of certification authority that will sign CSR.
28           required: true
29           schema:
30             type: string
31         - name: CSR
32           in: header
33           description: Certificate signing request in form of PEM object encoded in
34             Base64 (with header and footer).
35           required: true
36           schema:
37             type: string
38         - name: PK
39           in: header
40           description: Private key in form of PEM object encoded in Base64 (with header
41             and footer).
42           required: true
43           schema:
44             type: string
45       responses:
46         "200":
47           description: certificate successfully signed
48           content:
49             application/json; charset=utf-8:
50               schema:
51                 $ref: '#/components/schemas/CertificationModel'
52         "500":
53           description: something went wrong during connecting to cmp client
54           content:
55             application/json; charset=utf-8:
56               schema:
57                 $ref: '#/components/schemas/ErrorResponseModel'
58         "404":
59           description: CA not found for given name
60           content:
61             application/json; charset=utf-8:
62               schema:
63                 $ref: '#/components/schemas/ErrorResponseModel'
64         "400":
65           description: given CSR or/and PK is incorrect
66           content:
67             application/json; charset=utf-8:
68               schema:
69                 $ref: '#/components/schemas/ErrorResponseModel'
70   /ready:
71     get:
72       tags:
73         - CertificationService
74       summary: check is container is ready
75       description: Web endpoint for checking if service is ready to be used.
76       operationId: checkReady
77       responses:
78         "200":
79           description: configuration is loaded and service is ready to use
80           content:
81             application/json; charset=utf-8:
82               schema:
83                 type: string
84         "503":
85           description: configuration loading failed and service is unavailable
86           content:
87             application/json; charset=utf-8:
88               schema:
89                 type: string
90   /reload:
91     get:
92       tags:
93         - CertificationService
94       summary: reload service configuration from file
95       description: Web endpoint for performing configuration reload. Used to reload
96         configuration file from file.
97       operationId: reloadConfiguration
98       responses:
99         "200":
100           description: configuration has been successfully reloaded
101           content:
102             application/json; charset=utf-8:
103               schema:
104                 type: string
105         "500":
106           description: something went wrong during configuration loading
107           content:
108             application/json; charset=utf-8:
109               schema:
110                 $ref: '#/components/schemas/ErrorResponseModel'
111   /actuator/health:
112     get:
113       tags:
114         - Actuator
115       summary: Actuator web endpoint 'health'
116       operationId: handle_0
117       responses:
118         "200":
119           description: default response
120           content: {}
121   /actuator/health/**:
122     get:
123       tags:
124         - Actuator
125       summary: Actuator web endpoint 'health-path'
126       operationId: handle_1
127       responses:
128         "200":
129           description: default response
130           content: {}
131   /actuator:
132     get:
133       tags:
134         - Actuator
135       summary: Actuator root web endpoint
136       operationId: links_2
137       responses:
138         "200":
139           description: default response
140           content: {}
141 components:
142   schemas:
143     ErrorResponseModel:
144       type: object
145       properties:
146         errorMessage:
147           type: string
148     CertificationModel:
149       type: object
150       properties:
151         certificateChain:
152           type: array
153           items:
154             type: string
155         trustedCertificates:
156           type: array
157           items:
158             type: string