-
Notifications
You must be signed in to change notification settings - Fork 0
/
api-calls.http
276 lines (198 loc) · 11.9 KB
/
api-calls.http
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
266
267
268
269
270
271
272
273
274
275
###
# /ssh enpoint - get xOpera's public key
###
# curl -X GET "http://localhost:8080/ssh/keys/public" -H "accept: application/json"
GET http://localhost:8080/ssh/keys/public
accept: application/json
###
# /blueprint endpoint
###
### Upload new blueprint
# curl -X POST "http://localhost:8080/blueprint?revision_msg=revision_msg&blueprint_name=blueprint_name&aadm_id=aadm_id&username=username&project_domain=my_project_domain" -H "accept: application/json" -H "X-API-Key: test" -H "Content-Type: multipart/form-data" -F "CSAR=@CSAR-test.zip;type=application/zip"
POST http://localhost:8080/blueprint?revision_msg=revision_msg&blueprint_name=blueprint_name&aadm_id=aadm_id&username=username&project_domain=my_project_domain
accept: application/json
X-API-Key: test
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="CSAR"; filename="CSAR-test.zip"
< CSAR-test.zip
--WebAppBoundary--
### Fetch blueprints by username
# curl -X GET "http://localhost:8080/blueprint?username=username" -H "accept: application/json" -H "X-API-Key: test"
GET http://localhost:8080/blueprint?username=username
accept: application/json
X-API-Key: test
### Fetch blueprints by project_domain
# curl -X GET "http://localhost:8080/blueprint?project_domain=project_domain" -H "accept: application/json" -H "X-API-Key: test"
GET http://localhost:8080/blueprint?project_domain=project_domain
accept: application/json
X-API-Key: test
### Fetch blueprints by both username and project_domain
# curl -X GET "http://localhost:8080/blueprint?username=username&project_domain=project_domain" -H "accept: application/json" -H "X-API-Key: test"
GET http://localhost:8080/blueprint?username=username&project_domain=project_domain
accept: application/json
X-API-Key: test
### Upload another version of existing blueprint
# curl -X POST "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423?revision_msg=Upgraded%20version" -H "accept: application/json" -H "X-API-Key: test" -H "Content-Type: multipart/form-data" -F "CSAR=@CSAR-test.zip;type=application/zip"
POST http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423?revision_msg=Upgraded%20version
accept: application/json
X-API-Key: test
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="CSAR"; filename="CSAR-test.zip"
< CSAR-test.zip
--WebAppBoundary--
### delete entire blueprint
# curl -X DELETE "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423?force=false" -H "accept: application/json" -H "X-API-Key: test"
DELETE http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423?force=false
accept: application/json
X-API-Key: test
### delete a blueprint version
# curl -X DELETE "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/version/v2.0?force=false" -H "accept: application/json" -H "X-API-Key: test"
DELETE http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/version/v2.0?force=false
accept: application/json
X-API-Key: test
### get list of users with access to blueprint
# curl -X GET "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/user" -H "accept: application/json" -H "X-API-Key: test"
GET http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/user
accept: application/json
X-API-Key: test
### grant user an access to blueprint
# curl -X POST "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/user/my_user" -H "accept: application/json" -H "X-API-Key: test" -d ""
POST http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/user/my_user
accept: application/json
X-API-Key: test
Content-Type: application/x-www-form-urlencoded
### remove blueprint access from user
# curl -X DELETE "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/user/my_user" -H "accept: application/json" -H "X-API-Key: test"
DELETE http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/user/my_user
accept: application/json
X-API-Key: test
### Get blueprint meta (last blueprint version)
# curl -X GET "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/meta" -H "accept: application/json" -H "X-API-Key: test"
GET http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/meta
accept: application/json
X-API-Key: test
### Get blueprint meta of specific version
# curl -X GET "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/version/v2.0/meta" -H "accept: application/json" -H "X-API-Key: test"
GET http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/version/v2.0/meta
accept: application/json
X-API-Key: test
### Get blueprint name
# curl -X GET "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/name" -H "accept: application/json" -H "X-API-Key: test"
GET http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/name
accept: application/json
X-API-Key: test
### Update blueprint name
# curl -X POST "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/name?name=name" -H "accept: application/json" -H "X-API-Key: test" -d ""
POST http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/name?name=name
accept: application/json
X-API-Key: test
Content-Type: application/x-www-form-urlencoded
### Get list of deployments, created from blueprint
# curl -X GET "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/deployments" -H "accept: application/json" -H "X-API-Key: test"
GET http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/deployments
accept: application/json
X-API-Key: test
### retrieve history of transactions (update, delete) to repository with blueprint
# curl -X GET "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/git_history" -H "accept: application/json" -H "X-API-Key: test"
GET http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/git_history
accept: application/json
X-API-Key: test
### validate last version of existing blueprint
# curl -X PUT "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/validate" -H "accept: application/json" -H "X-API-Key: test" -H "Content-Type: multipart/form-data" -F "inputs_file=@inputs.yaml;type=application/x-yaml"
POST http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/validate
accept: application/json
X-API-Key: test
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="inputs_file"; filename="inputs.yaml"
< inputs.yaml
--WebAppBoundary--
### validate specific version of existing blueprint
# curl -X PUT "http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/version/v1.0/validate" -H "accept: application/json" -H "X-API-Key: test" -H "Content-Type: multipart/form-data" -F "inputs_file=@inputs.yaml;type=application/x-yaml"
POST http://localhost:8080/blueprint/854cc717-fd02-4c51-a35d-7223f9fc8423/version/v1.0/validate
accept: application/json
X-API-Key: test
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="inputs_file"; filename="inputs.yaml"
< inputs.yaml
--WebAppBoundary--
### validate new blueprint
# curl -X PUT "http://localhost:8080/blueprint/validate" -H "accept: application/json" -H "X-API-Key: test" -H "Content-Type: multipart/form-data" -F "CSAR=@CSAR-test.zip;type=application/zip" -F "inputs_file=@inputs.yaml;type=application/x-yaml"
POST http://localhost:8080/blueprint/validate
accept: application/json
X-API-Key: test
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="CSAR"; filename="CSAR-test.zip"
< CSAR-test.zip
--WebAppBoundary
Content-Disposition: form-data; name="inputs_file"; filename="inputs.yaml"
< inputs.yaml
--WebAppBoundary--
###
# /deployment endpoint
###
### Initialize deployment and deploy
# curl -X POST "http://localhost:8080/deployment/deploy?blueprint_id=854cc717-fd02-4c51-a35d-7223f9fc8423&version_id=v2.0&deployment_label=deployment_lavel&workers=10" -H "accept: application/json" -H "X-API-Key: test" -H "Content-Type: multipart/form-data" -F "inputs_file=@inputs.yaml;type=application/x-yaml"
POST http://localhost:8080/deployment/deploy?blueprint_id=854cc717-fd02-4c51-a35d-7223f9fc8423&version_id=v2.0&deployment_label=deployment_lavel&workers=10
accept: application/json
X-API-Key: test
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="inputs_file"; filename="inputs.yaml"
< inputs.yaml
--WebAppBoundary--
### Check deployment status (last invocation)
# curl -X GET "http://localhost:8080/deployment/4a7b9983-dc27-4e43-b7b3-8b696a550fac/status" -H "accept: application/json" -H "X-API-Key: test"
GET http://localhost:8080/deployment/4a7b9983-dc27-4e43-b7b3-8b696a550fac/status
accept: application/json
X-API-Key: test
### Check deployment history (list of all invocations)
# curl -X GET "http://localhost:8080/deployment/4a7b9983-dc27-4e43-b7b3-8b696a550fac/history" -H "accept: application/json" -H "X-API-Key: test"
GET http://localhost:8080/deployment/4a7b9983-dc27-4e43-b7b3-8b696a550fac/history
accept: application/json
X-API-Key: test
### Continue deployment, possibly from clean-state
# curl -X POST "http://localhost:8080/deployment/854cc717-fd02-4c51-a35d-7223f9fc8423/deploy_continue?workers=10&clean_state=false" -H "accept: application/json" -H "X-API-Key: test" -H "Content-Type: multipart/form-data" -F "inputs_file=@inputs.yaml;type=application/x-yaml"
POST http://localhost:8080/deployment/854cc717-fd02-4c51-a35d-7223f9fc8423/deploy_continue?workers=10&clean_state=false
accept: application/json
X-API-Key: test
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="inputs_file"; filename="inputs.yaml"
< inputs.yaml
--WebAppBoundary--
### Calculate diff between current deployment and new blueprint version (with inputs)
# curl -X PUT "http://localhost:8080/deployment/4a7b9983-dc27-4e43-b7b3-8b696a550fac/diff?blueprint_id=854cc717-fd02-4c51-a35d-7223f9fc8423&version_id=v1.0" -H "accept: application/json" -H "X-API-Key: test" -H "Content-Type: multipart/form-data" -F "inputs_file=@inputs.yaml;type=application/x-yaml"
POST http://localhost:8080/deployment/4a7b9983-dc27-4e43-b7b3-8b696a550fac/diff?blueprint_id=854cc717-fd02-4c51-a35d-7223f9fc8423&version_id=v1.0
accept: application/json
X-API-Key: test
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="inputs_file"; filename="inputs.yaml"
< inputs.yaml
--WebAppBoundary--
### Update deployment with new blueprint
# curl -X POST "http://localhost:8080/deployment/4a7b9983-dc27-4e43-b7b3-8b696a550fac/update?blueprint_id=854cc717-fd02-4c51-a35d-7223f9fc8423&version_id=v1.0&workers=10" -H "accept: application/json" -H "X-API-Key: test" -H "Content-Type: multipart/form-data" -F "inputs_file=@inputs.yaml;type=application/x-yaml"
POST http://localhost:8080/deployment/4a7b9983-dc27-4e43-b7b3-8b696a550fac/update?blueprint_id=854cc717-fd02-4c51-a35d-7223f9fc8423&version_id=v1.0&workers=10
accept: application/json
X-API-Key: test
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="inputs_file"; filename="inputs.yaml"
< inputs.yaml
--WebAppBoundary--
### Undeploy deployment
# curl -X POST "http://localhost:8080/deployment/4a7b9983-dc27-4e43-b7b3-8b696a550fac/undeploy?workers=10" -H "accept: application/json" -H "X-API-Key: test" -H "Content-Type: multipart/form-data" -F "inputs_file=@inputs.yaml;type=application/x-yaml"
POST http://localhost:8080/deployment/4a7b9983-dc27-4e43-b7b3-8b696a550fac/undeploy?workers=10
accept: application/json
X-API-Key: test
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="inputs_file"; filename="inputs.yaml"
< inputs.yaml
--WebAppBoundary--
###