Add samples and command vsp-create for 1.1 09/21209/1
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Mon, 30 Oct 2017 04:40:55 +0000 (10:10 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Mon, 30 Oct 2017 04:40:55 +0000 (10:10 +0530)
CLI-57

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

diff --git a/plugins/sdc/src/main/resources/onap-cli-schema/vsp/vsp-create-schema-1.1.yaml b/plugins/sdc/src/main/resources/onap-cli-schema/vsp/vsp-create-schema-1.1.yaml
new file mode 100644 (file)
index 0000000..7e2dda7
--- /dev/null
@@ -0,0 +1,86 @@
+open_cli_schema_version: 1.0
+name: vsp-create
+description: Create Vendor Software Product
+version: onap-1.1
+service:
+  name: sdc
+  version: v1.0
+  auth: basic
+  mode: direct
+
+parameters:
+  - name: vsp-name
+    description: Onap VSP Name
+    type: string
+    short_option: x
+    long_option: vsp-name
+    is_optional: false
+  - name: vsp-description
+    description: Description for VSP
+    type: string
+    short_option: y
+    long_option: vsp-description
+    is_optional: true
+  - name: vsp-category
+    description: Category of the VSP
+    type: string
+    long_option: vsp-category
+    short_option: z
+    is_optional: true
+    default_value: resourceNewCategory.generic
+  - name: vsp-subcategory
+    description: Sub Category of VSP
+    type: string
+    long_option: vsp-subcategory
+    short_option: b
+    is_optional: true
+    default_value: resourceNewCategory.generic.abstract
+  - name: vsp-license-version
+    description: License version
+    type: string
+    long_option: vsp-license-version
+    short_option: c
+    is_optional: true
+    default_value: 1.0
+  - name: vsp-vendor-name
+    description: License Model Name
+    type: string
+    long_option: vsp-vendor-name
+    short_option: e
+    is_optional: false
+  - name: vsp-vendor-id
+    description: License Model ID
+    type: string
+    long_option: vsp-vendor-id
+    short_option: g
+    is_optional: false
+  - name: license-agreement-id
+    description: License Agreement ID
+    type: string
+    long_option: license-agreement-id
+    short_option: i
+    is_optional: false
+  - name: feature-group-id
+    description: Feature Group ID
+    type: string
+    long_option: feature-group-id
+    short_option: j
+    is_optional: false
+results:
+  direction: portrait
+  attributes:
+    - name: ID
+      description: VSP ID
+      scope: short
+      type: string
+http:
+  request:
+    uri: /onboarding-api/v1.0/vendor-software-products
+    method: POST
+    body: '{"category": "${vsp-category}", "vendorId": "${vsp-vendor-id}", "subCategory": "${vsp-subcategory}", "description": "${vsp-description}", "licensingVersion": {"id": "${vsp-license-version}", "label": "${vsp-license-version}"}, "licensingData": {"featureGroups": ["${feature-group-id}"], "licenseAgreement": "${license-agreement-id}"}, "icon": "icon", "onboardingMethod": "NetworkPackage", "vendorName": "${vsp-vendor-name}", "name": "${vsp-name}"}'
+  success_codes:
+    - 200
+  result_map:
+    ID: $b{$.vspId}
+  sample_response:
+    body: '{"vspId":"2DEB6CB4B082415BB7A697C9CD1273BA"}'
diff --git a/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-create-schema-1.1-moco.json b/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-create-schema-1.1-moco.json
new file mode 100644 (file)
index 0000000..6e7253f
--- /dev/null
@@ -0,0 +1,38 @@
+[ {
+  "request" : {
+    "method" : "post",
+    "uri" : "/onboarding-api/v1.0/vendor-software-products",
+    "headers" : {
+      "Authorization" : "Basic Y3MwMDA4OmRlbW8xMjM0NTYh",
+      "X-FromAppId" : "onap-cli",
+      "Accept" : "application/json",
+      "USER_ID" : "cs0008",
+      "X-TransactionId" : "req-aa703f95-a8ab-4c5c-8971-40e73df98a28",
+      "Content-Type" : "application/json"
+    },
+    "json" : {
+      "category" : "resourceNewCategory.generic",
+      "vendorId" : "b1caa2ec31ba4b738cbe5aab362b35aa",
+      "subCategory" : "resourceNewCategory.generic.abstract",
+      "description" : "VSP created from CLI for vFW",
+      "licensingVersion" : {
+        "id" : "4.0",
+        "label" : "4.0"
+      },
+      "licensingData" : {
+        "featureGroups" : [ "efea8b9817b344c4b93c45dc141f6703" ],
+        "licenseAgreement" : "b373c16f28854c6db9e027929ae5e5ed"
+      },
+      "icon" : "icon",
+      "onboardingMethod" : "NetworkPackage",
+      "vendorName" : "Kanag",
+      "name" : "kanag-cli-vfw"
+    }
+  },
+  "response" : {
+    "status" : 200,
+    "json" : {
+      "vspId" : "5ca119e2326045d1857ae3f04a816434"
+    }
+  }
+} ]
\ No newline at end of file
diff --git a/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-create-schema-1.1-sample.yaml b/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-create-schema-1.1-sample.yaml
new file mode 100644 (file)
index 0000000..aba98a1
--- /dev/null
@@ -0,0 +1,13 @@
+onap_cli_sample_version: 1.0
+name: vsp-create
+version: onap-1.1
+samples:
+  sample1:
+    name: vsp-create
+    input: --vsp-name kanag-cli-vfw --vsp-description VSP created from CLI for vFW --vsp-vendor-name Kanag --vsp-vendor-id b1caa2ec31ba4b738cbe5aab362b35aa --license-agreement-id b373c16f28854c6db9e027929ae5e5ed --feature-group-id efea8b9817b344c4b93c45dc141f6703 -d --vsp-license-version 4.0
+    moco: vsp-create-schema-1.1-moco.json
+    ouput:|
+      |property  |value                             |
+      +----------+----------------------------------+
+      |ID        |5ca119e2326045d1857ae3f04a816434  |
+      +----------+----------------------------------+