doku

Форк
0
/
openiapi.yml 
173 строки · 4.5 Кб
1
openapi: 3.0.0
2
info:
3
  title: API Keys Service
4
  description: This service manages API keys through GET, POST, and DELETE operations.
5
  version: "0.0.2"
6

7
servers:
8
  - url: https://127.0.0.1:9044/
9

10
paths:
11
  /api/connections:
12
    post:
13
      summary: Create a new connection
14
      operationId: createConnection
15
      tags:
16
        - Connection
17
      security:
18
        - ApiKeyAuth: []
19
      requestBody:
20
        required: true
21
        content:
22
          application/json:
23
            schema:
24
              $ref: '#/components/schemas/ConnectionRequest'
25
      responses:
26
        '201':
27
          description: Connection created
28
          content:
29
            application/json:
30
              schema:
31
                $ref: '#/components/schemas/json201Response'  
32
    delete:
33
      summary: Delete a connection
34
      operationId: deleteConnection
35
      tags:
36
        - Connection
37
      security:
38
        - ApiKeyAuth: []
39
      responses:
40
        '200':
41
          description: Connection deleted
42
          content:
43
            application/json:
44
              schema:
45
                $ref: '#/components/schemas/json201Response'
46
  /api/keys:
47
    get:
48
      summary: Get a list of API keys
49
      operationId: getApiKeys
50
      tags:
51
        - API Key
52
      security:
53
        - ApiKeyAuth: []
54
      requestBody:
55
        required: true
56
        content:
57
          application/json:
58
            schema:
59
              $ref: '#/components/schemas/APIKeyRequest'
60
      responses:
61
        '200':
62
          description: A list of API keys
63
          content:
64
            application/json:
65
              schema:
66
                $ref: '#/components/schemas/json201Response'
67
    post:
68
      summary: Create a new API key
69
      operationId: createApiKey
70
      tags:
71
        - API Key
72
      security:
73
        - ApiKeyAuth: []
74
      requestBody:
75
        required: true
76
        content:
77
          application/json:
78
            schema:
79
              $ref: '#/components/schemas/APIKeyRequest'
80
      responses:
81
        '201':
82
          description: API key created
83
          content:
84
            application/json:
85
              schema:
86
                $ref: '#/components/schemas/json201Response'  
87
    delete:
88
      summary: Delete an API key
89
      operationId: deleteApiKey
90
      tags:
91
        - API Key
92
      security:
93
        - ApiKeyAuth: []
94
      requestBody:
95
        required: true
96
        content:
97
          application/json:
98
            schema:
99
              $ref: '#/components/schemas/APIKeyRequest'
100
      responses:
101
        '200':
102
          description: API key deleted
103
          content:
104
            application/json:
105
              schema:
106
                $ref: '#/components/schemas/json201Response'
107

108
components:
109
  schemas:
110
    APIKeyRequest:
111
      type: object
112
      required:
113
        - name
114
      properties:
115
        name:
116
          type: string
117
          description: Name of the API key to be created or deleted. Example - `BIGDADDY`
118
    ConnectionRequest:
119
      type: object
120
      required:
121
        - Platform
122
        - MetricsUrl
123
        - LogsUrl
124
        - MetricsUsername
125
        - LogsUsername
126
        - ApiKey
127
      properties:
128
        Platform:
129
          type: string
130
          description: Name of the Observability Platform. Can be one of the following - `grafana`, `newrelic`, `datadog`, `dynatrace` and `signoz`
131
        MetricsUrl:
132
          type: string
133
          description: URL of the metrics endpoint of the Observability Platform. Example - `https://api.datadoghq.com/api/v1/query`
134
        LogsUrl:
135
          type: string
136
          description: URL of the logs endpoint of the Observability Platform. Example - `https://api.datadoghq.com/api/v1/query`
137
        MetricsUsername:
138
          type: string
139
          description: Username for the metrics endpoint of the Observability Platform. Only required when Platform is passed as `grafana`.
140
        LogsUsername:
141
          type: string
142
          description: Username for the logs endpoint of the Observability Platform. Only required when Platform is passed as `grafana`.
143
        ApiKey:
144
          type: string
145
          description: API Key for the Observability Platform. Example - `glc*******`
146

147
    json201Response:
148
      type: object
149
      required:
150
        - status
151
        - message
152
      properties:
153
        status:
154
          type: integer
155
        message:
156
          type: string
157
    
158
    json401Response:
159
      type: object
160
      required:
161
        - status
162
        - message
163
      properties:
164
        status:
165
          type: integer
166
        message:
167
          type: string
168
          
169
  securitySchemes:
170
    ApiKeyAuth:
171
      type: apiKey
172
      in: header
173
      name: Authorization

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.