Add vsp-validate and samples 11/21211/1
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Mon, 30 Oct 2017 05:23:25 +0000 (10:53 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Mon, 30 Oct 2017 05:33:13 +0000 (11:03 +0530)
CLI-57

Change-Id: I82a70db1e1fa59acf534853b3bcd0872253a9120
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
plugins/sdc/src/main/resources/onap-cli-schema/vsp/vsp-validate-schema-1.1.yaml [new file with mode: 0644]
plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-validate-schema-1.1-moco.json [new file with mode: 0644]
plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-validate-schema-1.1-sample.yaml [new file with mode: 0644]

diff --git a/plugins/sdc/src/main/resources/onap-cli-schema/vsp/vsp-validate-schema-1.1.yaml b/plugins/sdc/src/main/resources/onap-cli-schema/vsp/vsp-validate-schema-1.1.yaml
new file mode 100644 (file)
index 0000000..243ddbb
--- /dev/null
@@ -0,0 +1,48 @@
+open_cli_schema_version: 1.0
+name: vsp-validate
+description: Validated the uploaded Vendor Software Product
+version: onap-1.1
+service:
+  name: sdc
+  version: v1.0
+  auth: basic
+  mode: direct
+
+parameters:
+  - name: vsp-id
+    description: Onap VSP ID
+    type: string
+    short_option: x
+    long_option: vsp-id
+    is_optional: false
+  - name: vsp-version
+    description: VSP version
+    type: string
+    short_option: y
+    long_option: vsp-version
+    is_optional: false
+
+results:
+  direction: portrait
+  attributes:
+    - name: status
+      description: Validation status
+      scope: short
+      type: string
+    - name: errors
+      description: Validation messages
+      scope: short
+      type: json
+
+http:
+  request:
+    uri: /onboarding-api/v1.0/vendor-software-products/${vsp-id}/versions/${vsp-version}/orchestration-template-candidate/process
+    method: PUT
+    body: '{}'
+  success_codes:
+    - 201
+    - 200
+  result_map:
+    status: $b{$.status}
+    errors: $b{$.errors}
+
diff --git a/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-validate-schema-1.1-moco.json b/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-validate-schema-1.1-moco.json
new file mode 100644 (file)
index 0000000..6dc8041
--- /dev/null
@@ -0,0 +1,46 @@
+[ {
+  "request" : {
+    "method" : "put",
+    "uri" : "/onboarding-api/v1.0/vendor-software-products/5ca119e2326045d1857ae3f04a816434/versions/0.1/orchestration-template-candidate/process",
+    "headers" : {
+      "Authorization" : "Basic Y3MwMDA4OmRlbW8xMjM0NTYh",
+      "X-FromAppId" : "onap-cli",
+      "Accept" : "application/json",
+      "USER_ID" : "cs0008",
+      "X-TransactionId" : "req-79f5d3d8-36b6-4b66-ad35-4666556ef022",
+      "Content-Type" : "application/json"
+    },
+    "json" : { }
+  },
+  "response" : {
+    "status" : 200,
+    "json" : {
+      "fileNames" : [ "base_vfw.yaml", "base_vfw.env" ],
+      "errors" : {
+        "base_vfw.yaml" : [ {
+          "level" : "WARNING",
+          "message" : "WARNING: Port 'Fixed_IPS' Parameter Name not aligned with Guidelines, Parameter Name [onap_private_subnet_id], Resource ID [vfw_private_2_port]. As a result, VF/VFC Profile may miss this information"
+        }, {
+          "level" : "WARNING",
+          "message" : "WARNING: Port 'Fixed_IPS' Parameter Name not aligned with Guidelines, Parameter Name [onap_private_subnet_id], Resource ID [vpg_private_1_port]. As a result, VF/VFC Profile may miss this information"
+        }, {
+          "level" : "WARNING",
+          "message" : "WARNING: Port 'Fixed_IPS' Parameter Name not aligned with Guidelines, Parameter Name [onap_private_subnet_id], Resource ID [vsn_private_1_port]. As a result, VF/VFC Profile may miss this information"
+        }, {
+          "level" : "WARNING",
+          "message" : "WARNING: A resource is connected twice to the same network role, Network Role [vpg_0], Resource ID [onap_private]"
+        }, {
+          "level" : "WARNING",
+          "message" : "WARNING: Nova Server naming convention in image, flavor and name properties is not consistent, Resource ID [vpg_0]"
+        }, {
+          "level" : "WARNING",
+          "message" : "WARNING: A resource is connected twice to the same network role, Network Role [vsn_0], Resource ID [onap_private]"
+        }, {
+          "level" : "WARNING",
+          "message" : "WARNING: Nova Server naming convention in image, flavor and name properties is not consistent, Resource ID [vsn_0]"
+        } ]
+      },
+      "status" : "Success"
+    }
+  }
+} ]
\ No newline at end of file
diff --git a/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-validate-schema-1.1-sample.yaml b/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-validate-schema-1.1-sample.yaml
new file mode 100644 (file)
index 0000000..119f5a8
--- /dev/null
@@ -0,0 +1,44 @@
+onap_cli_sample_version: 1.0
+name: vsp-validate
+version: onap-1.1
+samples:
+  sample1:
+    name: vsp-validate
+    input: --vsp-id 5ca119e2326045d1857ae3f04a816434 --vsp-version 0.1
+    moco: vsp-validate-schema-1.1-moco.json
+    ouput:|
+      +----------+----------------------------------------------------+
+      |property  |value                                               |
+      +----------+----------------------------------------------------+
+      |status    |Success                                             |
+      +----------+----------------------------------------------------+
+      |errors    |{base_vfw.yaml=[{"level":"WARNING","message":"WARN  |
+      |          |ING: Port 'Fixed_IPS' Parameter Name not aligned    |
+      |          |with Guidelines, Parameter Name                     |
+      |          |[onap_private_subnet_id], Resource ID               |
+      |          |[vfw_private_2_port]. As a result, VF\/VFC          |
+      |          |Profile may miss this information"},{"level":"WARN  |
+      |          |ING","message":"WARNING: Port 'Fixed_IPS'           |
+      |          |Parameter Name not aligned with Guidelines,         |
+      |          |Parameter Name [onap_private_subnet_id], Resource   |
+      |          |ID [vpg_private_1_port]. As a result, VF\/VFC       |
+      |          |Profile may miss this information"},{"level":"WARN  |
+      |          |ING","message":"WARNING: Port 'Fixed_IPS'           |
+      |          |Parameter Name not aligned with Guidelines,         |
+      |          |Parameter Name [onap_private_subnet_id], Resource   |
+      |          |ID [vsn_private_1_port]. As a result, VF\/VFC       |
+      |          |Profile may miss this information"},{"level":"WARN  |
+      |          |ING","message":"WARNING: A resource is connected    |
+      |          |twice to the same network role, Network Role        |
+      |          |[vpg_0], Resource ID [onap_private]"},{"level":"WA  |
+      |          |RNING","message":"WARNING: Nova Server naming       |
+      |          |convention in image, flavor and name properties     |
+      |          |is not consistent, Resource ID                      |
+      |          |[vpg_0]"},{"level":"WARNING","message":"WARNING:    |
+      |          |A resource is connected twice to the same network   |
+      |          |role, Network Role [vsn_0], Resource ID [onap_priv  |
+      |          |ate]"},{"level":"WARNING","message":"WARNING:       |
+      |          |Nova Server naming convention in image, flavor      |
+      |          |and name properties is not consistent, Resource     |
+      |          |ID [vsn_0]"}]}                                      |
+      +----------+----------------------------------------------------+