CDS API reference add request classes 61/116261/3
authorJakobKrieg <jakob.krieg@bcmsolutions.de>
Wed, 9 Dec 2020 14:05:10 +0000 (15:05 +0100)
committerKAPIL SINGAL <ks220y@att.com>
Mon, 14 Dec 2020 18:31:18 +0000 (18:31 +0000)
Issue-ID: CCSDK-3014
Change-Id: If0a0a6169ac43a66c3dc51639e3a22efa49dcba5
Signed-off-by: JakobKrieg <jakob.krieg@bcmsolutions.de>
docs/api-reference/media/bp-processor.postman_collection.json
docs/api-reference/media/cds-bp-processor-api-swagger.json
ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt

index f2a9f14..0e62117 100644 (file)
                                                                }
                                                        }
                                                },
+                                               "url": {
+                                                       "raw": "http://{{host}}:{{port}}/api/v1/blueprint-model/by-name/pnf_netconf/version/1.0.0",
+                                                       "protocol": "http",
+                                                       "host": [
+                                                               "{{host}}"
+                                                       ],
+                                                       "port": "{{port}}",
+                                                       "path": [
+                                                               "api",
+                                                               "v1",
+                                                               "blueprint-model",
+                                                               "by-name",
+                                                               "pnf_netconf",
+                                                               "version",
+                                                               "1.0.0"
+                                                       ]
+                                               },
+                                               "description": "Get Meta-Data of a Blueprint Model by its name and version."
+                                       },
+                                       "response": [
+                                               {
+                                                       "name": "CDS Bootstrap",
+                                                       "originalRequest": {
+                                                               "method": "POST",
+                                                               "header": [
+                                                                       {
+                                                                               "key": "Content-Type",
+                                                                               "value": "application/json"
+                                                                       },
+                                                                       {
+                                                                               "key": "",
+                                                                               "value": "",
+                                                                               "type": "text",
+                                                                               "disabled": true
+                                                                       }
+                                                               ],
+                                                               "body": {
+                                                                       "mode": "raw",
+                                                                       "raw": "{\r\n\"loadModelType\" : false,\r\n\"loadResourceDictionary\" : true,\r\n\"loadCBA\" : false\r\n}",
+                                                                       "options": {
+                                                                               "raw": {}
+                                                                       }
+                                                               },
+                                                               "url": {
+                                                                       "raw": "http://localhost:8081/api/v1/blueprint-model/bootstrap",
+                                                                       "protocol": "http",
+                                                                       "host": [
+                                                                               "localhost"
+                                                                       ],
+                                                                       "port": "8081",
+                                                                       "path": [
+                                                                               "api",
+                                                                               "v1",
+                                                                               "blueprint-model",
+                                                                               "bootstrap"
+                                                                       ]
+                                                               }
+                                                       },
+                                                       "status": "OK",
+                                                       "code": 200,
+                                                       "_postman_previewlanguage": "json",
+                                                       "header": [
+                                                               {
+                                                                       "key": "X-ONAP-RequestID",
+                                                                       "value": "b73253b6-d2be-4701-bdb2-31fa66b79a01"
+                                                               },
+                                                               {
+                                                                       "key": "X-ONAP-InvocationID",
+                                                                       "value": "b1a59296-fcf2-4435-b8de-9a2e9b9f4077"
+                                                               },
+                                                               {
+                                                                       "key": "X-ONAP-PartnerName",
+                                                                       "value": "cds-controller"
+                                                               },
+                                                               {
+                                                                       "key": "Vary",
+                                                                       "value": "Origin"
+                                                               },
+                                                               {
+                                                                       "key": "Vary",
+                                                                       "value": "Access-Control-Request-Method"
+                                                               },
+                                                               {
+                                                                       "key": "Vary",
+                                                                       "value": "Access-Control-Request-Headers"
+                                                               },
+                                                               {
+                                                                       "key": "Content-Type",
+                                                                       "value": "application/json"
+                                                               },
+                                                               {
+                                                                       "key": "Content-Length",
+                                                                       "value": "0"
+                                                               },
+                                                               {
+                                                                       "key": "Cache-Control",
+                                                                       "value": "no-cache, no-store, max-age=0, must-revalidate"
+                                                               },
+                                                               {
+                                                                       "key": "Pragma",
+                                                                       "value": "no-cache"
+                                                               },
+                                                               {
+                                                                       "key": "Expires",
+                                                                       "value": "0"
+                                                               },
+                                                               {
+                                                                       "key": "X-Content-Type-Options",
+                                                                       "value": "nosniff"
+                                                               },
+                                                               {
+                                                                       "key": "X-Frame-Options",
+                                                                       "value": "DENY"
+                                                               },
+                                                               {
+                                                                       "key": "X-XSS-Protection",
+                                                                       "value": "1 ; mode=block"
+                                                               },
+                                                               {
+                                                                       "key": "Referrer-Policy",
+                                                                       "value": "no-referrer"
+                                                               }
+                                                       ],
+                                                       "cookie": [],
+                                                       "body": ""
+                                               }
+                                       ]
+                               },
+                               {
+                                       "name": "Download a Blueprint Model",
+                                       "protocolProfileBehavior": {
+                                               "disabledSystemHeaders": {}
+                                       },
+                                       "request": {
+                                               "auth": {
+                                                       "type": "basic",
+                                                       "basic": [
+                                                               {
+                                                                       "key": "password",
+                                                                       "value": "ccsdkapps",
+                                                                       "type": "string"
+                                                               },
+                                                               {
+                                                                       "key": "username",
+                                                                       "value": "ccsdkapps",
+                                                                       "type": "string"
+                                                               }
+                                                       ]
+                                               },
+                                               "method": "GET",
+                                               "header": [
+                                                       {
+                                                               "key": "Content-Type",
+                                                               "value": "application/json",
+                                                               "disabled": true
+                                                       },
+                                                       {
+                                                               "key": "",
+                                                               "type": "text",
+                                                               "value": "",
+                                                               "disabled": true
+                                                       }
+                                               ],
                                                "url": {
                                                        "raw": "http://{{host}}:{{port}}/api/v1/blueprint-model/download/by-name/pnf_netconf/version/1.0.0",
                                                        "protocol": "http",
                                                                "1.0.0"
                                                        ]
                                                },
-                                               "description": "Get Meta-Data of a Blueprint Model by its name and version."
+                                               "description": "Gets the CBA of a blueprint model by its name and version. Response can be saved to a file to download the CBA."
                                        },
                                        "response": [
                                                {
                                                        }
                                                ],
                                                "url": {
-                                                       "raw": "http://{{host}}:{{port}}/api/v1/blueprint-model/download/416f241d-3ef9-4cb6-8834-956ae4f70b07",
+                                                       "raw": "http://{{host}}:{{port}}/api/v1/blueprint-model/download/44471683-4446-4ed9-8b27-fac6a8f81e5e",
                                                        "protocol": "http",
                                                        "host": [
                                                                "{{host}}"
                                                                "v1",
                                                                "blueprint-model",
                                                                "download",
-                                                               "416f241d-3ef9-4cb6-8834-956ae4f70b07"
+                                                               "44471683-4446-4ed9-8b27-fac6a8f81e5e"
                                                        ]
                                                },
                                                "description": "Gets the CBA of a blueprint model by its ID. Response can be saved to a file to download the CBA."
        ],
        "variable": [
                {
-                       "id": "86d601d8-fded-49c0-8870-545b57019003",
+                       "id": "59f58f5b-ee64-490b-be39-09983d888dd8",
                        "key": "host",
                        "value": "localhost"
                },
                {
-                       "id": "b53854bd-6fbb-42bb-a001-9b77a3883cf8",
+                       "id": "284f1750-2dd3-4fa4-aade-cccd91d53cc7",
                        "key": "port",
                        "value": "8081"
                }
index a9f5965..af3ed94 100644 (file)
@@ -64,7 +64,7 @@
           "200" : {
             "description" : "OK",
             "schema" : {
-              "type" : "object"
+              "$ref" : "#/definitions/BlueprintModelSearch"
             }
           },
           "500" : {
           "200" : {
             "description" : "OK",
             "schema" : {
-              "type" : "object"
+              "$ref" : "#/definitions/BlueprintModelSearch"
             }
           },
           "404" : {
           "200" : {
             "description" : "OK",
             "schema" : {
-              "type" : "object"
+              "$ref" : "#/definitions/BlueprintModelSearch"
             }
           },
           "503" : {
           "200" : {
             "description" : "successful operation",
             "schema" : {
-              "type" : "object"
+              "type" : "array",
+              "items" : {
+                "$ref" : "#/definitions/BlueprintModelSearch"
+              }
             }
           }
         }
           "200" : {
             "description" : "successful operation",
             "schema" : {
-              "type" : "object"
+              "$ref" : "#/definitions/BlueprintModelSearch"
             }
           }
         }
           "200" : {
             "description" : "successful operation",
             "schema" : {
-              "type" : "object"
+              "type" : "array",
+              "items" : {
+                "$ref" : "#/definitions/BlueprintModelSearch"
+              }
             }
           }
         }
         "parameters" : [ {
           "in" : "body",
           "name" : "body",
-          "required" : false,
+          "description" : "Blueprint and workflow identification",
+          "required" : true,
           "schema" : {
             "$ref" : "#/definitions/WorkFlowSpecRequest"
           }
           "200" : {
             "description" : "OK",
             "schema" : {
-              "type" : "object"
+              "$ref" : "#/definitions/BlueprintModelSearch"
             }
           },
           "404" : {
index 167e435..8b79ce7 100644 (file)
@@ -91,7 +91,9 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint
     @PostMapping(produces = [MediaType.APPLICATION_JSON_VALUE], consumes = [MediaType.MULTIPART_FORM_DATA_VALUE])
     @ApiOperation(
         value = "Save a Blueprint Model",
-        notes = "Saves a blueprint model by the given CBA zip file input. There is no validation of the attached CBA happening when this API is called."
+        notes = "Saves a blueprint model by the given CBA zip file input. " +
+            "There is no validation of the attached CBA happening when this API is called.",
+        response = BlueprintModelSearch::class
     )
     @ApiResponses(
         ApiResponse(code = 200, message = "OK"),
@@ -148,7 +150,9 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint
         value = "Search for Blueprints by a Keyword",
         notes = "Lists all blueprint models by a matching keyword in any of the meta-data of the blueprint models. " +
             "Blueprint models are just returned if a whole keyword is matching, not just parts of it. Not case-sensitive. " +
-            "Used by CDS UI."
+            "Used by CDS UI.",
+        responseContainer = "List",
+        response = BlueprintModelSearch::class
     )
     @ResponseBody
     @PreAuthorize("hasRole('USER')")
@@ -206,7 +210,8 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint
     @GetMapping("/by-name/{name}/version/{version}", produces = [MediaType.APPLICATION_JSON_VALUE])
     @ApiOperation(
         value = "Get a Blueprint Model by Name and Version",
-        notes = "Get Meta-Data of a Blueprint Model by its name and version."
+        notes = "Get Meta-Data of a Blueprint Model by its name and version.",
+        response = BlueprintModelSearch::class
     )
     @ApiResponses(
         ApiResponse(code = 200, message = "OK"),
@@ -249,7 +254,8 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint
     @GetMapping("/{id}", produces = [MediaType.APPLICATION_JSON_VALUE])
     @ApiOperation(
         value = "Get a Blueprint Model by ID",
-        notes = "Get meta-data of a blueprint model by its internally created ID."
+        notes = "Get meta-data of a blueprint model by its internally created ID.",
+        response = BlueprintModelSearch::class
     )
     @ApiResponses(
         ApiResponse(code = 200, message = "OK"),
@@ -316,7 +322,8 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint
     )
     @ApiOperation(
         value = "Enrich and publish a Blueprint Model",
-        notes = "Enriches the attached CBA, validates it and saves it in CDS if validation was successful."
+        notes = "Enriches the attached CBA, validates it and saves it in CDS if validation was successful.",
+        response = BlueprintModelSearch::class
     )
     @ApiResponses(
         ApiResponse(code = 200, message = "OK"),
@@ -335,7 +342,8 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint
     @PostMapping("/publish", produces = [MediaType.APPLICATION_JSON_VALUE], consumes = [MediaType.MULTIPART_FORM_DATA_VALUE])
     @ApiOperation(
         value = "Publish a Blueprint Model",
-        notes = "Validates the attached CBA file and saves it in CDS if validation was successful. CBA needs to be already enriched."
+        notes = "Validates the attached CBA file and saves it in CDS if validation was successful. CBA needs to be already enriched.",
+        response = BlueprintModelSearch::class
     )
     @ResponseBody
     @Throws(BluePrintException::class)
@@ -351,7 +359,9 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint
     @ApiOperation(
         value = "Search for a Blueprint by Tag",
         notes = "Searches for all blueprint models which contain the specified input parameter in their tags. " +
-            "Blueprint models which contain just parts of the searched word in their tags are also returned."
+            "Blueprint models which contain just parts of the searched word in their tags are also returned.",
+        responseContainer = "List",
+        response = BlueprintModelSearch::class
     )
     @ResponseBody
     @PreAuthorize("hasRole('USER')")
@@ -397,7 +407,10 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint
     @ResponseBody
     @Throws(BluePrintException::class)
     @PreAuthorize("hasRole('USER')")
-    suspend fun workflowSpec(@RequestBody workFlowSpecReq: WorkFlowSpecRequest):
+    suspend fun workflowSpec(
+        @ApiParam(required = true, value = "Blueprint and workflow identification")
+        @RequestBody workFlowSpecReq: WorkFlowSpecRequest
+    ):
         ResponseEntity<String> = mdcWebCoroutineScope {
             var json = bluePrintModelHandler.prepareWorkFlowSpec(workFlowSpecReq)
                 .asJsonString()