doku
173 строки · 4.5 Кб
1openapi: 3.0.0
2info:
3title: API Keys Service
4description: This service manages API keys through GET, POST, and DELETE operations.
5version: "0.0.2"
6
7servers:
8- url: https://127.0.0.1:9044/
9
10paths:
11/api/connections:
12post:
13summary: Create a new connection
14operationId: createConnection
15tags:
16- Connection
17security:
18- ApiKeyAuth: []
19requestBody:
20required: true
21content:
22application/json:
23schema:
24$ref: '#/components/schemas/ConnectionRequest'
25responses:
26'201':
27description: Connection created
28content:
29application/json:
30schema:
31$ref: '#/components/schemas/json201Response'
32delete:
33summary: Delete a connection
34operationId: deleteConnection
35tags:
36- Connection
37security:
38- ApiKeyAuth: []
39responses:
40'200':
41description: Connection deleted
42content:
43application/json:
44schema:
45$ref: '#/components/schemas/json201Response'
46/api/keys:
47get:
48summary: Get a list of API keys
49operationId: getApiKeys
50tags:
51- API Key
52security:
53- ApiKeyAuth: []
54requestBody:
55required: true
56content:
57application/json:
58schema:
59$ref: '#/components/schemas/APIKeyRequest'
60responses:
61'200':
62description: A list of API keys
63content:
64application/json:
65schema:
66$ref: '#/components/schemas/json201Response'
67post:
68summary: Create a new API key
69operationId: createApiKey
70tags:
71- API Key
72security:
73- ApiKeyAuth: []
74requestBody:
75required: true
76content:
77application/json:
78schema:
79$ref: '#/components/schemas/APIKeyRequest'
80responses:
81'201':
82description: API key created
83content:
84application/json:
85schema:
86$ref: '#/components/schemas/json201Response'
87delete:
88summary: Delete an API key
89operationId: deleteApiKey
90tags:
91- API Key
92security:
93- ApiKeyAuth: []
94requestBody:
95required: true
96content:
97application/json:
98schema:
99$ref: '#/components/schemas/APIKeyRequest'
100responses:
101'200':
102description: API key deleted
103content:
104application/json:
105schema:
106$ref: '#/components/schemas/json201Response'
107
108components:
109schemas:
110APIKeyRequest:
111type: object
112required:
113- name
114properties:
115name:
116type: string
117description: Name of the API key to be created or deleted. Example - `BIGDADDY`
118ConnectionRequest:
119type: object
120required:
121- Platform
122- MetricsUrl
123- LogsUrl
124- MetricsUsername
125- LogsUsername
126- ApiKey
127properties:
128Platform:
129type: string
130description: Name of the Observability Platform. Can be one of the following - `grafana`, `newrelic`, `datadog`, `dynatrace` and `signoz`
131MetricsUrl:
132type: string
133description: URL of the metrics endpoint of the Observability Platform. Example - `https://api.datadoghq.com/api/v1/query`
134LogsUrl:
135type: string
136description: URL of the logs endpoint of the Observability Platform. Example - `https://api.datadoghq.com/api/v1/query`
137MetricsUsername:
138type: string
139description: Username for the metrics endpoint of the Observability Platform. Only required when Platform is passed as `grafana`.
140LogsUsername:
141type: string
142description: Username for the logs endpoint of the Observability Platform. Only required when Platform is passed as `grafana`.
143ApiKey:
144type: string
145description: API Key for the Observability Platform. Example - `glc*******`
146
147json201Response:
148type: object
149required:
150- status
151- message
152properties:
153status:
154type: integer
155message:
156type: string
157
158json401Response:
159type: object
160required:
161- status
162- message
163properties:
164status:
165type: integer
166message:
167type: string
168
169securitySchemes:
170ApiKeyAuth:
171type: apiKey
172in: header
173name: Authorization