From 60ad596d8150ae73171ddb8d1c395130f94104b2 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Fri, 27 Oct 2017 19:10:30 +0530 Subject: Fix vsp-show commands with proper url CLI-57 Change-Id: I33482d9b3483a904e08ceef98deb1c5f25818e6c Signed-off-by: Kanagaraj Manickam k00365106 --- .../onap-cli-schema/vsp/vsp-show-schema-1.1.yaml | 75 +++++++++++++++++++ .../vsp/vsp-show-schema-1.1-moco.json | 85 ++++++++++++++++++++++ .../vsp/vsp-show-schema-1.1-sample.yaml | 21 ++++++ 3 files changed, 181 insertions(+) create mode 100644 plugins/sdc/src/main/resources/onap-cli-schema/vsp/vsp-show-schema-1.1.yaml create mode 100644 plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-show-schema-1.1-moco.json create mode 100644 plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-show-schema-1.1-sample.yaml diff --git a/plugins/sdc/src/main/resources/onap-cli-schema/vsp/vsp-show-schema-1.1.yaml b/plugins/sdc/src/main/resources/onap-cli-schema/vsp/vsp-show-schema-1.1.yaml new file mode 100644 index 00000000..785368cd --- /dev/null +++ b/plugins/sdc/src/main/resources/onap-cli-schema/vsp/vsp-show-schema-1.1.yaml @@ -0,0 +1,75 @@ +open_cli_schema_version: 1.0 +name: vsp-show +description: Details of the 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: Onap VSP version + type: string + short_option: y + long_option: vsp-version + is_optional: false +results: + direction: portrait + attributes: + - name: name + description: VSP Name + scope: short + type: string + - name: ID + description: VSP ID + scope: short + type: string + - name: description + description: Description for the VSP + scope: short + type: string + - name: vendor-name + description: Vendor name + scope: long + type: string + - name: vendor-id + description: Vendor id + scope: long + type: string + - name: version + description: Version + scope: short + type: string + - name: status + description: status + scope: short + type: string + - name: license-id + description: license aggreement + scope: long + type: string +http: + request: + uri: /onboarding-api/v1.0/vendor-software-products/${vsp-id}/versions/${vsp-version} + method: GET + success_codes: + - 200 + result_map: + ID: $b{$.id} + name: $b{$.name} + description: $b{$.description} + vendor-name: $b{$.vendorName} + vendor-id: $b{$.vendorId} + version: $b{$.version.id} + status: $b{$.status} + license-id: $b{$.licensingData.licenseAgreement} + sample_response: + body: '{"name":"test-vsp1","description":"vendor software product","category":"resourceNewCategory.generic","subCategory":"resourceNewCategory.generic.abstract","vendorName":"5aa8a88c","vendorId":"DBB202617952486691C1E35C9621CD4E","licensingVersion":"1.0","licensingData":{"licenseAgreement":"E19DBDDB137B494385F9535325BFD585","featureGroups":["94835F096DAF4ED78781A394A4F22AD1"]},"id":"354BF3E32E494EAFBB15037CFAB262FF","version":"0.1","viewableVersions":["0.1"],"status":"Locked","lockingUser":"cs0008"}' diff --git a/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-show-schema-1.1-moco.json b/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-show-schema-1.1-moco.json new file mode 100644 index 00000000..1913e808 --- /dev/null +++ b/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-show-schema-1.1-moco.json @@ -0,0 +1,85 @@ +[ { + "request" : { + "method" : "get", + "uri" : "/onboarding-api/v1.0/vendor-software-products/b1caa2ec31ba4b738cbe5aab362b35aa/versions/1.0", + "headers" : { + "Authorization" : "Basic Y3MwMDA4OmRlbW8xMjM0NTYh", + "X-FromAppId" : "onap-cli", + "Accept" : "application/json", + "USER_ID" : "cs0008", + "X-TransactionId" : "req-0e7abd26-8f59-463a-be04-5855c548297e", + "Content-Type" : "application/json" + }, + "json" : null + }, + "response" : { + "status" : 200, + "json" : { + "name" : "Kanag-VSP", + "description" : "Test VSP created by Kanag", + "category" : "resourceNewCategory.generic", + "subCategory" : "resourceNewCategory.generic.abstract", + "vendorName" : "Kanag", + "vendorId" : "1173c7be5fea4db799b1a5ef9512e57e", + "licensingVersion" : { + "id" : "4.0", + "label" : "4.0" + }, + "licensingData" : { + "licenseAgreement" : "b373c16f28854c6db9e027929ae5e5ed", + "featureGroups" : [ "efea8b9817b344c4b93c45dc141f6703" ] + }, + "onboardingMethod" : "NetworkPackage", + "onboardingOrigin" : "zip", + "networkPackageName" : "base_vfw", + "id" : "b1caa2ec31ba4b738cbe5aab362b35aa", + "version" : { + "id" : "1.0", + "label" : "1.0" + }, + "viewableVersions" : [ { + "id" : "1.0", + "label" : "1.0" + } ], + "finalVersions" : [ { + "id" : "1.0", + "label" : "1.0" + } ], + "status" : "Final", + "validationData" : { + "importStructure" : { + "heat" : [ { + "fileName" : "base_vfw.yaml", + "env" : { + "fileName" : "base_vfw.env" + }, + "errors" : [ { + "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]" + } ], + "base" : true + } ] + } + }, + "isOldVersion" : "False" + } + } +} ] \ No newline at end of file diff --git a/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-show-schema-1.1-sample.yaml b/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-show-schema-1.1-sample.yaml new file mode 100644 index 00000000..e40e9314 --- /dev/null +++ b/plugins/sdc/src/test/resources/onap-cli-sample/vsp/vsp-show-schema-1.1-sample.yaml @@ -0,0 +1,21 @@ +onap_cli_sample_version: 1.0 +name: vsp-show +version: onap-1.1 +samples: + sample1: + name: vsp-show + input: --vsp-id b1caa2ec31ba4b738cbe5aab362b35aa --vsp-version 1.0 -d + moco: vsp-show-schema-1.1-moco.json + ouput:| + |property |value | + +--------------+----------------------------------+ + |name |Kanag-VSP | + +--------------+----------------------------------+ + |ID |b1caa2ec31ba4b738cbe5aab362b35aa | + +--------------+----------------------------------+ + |description |Test VSP created by Kanag | + +--------------+----------------------------------+ + |version |1.0 | + +--------------+----------------------------------+ + |status |Final | + +--------------+----------------------------------+ -- cgit 1.2.3-korg