3
3
version : 1.0.0
4
4
title : Devtron Labs
5
5
paths :
6
- /orchestrator/ api-token :
6
+ /api-token :
7
7
get :
8
8
description : Get All active Api Tokens
9
9
responses :
10
10
" 200 " :
11
- description : Successfully fetched active API tokens links
11
+ description : Successfully fetched active API tokens
12
12
content :
13
13
application/json :
14
14
schema :
15
15
type : array
16
16
items :
17
17
$ref : " #/components/schemas/ApiToken"
18
+ " 401 " :
19
+ description : Unauthorized
20
+ content :
21
+ application/json :
22
+ schema :
23
+ $ref : " #/components/schemas/ErrorResponse"
24
+ " 403 " :
25
+ description : Forbidden
26
+ content :
27
+ application/json :
28
+ schema :
29
+ $ref : " #/components/schemas/ErrorResponse"
30
+ " 500 " :
31
+ description : Internal Server Error
32
+ content :
33
+ application/json :
34
+ schema :
35
+ $ref : " #/components/schemas/ErrorResponse"
18
36
post :
19
37
description : Create api-token
20
38
requestBody :
21
39
required : true
22
40
content :
23
41
application/json :
24
42
schema :
25
- type : array
26
- items :
27
- $ref : " #/components/schemas/CreateApiTokenRequest"
43
+ $ref : " #/components/schemas/CreateApiTokenRequest"
28
44
responses :
29
45
" 200 " :
30
46
description : Api-token creation response
31
47
content :
32
48
application/json :
33
49
schema :
34
50
$ref : " #/components/schemas/CreateApiTokenResponse"
35
- /orchestrator/api-token/{id} :
51
+ " 400 " :
52
+ description : Bad Request
53
+ content :
54
+ application/json :
55
+ schema :
56
+ $ref : " #/components/schemas/ErrorResponse"
57
+ " 401 " :
58
+ description : Unauthorized
59
+ content :
60
+ application/json :
61
+ schema :
62
+ $ref : " #/components/schemas/ErrorResponse"
63
+ " 403 " :
64
+ description : Forbidden
65
+ content :
66
+ application/json :
67
+ schema :
68
+ $ref : " #/components/schemas/ErrorResponse"
69
+ " 500 " :
70
+ description : Internal Server Error
71
+ content :
72
+ application/json :
73
+ schema :
74
+ $ref : " #/components/schemas/ErrorResponse"
75
+ /api-token/{id} :
36
76
put :
37
77
description : Update api-token
38
78
parameters :
@@ -56,6 +96,30 @@ paths:
56
96
application/json :
57
97
schema :
58
98
$ref : " #/components/schemas/UpdateApiTokenResponse"
99
+ " 400 " :
100
+ description : Bad Request
101
+ content :
102
+ application/json :
103
+ schema :
104
+ $ref : " #/components/schemas/ErrorResponse"
105
+ " 401 " :
106
+ description : Unauthorized
107
+ content :
108
+ application/json :
109
+ schema :
110
+ $ref : " #/components/schemas/ErrorResponse"
111
+ " 403 " :
112
+ description : Forbidden
113
+ content :
114
+ application/json :
115
+ schema :
116
+ $ref : " #/components/schemas/ErrorResponse"
117
+ " 500 " :
118
+ description : Internal Server Error
119
+ content :
120
+ application/json :
121
+ schema :
122
+ $ref : " #/components/schemas/ErrorResponse"
59
123
delete :
60
124
description : Delete api-token
61
125
parameters :
@@ -73,6 +137,76 @@ paths:
73
137
application/json :
74
138
schema :
75
139
$ref : " #/components/schemas/ActionResponse"
140
+ " 400 " :
141
+ description : Bad Request
142
+ content :
143
+ application/json :
144
+ schema :
145
+ $ref : " #/components/schemas/ErrorResponse"
146
+ " 401 " :
147
+ description : Unauthorized
148
+ content :
149
+ application/json :
150
+ schema :
151
+ $ref : " #/components/schemas/ErrorResponse"
152
+ " 403 " :
153
+ description : Forbidden
154
+ content :
155
+ application/json :
156
+ schema :
157
+ $ref : " #/components/schemas/ErrorResponse"
158
+ " 500 " :
159
+ description : Internal Server Error
160
+ content :
161
+ application/json :
162
+ schema :
163
+ $ref : " #/components/schemas/ErrorResponse"
164
+ /api-token/webhook :
165
+ get :
166
+ description : Get all api tokens which have given permission
167
+ parameters :
168
+ - name : projectName
169
+ in : query
170
+ description : Project name
171
+ schema :
172
+ type : string
173
+ - name : environmentName
174
+ in : query
175
+ description : Environment name
176
+ schema :
177
+ type : string
178
+ - name : appName
179
+ in : query
180
+ description : Application name
181
+ schema :
182
+ type : string
183
+ responses :
184
+ " 200 " :
185
+ description : Successfully fetched API tokens for webhook
186
+ content :
187
+ application/json :
188
+ schema :
189
+ type : array
190
+ items :
191
+ $ref : " #/components/schemas/ApiToken"
192
+ " 401 " :
193
+ description : Unauthorized
194
+ content :
195
+ application/json :
196
+ schema :
197
+ $ref : " #/components/schemas/ErrorResponse"
198
+ " 403 " :
199
+ description : Forbidden
200
+ content :
201
+ application/json :
202
+ schema :
203
+ $ref : " #/components/schemas/ErrorResponse"
204
+ " 500 " :
205
+ description : Internal Server Error
206
+ content :
207
+ application/json :
208
+ schema :
209
+ $ref : " #/components/schemas/ErrorResponse"
76
210
components :
77
211
schemas :
78
212
ApiToken :
@@ -127,6 +261,8 @@ components:
127
261
example : " some date"
128
262
CreateApiTokenRequest :
129
263
type : object
264
+ required :
265
+ - name
130
266
properties :
131
267
name :
132
268
type : string
@@ -192,4 +328,15 @@ components:
192
328
token :
193
329
type : string
194
330
description : Token of that api-token
195
- example : " some token"
331
+ example : " some token"
332
+ ErrorResponse :
333
+ type : object
334
+ properties :
335
+ code :
336
+ type : integer
337
+ description : HTTP status code
338
+ example : 400
339
+ message :
340
+ type : string
341
+ description : Error message
342
+ example : " Bad Request"
0 commit comments