-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi-project-component-v0.yaml
More file actions
227 lines (224 loc) · 6.62 KB
/
api-project-component-v0.yaml
File metadata and controls
227 lines (224 loc) · 6.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
openapi: 3.0.3
info:
title: ODS API Server
description: API documentation for ODS (Open DevStack) API Service
contact:
name: ODS Team
version: v0.0.1
servers:
- url: http://{baseurl}/api/pub/v0
variables:
baseurl:
default: localhost:8080
description: Development environment
tags:
- name: Project Components
description: API for managing project components
paths:
/projects/{projectId}/components/:
post:
tags:
- Project Components
summary: Create a component in a project
operationId: createProjectComponent
description: Retrieves information about a specific component
parameters:
- name: projectId
in: path
required: true
description: Project key
schema:
type: string
requestBody:
description: Component data
content:
application/json:
schema:
$ref: '#/components/schemas/CreateComponentRequest'
responses:
'200':
description: OK
headers:
Location:
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/CreateComponentResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/CreateComponentResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
'403':
description: Forbidden
'404':
description: Endpoint not found / Project not found / Product not found
content:
application/json:
schema:
$ref: '#/components/schemas/CreateComponentResponse'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/CreateComponentResponse'
/projects/{projectId}/components/{componentId}:
get:
tags:
- Project Components
summary: Get component information
operationId: getProjectComponent
description: Retrieves information about a specific component
parameters:
- name: projectId
in: path
required: true
description: Project key
schema:
type: string
- name: componentId
in: path
required: true
description: Component id
schema:
type: string
format: uuid
responses:
'200':
description: Component information
content:
application/json:
schema:
$ref: '#/components/schemas/Component'
components:
securitySchemes:
basicAuth:
type: http
scheme: basic
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
responses:
UnauthorizedError:
description: Authentication information is missing or invalid
headers:
WWW_Authenticate:
schema:
type: string
schemas:
Component:
type: object
x-class-extra-annotation: |
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)
required:
- params
properties:
id:
type: string
description: Component ID
name:
type: string
description: Name of the component
productDescription:
type: string
description: Description of the product
productName:
type: string
description: Name of the product
productId:
type: string
description: Product ID
environment:
$ref: '#/components/schemas/EnvironmentsTypeDTO'
description: Environment
status:
$ref: '#/components/schemas/EnvironmentsStatusDTO'
description: Status of the component
resultTraceback:
type: object
nullable: true
description: Traceback information in case of error
x-field-extra-annotation: |
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY)
repositoryURL:
type: string
description: URL of the repository (for ODS products)
params:
type: object
description: Additional parameters (key-value pairs)
additionalProperties: true
component-type:
type: string
description: Type of component (ods|awx)
CreateComponentResponse:
type: object
required:
- timestamp
- httpStatus
- errorKey
- message
- path
properties:
timestamp:
type: integer
format: int64
httpStatus:
type: string
errorKey:
type: string
error:
type: string
message:
type: string
path:
type: string
CreateComponentRequest:
type: object
required:
- name
- productId
- params
properties:
name:
type: string
description: Component name
minLength: 2
maxLength: 52
pattern: "^[a-z]+(-?[a-z0-9]+)*$"
x-field-extra-annotation: |
@Size(min=2, message = "The component name must contain more than 1 character.")
@Size(max=52, message = "The component name must contain less than 53 characters.")
@Pattern(regexp = "^[a-z]+(-?[a-z0-9]+)*$", message = "Only lowercase letters and numbers are allowed (example: componentname8), with optional dashes in between (example: my-component). The first character must be a letter.")
productId:
type: string
description: Product id
registerOnly:
type: boolean
description: Register only flag (no provisioning)
default: false
params:
type: object
description: Additional parameters (key-value pairs)
additionalProperties: true
EnvironmentsTypeDTO:
type: string
enum:
- DEV
- QA
- PROD
EnvironmentsStatusDTO:
type: string
enum:
- READY
- RUNNING
- FAILED
- DELETING
- DELETED
- UNKNOWN