Skip to content

Commit 4ed7847

Browse files
committed
spec added git-material
1 parent 2263ace commit 4ed7847

File tree

1 file changed

+324
-0
lines changed

1 file changed

+324
-0
lines changed
Lines changed: 324 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,324 @@
1+
openapi: 3.0.3
2+
info:
3+
version: 1.0.0
4+
title: Devtron Orchestrator Application Material Management API
5+
description: |
6+
API specifications for Devtron orchestrator application material management endpoints.
7+
This includes creating and updating git materials for applications, managing git repositories,
8+
checkout paths, and filter patterns for CI/CD pipelines.
9+
termsOfService: https://devtron.ai/terms/
10+
contact:
11+
name: Devtron Support
12+
13+
url: https://devtron.ai/support
14+
license:
15+
name: Apache 2.0
16+
url: https://www.apache.org/licenses/LICENSE-2.0.html
17+
18+
servers:
19+
- url: /orchestrator
20+
description: Devtron Orchestrator API Server
21+
22+
components:
23+
securitySchemes:
24+
bearerAuth:
25+
type: http
26+
scheme: bearer
27+
bearerFormat: JWT
28+
description: JWT token for authentication
29+
30+
schemas:
31+
ApiResponse:
32+
type: object
33+
properties:
34+
code:
35+
type: integer
36+
description: HTTP status code
37+
status:
38+
type: string
39+
description: Status message
40+
result:
41+
type: object
42+
description: Response result data
43+
44+
ErrorResponse:
45+
type: object
46+
properties:
47+
code:
48+
type: integer
49+
description: Error code
50+
status:
51+
type: string
52+
description: Error status
53+
errors:
54+
type: array
55+
items:
56+
type: string
57+
description: List of error messages
58+
59+
GitMaterial:
60+
type: object
61+
required:
62+
- url
63+
- gitProviderId
64+
- checkoutPath
65+
properties:
66+
id:
67+
type: integer
68+
description: Material ID (for updates)
69+
example: 456
70+
name:
71+
type: string
72+
description: Material name (auto-generated if not provided)
73+
example: "my-app-material"
74+
url:
75+
type: string
76+
description: Git repository URL
77+
example: "https://github.com/user/repo.git"
78+
gitProviderId:
79+
type: integer
80+
description: Git provider ID
81+
example: 1
82+
minimum: 1
83+
checkoutPath:
84+
type: string
85+
description: Path where code will be checked out
86+
example: "./"
87+
default: "./"
88+
fetchSubmodules:
89+
type: boolean
90+
description: Whether to fetch git submodules
91+
example: false
92+
default: false
93+
filterPattern:
94+
type: array
95+
items:
96+
type: string
97+
description: File patterns to include/exclude during build
98+
example: ["*.yaml", "!test/*"]
99+
100+
CreateMaterialRequest:
101+
type: object
102+
required:
103+
- appId
104+
- material
105+
properties:
106+
appId:
107+
type: integer
108+
description: Application ID
109+
example: 123
110+
minimum: 1
111+
material:
112+
type: array
113+
items:
114+
$ref: '#/components/schemas/GitMaterial'
115+
description: Array of git materials to create
116+
minItems: 1
117+
118+
UpdateMaterialRequest:
119+
type: object
120+
required:
121+
- appId
122+
- material
123+
properties:
124+
appId:
125+
type: integer
126+
description: Application ID
127+
example: 123
128+
minimum: 1
129+
material:
130+
$ref: '#/components/schemas/GitMaterial'
131+
description: Git material to update
132+
133+
MaterialResponse:
134+
type: object
135+
properties:
136+
id:
137+
type: integer
138+
description: Material ID
139+
name:
140+
type: string
141+
description: Material name
142+
url:
143+
type: string
144+
description: Git repository URL
145+
gitProviderId:
146+
type: integer
147+
description: Git provider ID
148+
checkoutPath:
149+
type: string
150+
description: Checkout path
151+
fetchSubmodules:
152+
type: boolean
153+
description: Whether submodules are fetched
154+
filterPattern:
155+
type: array
156+
items:
157+
type: string
158+
description: Filter patterns
159+
active:
160+
type: boolean
161+
description: Whether material is active
162+
createdOn:
163+
type: string
164+
format: date-time
165+
description: Creation timestamp
166+
createdBy:
167+
type: integer
168+
description: ID of user who created the material
169+
170+
security:
171+
- bearerAuth: []
172+
173+
paths:
174+
/app/material:
175+
post:
176+
tags:
177+
- Application Material Management
178+
summary: Create git materials for application
179+
description: |
180+
Creates one or more git materials for an application. Git materials define the source code repositories
181+
that will be used for CI/CD pipelines. Each material specifies a git repository URL, checkout path,
182+
and optional filter patterns.
183+
operationId: createMaterial
184+
requestBody:
185+
description: Material creation request
186+
required: true
187+
content:
188+
application/json:
189+
schema:
190+
$ref: '#/components/schemas/CreateMaterialRequest'
191+
examples:
192+
single_material:
193+
summary: Single material example
194+
value:
195+
appId: 123
196+
material:
197+
- url: "https://github.com/user/repo.git"
198+
checkoutPath: "./"
199+
gitProviderId: 1
200+
fetchSubmodules: false
201+
filterPattern: ["*.yaml", "!test/*"]
202+
multiple_materials:
203+
summary: Multiple materials example
204+
value:
205+
appId: 123
206+
material:
207+
- url: "https://github.com/user/frontend.git"
208+
checkoutPath: "./frontend"
209+
gitProviderId: 1
210+
fetchSubmodules: false
211+
filterPattern: ["src/**", "!src/test/**"]
212+
- url: "https://github.com/user/backend.git"
213+
checkoutPath: "./backend"
214+
gitProviderId: 1
215+
fetchSubmodules: true
216+
filterPattern: ["*.go", "!*_test.go"]
217+
responses:
218+
'200':
219+
description: Materials created successfully
220+
content:
221+
application/json:
222+
schema:
223+
allOf:
224+
- $ref: '#/components/schemas/ApiResponse'
225+
- type: object
226+
properties:
227+
result:
228+
type: array
229+
items:
230+
$ref: '#/components/schemas/MaterialResponse'
231+
'400':
232+
description: Invalid request format or validation error
233+
content:
234+
application/json:
235+
schema:
236+
$ref: '#/components/schemas/ErrorResponse'
237+
'401':
238+
description: Unauthorized
239+
content:
240+
application/json:
241+
schema:
242+
$ref: '#/components/schemas/ErrorResponse'
243+
'403':
244+
description: Forbidden - insufficient permissions
245+
content:
246+
application/json:
247+
schema:
248+
$ref: '#/components/schemas/ErrorResponse'
249+
'500':
250+
description: Internal server error
251+
content:
252+
application/json:
253+
schema:
254+
$ref: '#/components/schemas/ErrorResponse'
255+
256+
put:
257+
tags:
258+
- Application Material Management
259+
summary: Update git material for application
260+
description: |
261+
Updates an existing git material for an application. This allows modifying the git repository URL,
262+
checkout path, filter patterns, and other material properties.
263+
operationId: updateMaterial
264+
requestBody:
265+
description: Material update request
266+
required: true
267+
content:
268+
application/json:
269+
schema:
270+
$ref: '#/components/schemas/UpdateMaterialRequest'
271+
examples:
272+
update_material:
273+
summary: Update material example
274+
value:
275+
appId: 123
276+
material:
277+
id: 456
278+
url: "https://github.com/user/updated-repo.git"
279+
checkoutPath: "./src"
280+
gitProviderId: 1
281+
fetchSubmodules: true
282+
filterPattern: ["src/**", "!src/test/**"]
283+
responses:
284+
'200':
285+
description: Material updated successfully
286+
content:
287+
application/json:
288+
schema:
289+
allOf:
290+
- $ref: '#/components/schemas/ApiResponse'
291+
- type: object
292+
properties:
293+
result:
294+
$ref: '#/components/schemas/MaterialResponse'
295+
'400':
296+
description: Invalid request format or validation error
297+
content:
298+
application/json:
299+
schema:
300+
$ref: '#/components/schemas/ErrorResponse'
301+
'401':
302+
description: Unauthorized
303+
content:
304+
application/json:
305+
schema:
306+
$ref: '#/components/schemas/ErrorResponse'
307+
'403':
308+
description: Forbidden - insufficient permissions
309+
content:
310+
application/json:
311+
schema:
312+
$ref: '#/components/schemas/ErrorResponse'
313+
'404':
314+
description: Material not found
315+
content:
316+
application/json:
317+
schema:
318+
$ref: '#/components/schemas/ErrorResponse'
319+
'500':
320+
description: Internal server error
321+
content:
322+
application/json:
323+
schema:
324+
$ref: '#/components/schemas/ErrorResponse'

0 commit comments

Comments
 (0)