Skip to content

Commit c2757d0

Browse files
committed
f
1 parent 5707f14 commit c2757d0

File tree

4 files changed

+567
-98
lines changed

4 files changed

+567
-98
lines changed

specs/apiToken_api-spec.yaml

Lines changed: 154 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,76 @@ info:
33
version: 1.0.0
44
title: Devtron Labs
55
paths:
6-
/orchestrator/api-token:
6+
/api-token:
77
get:
88
description: Get All active Api Tokens
99
responses:
1010
"200":
11-
description: Successfully fetched active API tokens links
11+
description: Successfully fetched active API tokens
1212
content:
1313
application/json:
1414
schema:
1515
type: array
1616
items:
1717
$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"
1836
post:
1937
description: Create api-token
2038
requestBody:
2139
required: true
2240
content:
2341
application/json:
2442
schema:
25-
type: array
26-
items:
27-
$ref: "#/components/schemas/CreateApiTokenRequest"
43+
$ref: "#/components/schemas/CreateApiTokenRequest"
2844
responses:
2945
"200":
3046
description: Api-token creation response
3147
content:
3248
application/json:
3349
schema:
3450
$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}:
3676
put:
3777
description: Update api-token
3878
parameters:
@@ -56,6 +96,30 @@ paths:
5696
application/json:
5797
schema:
5898
$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"
59123
delete:
60124
description: Delete api-token
61125
parameters:
@@ -73,6 +137,76 @@ paths:
73137
application/json:
74138
schema:
75139
$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"
76210
components:
77211
schemas:
78212
ApiToken:
@@ -127,6 +261,8 @@ components:
127261
example: "some date"
128262
CreateApiTokenRequest:
129263
type: object
264+
required:
265+
- name
130266
properties:
131267
name:
132268
type: string
@@ -192,4 +328,15 @@ components:
192328
token:
193329
type: string
194330
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

Comments
 (0)