-
Notifications
You must be signed in to change notification settings - Fork 1
/
openapi.yaml
265 lines (263 loc) · 7.52 KB
/
openapi.yaml
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
openapi: 3.0.1
info:
title: ASMP
description: Application Server Management Protocol server
contact:
email: [email protected]
license:
name: MIT
url: https://opensource.org/licenses/MIT
version: 1.0.0
externalDocs:
description: Find out more about ASMP
url: https://www.asmprotocol.org/
servers:
- url: https://swagger.asmprotocol.org/v1
- url: http://swagger.asmprotocol.org/v1
tags:
- name: change
description: Change related endpoints
- name: rollback
description: Rollback related endpoints
- name: status
description: Status related endpoints
paths:
/check:
post:
summary: Define a list of desired changes using abstract constraints. Server should process these constraints, check if they can be fulfilled and respond with the possible resolutions.
tags: ["change"]
operationId: check
requestBody:
description: Check request
content:
application/json:
schema:
$ref: '#/components/schemas/CheckRequest'
required: true
responses:
200:
description: Response showing the server's resolution to the check request
content:
application/json:
schema:
$ref: '#/components/schemas/CheckResponse'
405:
description: Invalid input
content: {}
security:
- asmp_auth: []
/change:
post:
summary: Request a specific change for one or multiple components as previously checked in a /check request
tags: ["change"]
operationId: change
requestBody:
description: Request a specific change
content:
application/json:
schema:
$ref: '#/components/schemas/ChangeRequest'
required: true
responses:
200:
description: Response providing the change ID
content:
application/json:
schema:
$ref: '#/components/schemas/ChangeResponse'
405:
description: Invalid input
content: {}
security:
- asmp_auth: []
/rollback:
post:
summary: Rollback a specific change set
tags: ["rollback"]
operationId: rollback
requestBody:
description: Define the changeset that should be rolled back
content:
application/json:
schema:
$ref: '#/components/schemas/RollbackRequest'
required: true
responses:
200:
description: Response providing the rollback ID
content:
application/json:
schema:
$ref: '#/components/schemas/ChangeResponse'
405:
description: Invalid input
content: {}
security:
- asmp_auth: []
/status/{id}:
get:
summary: Get the current status for a given request ID
tags: ["status"]
operationId: status
parameters:
- in: path
name: id
schema:
type: string
format: 'uuid'
example: 'e38443a5-e6cb-4297-98cc-28eced0d8e7e'
required: true
description: UUID of the change to get the status from
responses:
200:
description: Response describing the current change status
content:
application/json:
schema:
$ref: '#/components/schemas/StatusResponse'
405:
description: Invalid input
content: {}
security:
- asmp_auth: []
components:
schemas:
CheckRequest:
type: object
properties:
components:
type: array
items:
$ref: '#/components/schemas/ComponentGroup'
RollbackRequest:
type: object
required:
- id
properties:
callback:
type: string
format: uri
description: Callback URL being called once the request has been processed
id:
type: string
format: uuid
example: 'e38443a5-e6cb-4297-98cc-28eced0d8e7e'
ChangeRequest:
type: object
required:
- components
properties:
callback:
type: string
format: uri
description: Callback URL being called once the request has been processed
components:
type: array
items:
$ref: '#/components/schemas/ComponentChange'
CheckResponse:
type: object
properties:
fulfillable:
type: boolean
components:
type: array
items:
$ref: '#/components/schemas/ComponentChange'
example: |
{
fulfillable: true,
components: [
{
name: 'PHP',
value: '7.2.9',
}
]
}
ComponentGroup:
type: array
description: Array of component change requests. A change request for a component group can be fufilled if ANY of the individual requests can be fulfilled. The order of the items within the component group MUST be followed during processing, using the first fulfillable request.
items:
$ref: '#/components/schemas/ConstraintGroup'
minItems: 1
ComponentChange:
required:
- name
- value
type: object
properties:
name:
type: string
description: component name according to reserved component names, see asmp.io
example: PHP
value:
type: string
description: Best value for the requested constraint, determined by the server
ConstraintGroup:
required:
- name
- constraint
type: object
properties:
name:
type: string
description: component name according to reserved component names, see asmp.io
example: PHP
constraints:
description: Array of constraints for the given component. A change request can be fulfilled if ALL of the contraints defined in the array can be fulfilled.
type: array
items:
$ref: '#/components/schemas/Constraint'
Constraint:
type: object
description: Defining a component contraint using an operator -> value property. A constraint can only hold one property.
properties:
'>':
type: string
description: Greater-than constraint
'<':
type: string
description: Smaller-than constraint
'=':
type: string
description: Exact-match constraint
'!=':
type: string
description: Must-not-match constraint
'<=':
type: string
description: Smaller-than-or-equal constraint
'>=':
type: string
description: Larger-than-or-equal constraint
maxProperties: 1
ChangeResponse:
type: object
properties:
message:
type: string
id:
type: string
format: uuid
example: 'e38443a5-e6cb-4297-98cc-28eced0d8e7e'
StatusResponse:
type: object
properties:
code:
$ref: '#/components/schemas/ChangeStatusCode'
message:
type: string
ChangeStatusCode:
type: integer
enum: [202,200,422,500]
description: >
Change Status Code:
* `202` - Change is pending
* `200` - Change has been completed
* `422` - The requested changeset can not be fulfilled
* `500` - An error occured
securitySchemes:
asmp_auth:
type: apiKey
name: X-API-KEY
in: header