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