blob: 31395a5bdb74d97074571357353b159880b9c142 [file] [log] [blame]
Lusheng Ji6553a132017-10-12 02:47:00 +00001---
2
3swagger: '2.0'
4
5info:
6 version: "4.1.0"
7 title: "deployment-handler API"
8 license:
9 name: "Apache 2.0"
10 url: "http://www.apache.org/licenses/LICENSE-2.0.html"
11 description: |
12 High-level API for deploying/undeploying composed DCAE services using Cloudify Manager.
13
14tags:
15 - name: "info"
16 description: "version and links"
17 - name: "dcae-deployments"
18 description: "operations on dcae-deployments"
19 - name: "policy"
20 description: "policy update API consumed by policy-handler and debug API to find policies on components"
21
22paths:
23 /:
24 get:
25 tags:
26 - "info"
27 description: Returns version information and links to API operations
28 produces:
29 - "application/json"
30 responses:
31
32 200:
33 description: Success
34 schema:
35 title: DispatcherInfo
36 type: object
37 properties:
38 apiVersion:
39 type: string
40 description: |
41 version of API supported by this server
42 serverVersion:
43 type: string
44 description: |
45 version of software running on this server
46 links:
47 type: object
48 description: |
49 Links to API resources
50 properties:
51 info:
52 type: string
53 description: |
54 path for the server information endpoint
55 events:
56 type: string
57 description: |
58 path for the events endpoint
59
60 /dcae-deployments:
61 get:
62 tags:
63 - "dcae-deployments"
64 description: |
65 List service deployments known to the orchestrator, optionally restricted to a single service type
66
67 parameters:
68 - name: serviceTypeId
69 description: |
70 Service type identifier for the type whose deployments are to be listed
71 type: string
72 in: query
73 required: false
74
75 responses:
76
77 200:
78 description: |
79 Success. (Note that if no matching deployments are found, the request is still a success; the
80 deployments array is empty in that case.)
81 schema:
82 $ref: "#/definitions/DCAEDeploymentsListResponse"
83
84 500:
85 description: |
86 Problem on the server side. See the message
87 in the response for more details.
88 schema:
89 $ref: "#/definitions/DCAEErrorResponse"
90 502:
91 description: |
92 Error reported to the dispatcher by a downstream system. See the message
93 in the response for more details.
94 schema:
95 $ref: "#/definitions/DCAEErrorResponse"
96
97 504:
98 description: |
99 Error communicating with a downstream system. See the message
100 in the response for more details.
101 schema:
102 $ref: "#/definitions/DCAEErrorResponse"
103
104 /dcae-deployments/{deploymentId}:
105 put:
106 tags:
107 - "dcae-deployments"
108 description: |
109 Request deployment of a DCAE service
110
111 consumes:
112 - application/json
113 produces:
114 - application/json
115
116 parameters:
117 - name: deploymentId
118 description: |
119 Unique deployment identifier assigned by the API client.
120 in: path
121 type: string
122 required: true
123
124 - name: body
125 in: body
126 schema:
127 $ref: "#/definitions/DCAEDeploymentRequest"
128 required: true
129
130 responses:
131
132 202:
133 description: |
134 Success: The content that was posted is valid, the dispatcher has
135 found the needed blueprint, created an instance of the topology in the orchestrator,
136 and started an installation workflow.
137 schema:
138 $ref: "#/definitions/DCAEDeploymentResponse"
139
140 400:
141 description: |
142 Bad request: See the message in the response for details.
143 schema:
144 $ref: "#/definitions/DCAEErrorResponse"
145
146 409:
147 description: |
148 A service with the specified deployment Id already exists. Using PUT to update the service is not a supported operation.
149 schema:
150 $ref: "#/definitions/DCAEErrorResponse"
151
152 415:
153 description: |
154 Bad request: The Content-Type header does not indicate that the content is
155 'application/json'
156 schema:
157 $ref: "#/definitions/DCAEErrorResponse"
158
159 500:
160 description: |
161 Problem on the server side. See the message
162 in the response for more details.
163 schema:
164 $ref: "#/definitions/DCAEErrorResponse"
165
166 502:
167 description: |
168 Error reported to the dispatcher by a downstream system. See the message
169 in the response for more details.
170 schema:
171 $ref: "#/definitions/DCAEErrorResponse"
172
173 504:
174 description: |
175 Error communicating with a downstream system. See the message
176 in the response for more details.
177 schema:
178 $ref: "#/definitions/DCAEErrorResponse"
179
180 delete:
181 tags:
182 - "dcae-deployments"
183 description: |
184 Uninstall the DCAE service and remove all associated data from the orchestrator.
185
186 parameters:
187 - name: deploymentId
188 description: |
189 Deployment identifier for the service to be uninstalled.
190 in: path
191 type: string
192 required: true
193
194 responses:
195
196 202:
197 description: |
198 Success: The dispatcher has initiated the uninstall operation.
199 schema:
200 $ref: "#/definitions/DCAEDeploymentResponse"
201
202 400:
203 description: |
204 Bad request: See the message in the response for details.
205 schema:
206 $ref: "#/definitions/DCAEErrorResponse"
207
208 500:
209 description: |
210 Problem on the server side. See the message
211 in the response for more details.
212 schema:
213 $ref: "#/definitions/DCAEErrorResponse"
214
215 502:
216 description: |
217 Error reported to the dispatcher by a downstream system. See the message
218 in the response for more details.
219 schema:
220 $ref: "#/definitions/DCAEErrorResponse"
221
222 504:
223 description: |
224 Error communicating with a downstream system. See the message
225 in the response for more details.
226 schema:
227 $ref: "#/definitions/DCAEErrorResponse"
228
229 /dcae-deployments/{deploymentId}/operation/{operationId}:
230 get:
231 tags:
232 - "dcae-deployments"
233 description: |
234 Get status of a deployment operation
235 parameters:
236 - name: deploymentId
237 in: path
238 type: string
239 required: true
240 - name: operationId
241 in: path
242 type: string
243 required: true
244
245 responses:
246
247 200:
248 description: Status information retrieved successfully
249 schema:
250 $ref: "#/definitions/DCAEOperationStatusResponse"
251
252 404:
253 description: The operation information does not exist (possibly because the service has been uninstalled and deleted).
254 schema:
255 $ref: "#/definitions/DCAEErrorResponse"
256
257 500:
258 description: |
259 Problem on the server side. See the message
260 in the response for more details.
261 schema:
262 $ref: "#/definitions/DCAEErrorResponse"
263
264 502:
265 description: |
266 Error reported to the dispatcher by a downstream system. See the message
267 in the response for more details.
268 schema:
269 $ref: "#/definitions/DCAEErrorResponse"
270
271 504:
272 description: |
273 Error communicating with a downstream system. See the message
274 in the response for more details.
275 schema:
276 $ref: "#/definitions/DCAEErrorResponse"
277
278 /policy:
279 post:
280 tags:
281 - "policy"
282 description: policy update API consumed by policy-handler
283
284 consumes:
285 - application/json
286 produces:
287 - application/json
288
289 parameters:
290 - name: body
291 in: body
292 schema:
293 $ref: "#/definitions/DCAEPolicyRequest"
294 required: true
295
296 responses:
297 200:
298 description: deployment-handler always responds with ok to /policy before processing the request
299
300 /policy/components:
301 get:
302 tags:
303 - "policy"
304 description: debug API to find policies on components
305 produces:
306 - application/json
307
308 responses:
309 200:
310 description: deployment-handler found components with or without policies in cloudify
311
312
313definitions:
314
315 DCAEDeploymentRequest:
316 description: |
317 Request for deploying a DCAE service.
318 type:
319 object
320 required: [serviceTypeId]
321
322 properties:
323
324 serviceTypeId:
325 description: |
326 The service type identifier (a unique ID assigned by DCAE inventory) for the service to be deployed.
327 type: string
328
329 inputs:
330 description: |
331 Object containing inputs needed by the service blueprint to create an instance of the service.
332 Content of the object depends on the service being deployed.
333 type: object
334
335 DCAEDeploymentResponse:
336 description: |
337 Response body for a PUT or DELETE to /dcae-deployments/{deploymentId}
338 type: object
339
340 required: [requestId, links]
341
342 properties:
343 requestId:
344 type: string
345 description: |
346 Unique identifier for the request
347 links:
348 description: |
349 Links that the API client can access.
350 type: object
351 properties:
352 self:
353 type: string
354 description: |
355 Link used to retrieve information about the service being deployed
356 status:
357 type: string
358 description:
359 Link used to retrieve information about the status of the installation workflow
360
361 DCAEOperationStatusResponse:
362 description: |
363 Response body for a request for status of an installation or uninstallation operation.
364 type: object
365
366 required: [requestId, operationType, status]
367
368 properties:
369 requestId:
370 type: string
371 description: |
372 A unique identifier assigned to the request. Useful for tracing a request through logs.
373 operationType:
374 description: |
375 Type of operation being reported on. ("install" or "uninstall")
376 type: string
377 status:
378 description: |
379 Status of the installation or uninstallation operation. Possible values are "processing",
380 "succeeded", and "failed"
381 type: string
382 error:
383 description: |
384 If status is "failed", this field will be present and contain additional information about the reason the operation failed.
385 type: string
386 links:
387 description: |
388 If the operation succeeded, links that the client can follow to take further action. Note that a successful "uninstall" operation removes the DCAE service instance completely, so there are no possible further actions, and no links.
389 type: object
390 properties:
391 self:
392 type: string
393 description: |
394 Link used to retrieve information about the service.
395 uninstall:
396 type: string
397 description:
398 Link used to trigger an "uninstall" operation for the service. (Use the DELETE method.)
399
400 DCAEErrorResponse:
401 description: |
402 Object reporting an error.
403 type:
404 object
405 required: [status]
406
407 properties:
408 status:
409 description: HTTP status code for the response
410 type: integer
411
412 message:
413 description: Human-readable description of the reason for the error
414 type: string
415
416 DCAEDeploymentsListResponse:
417 description: |
418 Object providing a list of deployments
419 type: object
420 required: [requestId, deployments]
421
422 properties:
423 requestId:
424 type: string
425 description: |
426 Unique identifier for the request
427 deployments:
428 type: array
429 items:
430 type: object
431 properties:
432 href:
433 type: string
434 description: |
435 URL for the service deployment
436
437 DCAEPolicyBody:
438 description: policy_body - the whole object received from policy-engine
439 type: object
440 required:
441 - policyName
442 - policyVersion
443 - config
444 properties:
445 policyName:
446 description: unique policy name that contains the version and extension
447 type: string
448 policyVersion:
449 description: stringified int that is autoincremented by policy-engine
450 type: string
451 config:
452 description: the policy-config - the config data provided by policy owner
453 type: object
454
455 DCAEPolicy:
456 description: policy object
457 type: object
458 required:
459 - policy_id
460 - policy_body
461 properties:
462 policy_id:
463 description: unique identifier of policy regardless of its version
464 type: string
465 policy_body:
466 $ref: "#/definitions/DCAEPolicyBody"
467
468 DCAEPolicyRequest:
469 description: request to update policies on DCAE components.
470 type: object
471 required:
472 - latest_policies
473
474 properties:
475 latest_policies:
476 description: "dictionary of (policy_id -> Policy object). In example: replace additionalProp1,2,3 with policy_id1,2,3 values"
477 type: object
478 additionalProperties:
479 $ref: "#/definitions/DCAEPolicy"