e16e22cadd4e081f09427fac39149ba25995e173
[ccsdk/cds.git] / docs / api-reference / media / cds-bp-processor-api-swagger.yaml
1 ---
2 swagger: "2.0"
3 info:
4   description: "Shows all resources and endpoints which CDS BP processor currently\
5     \ provides with sample requests/responses, parameter description and other information."
6   version: "v1"
7   title: "CDS Blueprint Processor API Reference"
8   termsOfService: "https://www.onap.org/"
9   contact:
10     name: "ONAP Community"
11     url: "https://www.onap.org/"
12     email: "onap-discuss@lists.onap.org"
13   license:
14     name: "Apache 2.0"
15     url: "http://www.apache.org/licenses/LICENSE-2.0.html"
16 host: "localhost:8080"
17 tags:
18 - name: "Blueprint Model Catalog API"
19   description: "Manages all blueprint models which are available in CDS"
20 schemes:
21 - "http"
22 paths:
23   /api/v1/blueprint-model:
24     get:
25       tags:
26       - "Blueprint Model Catalog API"
27       summary: "List all Blueprint Models"
28       description: "Lists all meta-data of blueprint models which are saved in CDS."
29       operationId: "BlueprintModelController_allBlueprintModel_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
30       produces:
31       - "application/json"
32       parameters: []
33       responses:
34         200:
35           description: "OK"
36           schema:
37             type: "array"
38             items:
39               $ref: "#/definitions/BlueprintModelSearch"
40         500:
41           description: "Internal Server Error"
42     post:
43       tags:
44       - "Blueprint Model Catalog API"
45       summary: "Save a Blueprint Model"
46       description: "Saves a blueprint model by the given CBA zip file input. There\
47         \ is no validation of the attached CBA happening when this API is called."
48       operationId: "BlueprintModelController_saveBlueprint_POST.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
49       consumes:
50       - "multipart/form-data"
51       produces:
52       - "application/json"
53       parameters:
54       - in: "body"
55         name: "file"
56         description: "CBA file to be uploaded (example: cba.zip)"
57         required: true
58         schema:
59           $ref: "#/definitions/FilePart"
60       responses:
61         200:
62           description: "OK"
63           schema:
64             type: "object"
65         500:
66           description: "Internal Server Error"
67   /api/v1/blueprint-model/bootstrap:
68     post:
69       tags:
70       - "Blueprint Model Catalog API"
71       summary: "Bootstrap CDS"
72       description: "Loads all Model Types, Resource Dictionaries and Blueprint Models\
73         \ which are included in CDS by default. Before starting to work with CDS,\
74         \ bootstrap should be called to load all the basic models that each orginization\
75         \ might support. Parameter values can be set as `false`  to skip loading e.g.\
76         \ the Resource Dictionaries but this is not recommended."
77       operationId: "BlueprintModelController_bootstrap_POST.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
78       consumes:
79       - "application/json"
80       produces:
81       - "application/json"
82       parameters:
83       - in: "body"
84         name: "body"
85         description: "Specifies which elements to load"
86         required: true
87         schema:
88           $ref: "#/definitions/BootstrapRequest"
89       responses:
90         200:
91           description: "OK"
92           schema:
93             type: "object"
94         500:
95           description: "Internal Server Error"
96   /api/v1/blueprint-model/by-name/{name}/version/{version}:
97     get:
98       tags:
99       - "Blueprint Model Catalog API"
100       summary: "Get a Blueprint Model by Name and Version"
101       description: "Get Meta-Data of a Blueprint Model by its name and version."
102       operationId: "BlueprintModelController_getBlueprintByNameAndVersion_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
103       produces:
104       - "application/json"
105       parameters:
106       - name: "name"
107         in: "path"
108         description: "Name of the blueprint model"
109         required: true
110         type: "string"
111         x-example: "pnf_netconf"
112       - name: "version"
113         in: "path"
114         description: "Version of the blueprint model"
115         required: true
116         type: "string"
117         x-example: "1.0.0"
118       responses:
119         200:
120           description: "OK"
121           schema:
122             type: "object"
123         404:
124           description: "Not Found"
125   /api/v1/blueprint-model/download/by-name/{name}/version/{version}:
126     get:
127       tags:
128       - "Blueprint Model Catalog API"
129       summary: "Download a Blueprint Model"
130       description: "Gets the CBA of a blueprint model by its name and version. Response\
131         \ can be saved to a file to download the CBA."
132       operationId: "BlueprintModelController_downloadBlueprintByNameAndVersion_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
133       produces:
134       - "application/json"
135       parameters:
136       - name: "name"
137         in: "path"
138         description: "Name of the blueprint model"
139         required: true
140         type: "string"
141         x-example: "pnf_netconf"
142       - name: "version"
143         in: "path"
144         description: "Version of the blueprint model"
145         required: true
146         type: "string"
147         x-example: "1.0.0"
148       responses:
149         200:
150           description: "OK"
151           schema:
152             type: "object"
153         404:
154           description: "Not Found"
155   /api/v1/blueprint-model/download/{id}:
156     get:
157       tags:
158       - "Blueprint Model Catalog API"
159       summary: "Download a Blueprint Model by ID"
160       description: "Gets the CBA of a blueprint model by its ID. Response can be saved\
161         \ to a file to download the CBA."
162       operationId: "BlueprintModelController_downloadBluePrint_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
163       produces:
164       - "application/json"
165       parameters:
166       - name: "id"
167         in: "path"
168         description: "ID of the blueprint model to download"
169         required: true
170         type: "string"
171         x-example: "67ec1f96-ab55-4b81-aff9-23ee0ed1d7a4"
172       responses:
173         200:
174           description: "OK"
175           schema:
176             type: "object"
177         404:
178           description: "Not Found"
179   /api/v1/blueprint-model/enrich:
180     post:
181       tags:
182       - "Blueprint Model Catalog API"
183       summary: "Enrich a Blueprint Model"
184       description: "Enriches the attached CBA and returns the enriched CBA zip file\
185         \ in the response. The enrichment process will complete the package by providing\
186         \ all the definition of types used."
187       operationId: "BlueprintModelController_enrichBlueprint_POST.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
188       consumes:
189       - "multipart/form-data"
190       produces:
191       - "application/json"
192       parameters:
193       - in: "body"
194         name: "file"
195         description: "CBA zip file to be uploaded (example: cba_unenriched.zip)"
196         required: true
197         schema:
198           $ref: "#/definitions/FilePart"
199       responses:
200         200:
201           description: "successful operation"
202           schema:
203             type: "object"
204   /api/v1/blueprint-model/enrichandpublish:
205     post:
206       tags:
207       - "Blueprint Model Catalog API"
208       summary: "Enrich and publish a Blueprint Model"
209       description: "Enriches the attached CBA, validates it and saves it in CDS if\
210         \ validation was successful."
211       operationId: "BlueprintModelController_enrichAndPubishlueprint_POST.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
212       consumes:
213       - "multipart/form-data"
214       produces:
215       - "application/json"
216       parameters:
217       - in: "body"
218         name: "file"
219         description: "Unenriched CBA zip file to be uploaded (example: cba_unenriched.zip)"
220         required: true
221         schema:
222           $ref: "#/definitions/FilePart"
223       responses:
224         200:
225           description: "OK"
226           schema:
227             type: "object"
228         503:
229           description: "Service Unavailable"
230   /api/v1/blueprint-model/meta-data/{keyword}:
231     get:
232       tags:
233       - "Blueprint Model Catalog API"
234       summary: "Search for Blueprints by a Keyword"
235       description: "Lists all blueprint models by a matching keyword in any of the\
236         \ meta-data of the blueprint models. Blueprint models are just returned if\
237         \ a whole keyword is matching, not just parts of it. Not case-sensitive. Used\
238         \ by CDS UI."
239       operationId: "BlueprintModelController_allBlueprintModelMetaData_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
240       produces:
241       - "application/json"
242       parameters:
243       - name: "keyword"
244         in: "path"
245         description: "Keyword to search for in blueprint model meta-data"
246         required: true
247         type: "string"
248         x-example: "pnf_netconf"
249       responses:
250         200:
251           description: "successful operation"
252           schema:
253             type: "object"
254   /api/v1/blueprint-model/name/{name}/version/{version}:
255     delete:
256       tags:
257       - "Blueprint Model Catalog API"
258       summary: "Delete a Blueprint Model by Name"
259       description: "Deletes a blueprint model identified by its name and version from\
260         \ CDS."
261       operationId: "BlueprintModelController_deleteBlueprintByName_DELETE.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
262       parameters:
263       - name: "name"
264         in: "path"
265         description: "Name of the blueprint model"
266         required: true
267         type: "string"
268         x-example: "pnf_netconf"
269       - name: "version"
270         in: "path"
271         description: "Version of the blueprint model"
272         required: true
273         type: "string"
274         x-example: "1.0.0"
275       responses:
276         200:
277           description: "successful operation"
278           schema:
279             type: "object"
280   /api/v1/blueprint-model/paged:
281     get:
282       tags:
283       - "Blueprint Model Catalog API"
284       summary: "Get Blueprints ordered"
285       description: "Lists all blueprint models which are saved in CDS in an ordered\
286         \ mode."
287       operationId: "BlueprintModelController_allBlueprintModelPaged_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
288       produces:
289       - "application/json"
290       parameters:
291       - name: "limit"
292         in: "query"
293         description: "Maximum number of returned blueprint models"
294         required: false
295         type: "integer"
296         default: 20
297         format: "int32"
298       - name: "offset"
299         in: "query"
300         description: "Offset"
301         required: false
302         type: "integer"
303         default: 0
304         format: "int32"
305       - name: "sort"
306         in: "query"
307         description: "Order of returned blueprint models"
308         required: false
309         type: "string"
310         default: "DATE"
311         enum:
312         - "DATE"
313         - "NAME"
314         - "VERSION"
315       - name: "sortType"
316         in: "query"
317         description: "Ascend or descend ordering"
318         required: false
319         type: "string"
320         default: "ASC"
321       responses:
322         200:
323           description: "successful operation"
324           schema:
325             $ref: "#/definitions/PageBlueprintModelSearch"
326   /api/v1/blueprint-model/paged/meta-data/{keyword}:
327     get:
328       tags:
329       - "Blueprint Model Catalog API"
330       summary: "Search for Blueprints by a Keyword in an ordered mode"
331       description: "Lists all blueprint models by a matching keyword in any of the\
332         \ meta-data of the blueprint models in an ordered mode. Blueprint models are\
333         \ just returned if a whole keyword is matching, not just parts of it. Not\
334         \ case-sensitive. Used by CDS UI."
335       operationId: "BlueprintModelController_allBlueprintModelMetaDataPaged_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
336       produces:
337       - "application/json"
338       parameters:
339       - name: "keyword"
340         in: "path"
341         description: "Keyword to search for in blueprint model meta-data"
342         required: true
343         type: "string"
344         x-example: "pnf_netconf"
345       - name: "limit"
346         in: "query"
347         description: "Maximum number of returned blueprint models"
348         required: false
349         type: "integer"
350         default: 20
351         format: "int32"
352       - name: "offset"
353         in: "query"
354         description: "Offset"
355         required: false
356         type: "integer"
357         default: 0
358         format: "int32"
359       - name: "sort"
360         in: "query"
361         description: "Order of returned blueprint models"
362         required: false
363         type: "string"
364         default: "DATE"
365         enum:
366         - "DATE"
367         - "NAME"
368         - "VERSION"
369       - name: "sortType"
370         in: "query"
371         description: "Ascend or descend ordering"
372         required: false
373         type: "string"
374         default: "ASC"
375       responses:
376         200:
377           description: "successful operation"
378           schema:
379             $ref: "#/definitions/PageBlueprintModelSearch"
380   /api/v1/blueprint-model/publish:
381     post:
382       tags:
383       - "Blueprint Model Catalog API"
384       summary: "Publish a Blueprint Model"
385       description: "Validates the attached CBA file and saves it in CDS if validation\
386         \ was successful. CBA needs to be already enriched."
387       operationId: "BlueprintModelController_publishBlueprint_POST.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
388       consumes:
389       - "multipart/form-data"
390       produces:
391       - "application/json"
392       parameters:
393       - in: "body"
394         name: "file"
395         description: "Enriched CBA zip file to be uploaded (example: cba_enriched.zip)"
396         required: true
397         schema:
398           $ref: "#/definitions/FilePart"
399       responses:
400         200:
401           description: "successful operation"
402           schema:
403             type: "object"
404   /api/v1/blueprint-model/search/{tags}:
405     get:
406       tags:
407       - "Blueprint Model Catalog API"
408       summary: "Search for a Blueprint by Tag"
409       description: "Searches for all blueprint models which contain the specified\
410         \ input parameter in their tags. Blueprint models which contain just parts\
411         \ of the searched word in their tags are also returned."
412       operationId: "BlueprintModelController_searchBlueprintModels_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
413       produces:
414       - "application/json"
415       parameters:
416       - name: "tags"
417         in: "path"
418         description: "Tag to search for"
419         required: true
420         type: "string"
421         x-example: "test"
422       responses:
423         200:
424           description: "successful operation"
425           schema:
426             type: "object"
427   /api/v1/blueprint-model/workflow-spec:
428     post:
429       tags:
430       - "Blueprint Model Catalog API"
431       summary: "Get Workflow Specification"
432       description: "Get the workflow of a blueprint identified by Blueprint and workflow\
433         \ name. Inputs, outputs and data types of workflow is returned."
434       operationId: "BlueprintModelController_workflowSpec_POST.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
435       consumes:
436       - "application/json"
437       produces:
438       - "application/json"
439       parameters:
440       - in: "body"
441         name: "body"
442         required: false
443         schema:
444           $ref: "#/definitions/WorkFlowSpecRequest"
445       responses:
446         200:
447           description: "successful operation"
448           schema:
449             type: "object"
450   /api/v1/blueprint-model/workflows/blueprint-name/{name}/version/{version}:
451     get:
452       tags:
453       - "Blueprint Model Catalog API"
454       summary: "Get Workflows of a Blueprint"
455       description: "Get all available workflows of a Blueprint identified by its name\
456         \ and version."
457       operationId: "BlueprintModelController_getWorkflowList_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
458       produces:
459       - "application/json"
460       parameters:
461       - name: "name"
462         in: "path"
463         description: "Name of the blueprint model"
464         required: true
465         type: "string"
466         x-example: "pnf_netconf"
467       - name: "version"
468         in: "path"
469         description: "Version of the blueprint model"
470         required: true
471         type: "string"
472         x-example: "1.0.0"
473       responses:
474         200:
475           description: "successful operation"
476           schema:
477             type: "object"
478   /api/v1/blueprint-model/{id}:
479     get:
480       tags:
481       - "Blueprint Model Catalog API"
482       summary: "Get a Blueprint Model by ID"
483       description: "Get meta-data of a blueprint model by its internally created ID."
484       operationId: "BlueprintModelController_getBlueprintModel_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
485       produces:
486       - "application/json"
487       parameters:
488       - name: "id"
489         in: "path"
490         description: "ID of the blueprint model to search for"
491         required: true
492         type: "string"
493         x-example: "67ec1f96-ab55-4b81-aff9-23ee0ed1d7a4"
494       responses:
495         200:
496           description: "OK"
497           schema:
498             type: "object"
499         404:
500           description: "Not Found"
501     delete:
502       tags:
503       - "Blueprint Model Catalog API"
504       summary: "Delete a Blueprint Model by ID"
505       description: "Delete a blueprint model by its ID. ID is the internally created\
506         \ ID of blueprint, not the name of blueprint."
507       operationId: "BlueprintModelController_deleteBlueprint_DELETE.org.onap.ccsdk.cds.blueprintsprocessor.designer.api"
508       parameters:
509       - name: "id"
510         in: "path"
511         description: "ID of the blueprint model to delete"
512         required: true
513         type: "string"
514         x-example: "67ec1f96-ab55-4b81-aff9-23ee0ed1d7a4"
515       responses:
516         200:
517           description: "OK"
518           schema:
519             type: "object"
520         404:
521           description: "RESOURCE_NOT_FOUND"
522 securityDefinitions:
523   Basic Auth:
524     type: "basic"
525 definitions:
526   BlueprintModelSearch:
527     type: "object"
528     required:
529     - "artifactName"
530     - "artifactVersion"
531     - "createdDate"
532     - "id"
533     - "published"
534     - "tags"
535     - "updatedBy"
536     properties:
537       id:
538         type: "string"
539         example: "\"658f9a48-7f54-41ba-ae18-c69f26f3dc94\""
540         description: "ID of Blueprint model, is automatically created by CDS"
541       artifactUUId:
542         type: "string"
543         example: "null"
544         description: "Artifact UUID, usually null"
545       artifactType:
546         type: "string"
547         example: "\"SDNC_MODEL\""
548         description: "Artifact Type, usually null"
549       artifactVersion:
550         type: "string"
551         example: "\"1.0.0\""
552         description: "Artifact Version, usually 1.0.0"
553       artifactDescription:
554         type: "string"
555         example: "\"\""
556         description: "Artifact Description, usually empty"
557       internalVersion:
558         type: "integer"
559         format: "int32"
560         example: "null"
561         description: "Internal Version of CBA, usually null"
562       createdDate:
563         type: "string"
564         format: "date-time"
565         example: "\"2020-11-19T10:34:56.000Z\""
566         description: "Datetime of the creation of CBA in CDS"
567       artifactName:
568         type: "string"
569         example: "\"pnf_netconf\""
570         description: "Artifact Name, defined in Metadata"
571       published:
572         type: "string"
573         example: "\"pnf_netconf\""
574         description: "Artifact Name, defined in Metadata"
575       updatedBy:
576         type: "string"
577         example: "\"Deutsche Telekom AG\""
578         description: "Name of publisher, defined in Metadata"
579       tags:
580         type: "string"
581         example: "\"test\""
582         description: "Tags to identify the CBA, defined in Metadata"
583   BootstrapRequest:
584     type: "object"
585     required:
586     - "loadCBA"
587     - "loadModelType"
588     - "loadResourceDictionary"
589     properties:
590       loadModelType:
591         type: "boolean"
592         example: true
593         description: "Specifies if default model types should be loaded"
594       loadResourceDictionary:
595         type: "boolean"
596         example: true
597         description: "Specifies if default data dictionaries should be loaded"
598       loadCBA:
599         type: "boolean"
600         example: true
601         description: "Specifies if default blueprint models should be loaded"
602   FilePart:
603     type: "object"
604   Page:
605     type: "object"
606     properties:
607       totalPages:
608         type: "integer"
609         format: "int32"
610       totalElements:
611         type: "integer"
612         format: "int64"
613       size:
614         type: "integer"
615         format: "int32"
616       content:
617         type: "array"
618         items:
619           type: "object"
620       number:
621         type: "integer"
622         format: "int32"
623       sort:
624         $ref: "#/definitions/Sort"
625       last:
626         type: "boolean"
627       numberOfElements:
628         type: "integer"
629         format: "int32"
630       pageable:
631         $ref: "#/definitions/Pageable"
632       first:
633         type: "boolean"
634       empty:
635         type: "boolean"
636   PageBlueprintModelSearch:
637     type: "object"
638     properties:
639       totalPages:
640         type: "integer"
641         format: "int32"
642       totalElements:
643         type: "integer"
644         format: "int64"
645       size:
646         type: "integer"
647         format: "int32"
648       content:
649         type: "array"
650         items:
651           $ref: "#/definitions/BlueprintModelSearch"
652       number:
653         type: "integer"
654         format: "int32"
655       sort:
656         $ref: "#/definitions/Sort"
657       last:
658         type: "boolean"
659       numberOfElements:
660         type: "integer"
661         format: "int32"
662       pageable:
663         $ref: "#/definitions/Pageable"
664       first:
665         type: "boolean"
666       empty:
667         type: "boolean"
668   Pageable:
669     type: "object"
670     properties:
671       offset:
672         type: "integer"
673         format: "int64"
674       sort:
675         $ref: "#/definitions/Sort"
676       paged:
677         type: "boolean"
678       unpaged:
679         type: "boolean"
680       pageNumber:
681         type: "integer"
682         format: "int32"
683       pageSize:
684         type: "integer"
685         format: "int32"
686   Sort:
687     type: "object"
688     properties:
689       unsorted:
690         type: "boolean"
691       sorted:
692         type: "boolean"
693       empty:
694         type: "boolean"
695   WorkFlowSpecRequest:
696     type: "object"
697     required:
698     - "blueprintName"
699     - "workflowName"
700     properties:
701       blueprintName:
702         type: "string"
703         example: "\"pnf_netconf\""
704         description: "Name of the BLueprint"
705       version:
706         type: "string"
707       returnContent:
708         type: "string"
709       workflowName:
710         type: "string"
711         example: "\"config-assign\""
712         description: "Name of the Workflow"
713       specType:
714         type: "string"