From 603a5a4aa9ee8c00a3ca081b98e9f19c0606b0da Mon Sep 17 00:00:00 2001 From: Kanagaraj M Date: Fri, 2 Aug 2019 12:53:15 +0530 Subject: Set SNAPSHOT versioning Issue-ID: CLI-169 Change-Id: I37930d594df46a9cf306d66db3ba212237041e0c Signed-off-by: Kanagaraj Manickam k00365106 --- products/onap-dublin/auth/pom.xml | 2 +- products/onap-dublin/catalog/pom.xml | 2 +- products/onap-dublin/features/aai/pom.xml | 2 +- products/onap-dublin/features/msb/pom.xml | 2 +- products/onap-dublin/features/multicloud/pom.xml | 2 +- products/onap-dublin/features/policy/pom.xml | 2 +- products/onap-dublin/features/pom.xml | 47 +++++++++++++++++++++++- products/onap-dublin/features/sdc/pom.xml | 2 +- products/onap-dublin/features/sdnc/pom.xml | 2 +- products/onap-dublin/features/so/pom.xml | 2 +- products/onap-dublin/features/vfc/pom.xml | 2 +- products/onap-dublin/features/vnfsdk/pom.xml | 2 +- products/onap-dublin/pom.xml | 2 +- 13 files changed, 58 insertions(+), 13 deletions(-) (limited to 'products/onap-dublin') diff --git a/products/onap-dublin/auth/pom.xml b/products/onap-dublin/auth/pom.xml index e3dd7f81..42892c9a 100644 --- a/products/onap-dublin/auth/pom.xml +++ b/products/onap-dublin/auth/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products-onap-dublin - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin-auth diff --git a/products/onap-dublin/catalog/pom.xml b/products/onap-dublin/catalog/pom.xml index 55e35337..d5bff21d 100644 --- a/products/onap-dublin/catalog/pom.xml +++ b/products/onap-dublin/catalog/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products-onap-dublin - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin-catalog diff --git a/products/onap-dublin/features/aai/pom.xml b/products/onap-dublin/features/aai/pom.xml index 0383c0bc..f774302c 100644 --- a/products/onap-dublin/features/aai/pom.xml +++ b/products/onap-dublin/features/aai/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products-onap-dublin-features - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin-features-aai diff --git a/products/onap-dublin/features/msb/pom.xml b/products/onap-dublin/features/msb/pom.xml index 57f9eae2..ae8e044a 100644 --- a/products/onap-dublin/features/msb/pom.xml +++ b/products/onap-dublin/features/msb/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products-onap-dublin-features - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin-features-msb diff --git a/products/onap-dublin/features/multicloud/pom.xml b/products/onap-dublin/features/multicloud/pom.xml index aadb0814..06d2ee91 100644 --- a/products/onap-dublin/features/multicloud/pom.xml +++ b/products/onap-dublin/features/multicloud/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products-onap-dublin-features - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin-features-multicloud diff --git a/products/onap-dublin/features/policy/pom.xml b/products/onap-dublin/features/policy/pom.xml index aeca79ea..f7a885e8 100644 --- a/products/onap-dublin/features/policy/pom.xml +++ b/products/onap-dublin/features/policy/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products-onap-dublin-features - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin-features-policy diff --git a/products/onap-dublin/features/pom.xml b/products/onap-dublin/features/pom.xml index 23a2d640..4fa428b5 100644 --- a/products/onap-dublin/features/pom.xml +++ b/products/onap-dublin/features/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products-onap-dublin - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin-features @@ -46,6 +46,51 @@ + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + copy-resource-script + install + + copy-resources + + + + ../../../../products/target/script + + + ${project.basedir}/src/main/resources/script + + *.* + + + + + + + copy-resource-conf + install + + copy-resources + + + + ../../../../products/target/conf + + + ${project.basedir}/src/main/resources/conf + + *.* + + + + + + + org.apache.maven.plugins maven-dependency-plugin diff --git a/products/onap-dublin/features/sdc/pom.xml b/products/onap-dublin/features/sdc/pom.xml index 8a91f7b4..b0cded4a 100644 --- a/products/onap-dublin/features/sdc/pom.xml +++ b/products/onap-dublin/features/sdc/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products-onap-dublin-features - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin-features-sdc diff --git a/products/onap-dublin/features/sdnc/pom.xml b/products/onap-dublin/features/sdnc/pom.xml index 14d30bee..48fdfcd7 100644 --- a/products/onap-dublin/features/sdnc/pom.xml +++ b/products/onap-dublin/features/sdnc/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products-onap-dublin-features - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin-features-sdnc diff --git a/products/onap-dublin/features/so/pom.xml b/products/onap-dublin/features/so/pom.xml index d2774d60..00f99c77 100644 --- a/products/onap-dublin/features/so/pom.xml +++ b/products/onap-dublin/features/so/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products-onap-dublin-features - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin-features-so diff --git a/products/onap-dublin/features/vfc/pom.xml b/products/onap-dublin/features/vfc/pom.xml index f7cc3c3d..28fd7fb3 100644 --- a/products/onap-dublin/features/vfc/pom.xml +++ b/products/onap-dublin/features/vfc/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products-onap-dublin-features - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin-features-vfc diff --git a/products/onap-dublin/features/vnfsdk/pom.xml b/products/onap-dublin/features/vnfsdk/pom.xml index 0117c3f7..dd5ae244 100644 --- a/products/onap-dublin/features/vnfsdk/pom.xml +++ b/products/onap-dublin/features/vnfsdk/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products-onap-dublin-features - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin-features-vnfsdk diff --git a/products/onap-dublin/pom.xml b/products/onap-dublin/pom.xml index 25c42165..596ee9be 100644 --- a/products/onap-dublin/pom.xml +++ b/products/onap-dublin/pom.xml @@ -24,7 +24,7 @@ org.onap.cli cli-products - 3.0.0 + 4.0.0-SNAPSHOT cli-products-onap-dublin -- cgit 1.2.3-korg From 658c717148d92c42e9ae737ded466bd6ac007d13 Mon Sep 17 00:00:00 2001 From: Kanagaraj M Date: Fri, 2 Aug 2019 13:51:21 +0530 Subject: Add ID output in service-model commands Issue-ID: CLI-169 Change-Id: I1005c605e656f755acc1593af828383d6613cf8a Signed-off-by: Kanagaraj Manickam k00365106 --- .../service-model/service-model-add-vf-schema-dublin.yaml | 5 +++++ .../service-model/service-model-checkout-schema-dublin.yaml | 9 +++++++++ .../service-model/service2vf-model-list-schema-dublin.yaml | 5 +++++ 3 files changed, 19 insertions(+) (limited to 'products/onap-dublin') diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-add-vf-schema-dublin.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-add-vf-schema-dublin.yaml index 63454976..06b4c4fb 100644 --- a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-add-vf-schema-dublin.yaml +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-add-vf-schema-dublin.yaml @@ -55,6 +55,10 @@ results: description: Service ID scope: short type: string + - name: UUID + description: Service UUID + scope: short + type: string http: service: name: sdc @@ -69,3 +73,4 @@ http: - 201 result_map: ID: $b{$.uniqueId} + UUID: $b{$.componentUid} \ No newline at end of file diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-checkout-schema-dublin.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-checkout-schema-dublin.yaml index 9201e7fa..ec0ccc6d 100644 --- a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-checkout-schema-dublin.yaml +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-checkout-schema-dublin.yaml @@ -30,6 +30,13 @@ parameters: short_option: b is_optional: true +results: + direction: portrait + attributes: + - name: ID + description: NS checked out version unique ID + scope: short + type: string http: service: name: sdc @@ -42,3 +49,5 @@ http: body: '{}' success_codes: - 200 + result_map: + ID: $b{$.uniqueId} \ No newline at end of file diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service2vf-model-list-schema-dublin.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service2vf-model-list-schema-dublin.yaml index bd4c38c6..2241e05c 100644 --- a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service2vf-model-list-schema-dublin.yaml +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service2vf-model-list-schema-dublin.yaml @@ -49,6 +49,10 @@ results: description: version type: string scope: short + - name: vf-unique-uuid + description: customization UUID + type: string + scope: short http: service: @@ -62,6 +66,7 @@ http: success_codes: - 200 result_map: + vf-unique-uuid: $b{componentInstances.[*].uniqueId} vf-uuid: $b{componentInstances.[*].componentUid} vf-name: $b{componentInstances.[*].componentName} vf-version: $b{componentInstances.[*].componentVersion} -- cgit 1.2.3-korg From 2432b87738c0494c0f5127615e7497e119642ae6 Mon Sep 17 00:00:00 2001 From: Kanagaraj M Date: Fri, 2 Aug 2019 13:53:05 +0530 Subject: Add sdc consumer create command Issue-ID: CLI-169 Change-Id: Ib629f78eb72b02e244c75bcd6aea496aa8fa9825 Signed-off-by: Kanagaraj Manickam k00365106 --- .../sdc-consumer-create-schema-dublin-moco.json | 31 ++++++++++ .../sdc-consumer-create-schema-dublin-sample.yaml | 9 +++ .../sdc-consumer-create-schema-dublin.yaml | 70 ++++++++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-create-schema-dublin-moco.json create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-create-schema-dublin-sample.yaml create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/consumer/sdc-consumer-create-schema-dublin.yaml (limited to 'products/onap-dublin') diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-create-schema-dublin-moco.json b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-create-schema-dublin-moco.json new file mode 100644 index 00000000..71bce5dd --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-create-schema-dublin-moco.json @@ -0,0 +1,31 @@ +[ { + "request" : { + "method" : "post", + "uri" : "/sdc2/rest/v1/consumers", + "headers" : { + "Accept" : "application/json", + "USER_ID" : "jh0003", + "Content-Type" : "application/json" + }, + "json" : { + "consumerName" : "mrkanag", + "consumerSalt" : "ab2987754f0c6293174865e86c47035d", + "consumerPassword" : "7fa005e6e478ee677053a2c4a5c2f11190e2aa8be227a037291ea4cbc074ecb6" + } + }, + "response" : { + "status" : 201, + "json" : { + "consumerName" : "mrkanag", + "consumerPassword" : "7fa005e6e478ee677053a2c4a5c2f11190e2aa8be227a037291ea4cbc074ecb6", + "consumerSalt" : "ab2987754f0c6293174865e86c47035d", + "consumerLastAuthenticationTime" : 0, + "consumerDetailsLastupdatedtime" : 1564379189744, + "lastModfierAtuid" : "jh0003", + "version" : null, + "ownerId" : null, + "empty" : false, + "type" : null + } + } +} ] \ No newline at end of file diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-create-schema-dublin-sample.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-create-schema-dublin-sample.yaml new file mode 100644 index 00000000..f043ad70 --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-create-schema-dublin-sample.yaml @@ -0,0 +1,9 @@ +open_cli_sample_version: 1.0 +name: --host-url +version: open-cli +samples: + sample1: + name: --host-url + input: https://159.138.32.178:30204 --consumer-name mrkanag --debug + moco: sdc-consumer-create-schema-dublin-moco.json + output: \ No newline at end of file diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/consumer/sdc-consumer-create-schema-dublin.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/consumer/sdc-consumer-create-schema-dublin.yaml new file mode 100644 index 00000000..20077715 --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/consumer/sdc-consumer-create-schema-dublin.yaml @@ -0,0 +1,70 @@ +# Copyright 2019 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +open_cli_schema_version: 1.0 +name: sdc-consumer-create +description: Create SDC consumer + +info: + product: onap-dublin + service: sdc + author: ONAP CLI Team onap-discuss@lists.onap.org + +parameters: + - name: consumer-name + description: Consumer Name + type: string + short_option: x + long_option: consumer-name + is_optional: false + - name: consumer-password + description: Consumer password + type: string + short_option: y + long_option: consumer-password + is_optional: true + default_value: 7fa005e6e478ee677053a2c4a5c2f11190e2aa8be227a037291ea4cbc074ecb6 + - name: salt + description: Salt + type: string + long_option: salt + short_option: c + is_optional: true + default_value: ab2987754f0c6293174865e86c47035d + - name: user-id + description: Designer user id + type: string + long_option: user-id + short_option: e + default_value: jh0003 + is_optional: true +http: + service: + name: sdc + version: v1.0 + auth: none + mode: direct + request: + uri: /sdc2/rest/v1/consumers + method: POST + headers: + USER_ID: ${user-id} + body: '{ + "consumerName": "${consumer-name}", + "consumerSalt": "${salt}", + "consumerPassword": "${consumer-password}" + }' + success_codes: + - 200 + - 201 -- cgit 1.2.3-korg From d940285c64c4e25d59ec1420800a146dcce2e548 Mon Sep 17 00:00:00 2001 From: Kanagaraj M Date: Fri, 2 Aug 2019 13:53:49 +0530 Subject: Add sdc consumer-show command Issue-ID: CLI-169 Change-Id: I602194bda91d8184b2b1790bfea9a0dfccf9baa6 Signed-off-by: Kanagaraj Manickam k00365106 --- .../sdc-consumer-show-schema-dublin-moco.json | 27 +++++++++ .../sdc-consumer-show-schema-dublin-sample.yaml | 9 +++ .../consumer/sdc-consumer-show-schema-dublin.yaml | 66 ++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-show-schema-dublin-moco.json create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-show-schema-dublin-sample.yaml create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/consumer/sdc-consumer-show-schema-dublin.yaml (limited to 'products/onap-dublin') diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-show-schema-dublin-moco.json b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-show-schema-dublin-moco.json new file mode 100644 index 00000000..7f025f67 --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-show-schema-dublin-moco.json @@ -0,0 +1,27 @@ +[ { + "request" : { + "method" : "get", + "uri" : "/sdc2/rest/v1/consumers/mrkanag", + "headers" : { + "Accept" : "application/json", + "USER_ID" : "jh0003", + "Content-Type" : "application/json" + }, + "json" : null + }, + "response" : { + "status" : 200, + "json" : { + "consumerName" : "mrkanag", + "consumerPassword" : "7fa005e6e478ee677053a2c4a5c2f11190e2aa8be227a037291ea4cbc074ecb6", + "consumerSalt" : "ab2987754f0c6293174865e86c47035d", + "consumerLastAuthenticationTime" : 0, + "consumerDetailsLastupdatedtime" : 1564379189744, + "lastModfierAtuid" : "jh0003", + "version" : null, + "ownerId" : null, + "empty" : false, + "type" : null + } + } +} ] \ No newline at end of file diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-show-schema-dublin-sample.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-show-schema-dublin-sample.yaml new file mode 100644 index 00000000..4b3571d6 --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/consumer/sdc-consumer-show-schema-dublin-sample.yaml @@ -0,0 +1,9 @@ +open_cli_sample_version: 1.0 +name: --host-url +version: open-cli +samples: + sample1: + name: --host-url + input: https://159.138.32.178:30204 --consumer-name mrkanag --debug + moco: sdc-consumer-show-schema-dublin-moco.json + output: | diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/consumer/sdc-consumer-show-schema-dublin.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/consumer/sdc-consumer-show-schema-dublin.yaml new file mode 100644 index 00000000..5de269e4 --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/consumer/sdc-consumer-show-schema-dublin.yaml @@ -0,0 +1,66 @@ +# Copyright 2019 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +open_cli_schema_version: 1.0 +name: sdc-consumer-show +description: Retrieve SDC consumer + +info: + product: onap-dublin + service: sdc + author: ONAP CLI Team onap-discuss@lists.onap.org + +parameters: + - name: consumer-name + description: Consumer Name + type: string + short_option: x + long_option: consumer-name + is_optional: false + - name: user-id + description: Designer user id + type: string + long_option: user-id + short_option: e + default_value: jh0003 + is_optional: true +results: + direction: portrait + attributes: + - name: consumer-password + description: Consumer password + type: string + scope: short + - name: salt + description: Salt + type: string + scope: short + +http: + service: + name: sdc + version: v1.0 + auth: none + mode: direct + request: + uri: /sdc2/rest/v1/consumers/${consumer-name} + method: GET + headers: + USER_ID: ${user-id} + success_codes: + - 200 + - 201 + result_map: + consumer-password: $b{$.consumerPassword} + salt: $b{$.consumerSalt} \ No newline at end of file -- cgit 1.2.3-korg From 7db313b7a5dbdd1a5f8bdb1e461fee38c19ded15 Mon Sep 17 00:00:00 2001 From: Kanagaraj M Date: Fri, 2 Aug 2019 13:55:27 +0530 Subject: Add sdc service resource property set Issue-ID: CLI-169 Change-Id: I04f10d7dbe21830fc7b2526852b2e4d932272728 Signed-off-by: Kanagaraj Manickam k00365106 --- .../service-model/ns-model-set-property-moco.json | 154 +++++++++++++++++++++ .../ns-model-set-property-sample.yaml | 9 ++ .../service-model/service-model-set-property.yaml | 67 +++++++++ 3 files changed, 230 insertions(+) create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/service-model/ns-model-set-property-moco.json create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/service-model/ns-model-set-property-sample.yaml create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-set-property.yaml (limited to 'products/onap-dublin') diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/service-model/ns-model-set-property-moco.json b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/service-model/ns-model-set-property-moco.json new file mode 100644 index 00000000..2e265288 --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/service-model/ns-model-set-property-moco.json @@ -0,0 +1,154 @@ +[ { + "request" : { + "method" : "post", + "uri" : "/sdc2/rest/v1/catalog/services/66bc211e-27a1-4a1c-aee3-75952617b7fe/resourceInstance/ff654717-85e1-4458-a9ce-7dedca7be552.3694ef05-56e3-44d0-9103-7805ef8d2929.extztecp0/properties", + "headers" : { + "Authorization" : "Basic Y3MwMDA4OmRlbW8xMjM0NTYh", + "X-FromAppId" : "ONAP CLI", + "Accept" : "application/json", + "USER_ID" : "cs0008", + "X-TransactionId" : "req-a5f3d3a6-f407-4abd-81b1-b4906c039783", + "Content-Type" : "application/json" + }, + "json" : [ { + "constraints" : null, + "defaultValue" : null, + "description" : null, + "name" : "ip_address", + "parentUniqueId" : null, + "password" : false, + "required" : false, + "schema" : { + "property" : { } + }, + "schemaType" : null, + "type" : "string", + "uniqueId" : "3694ef05-56e3-44d0-9103-7805ef8d2929.ip_address", + "value" : "1.1.1.2", + "definition" : false, + "getInputValues" : null, + "parentPropertyType" : null, + "subPropertyInputPath" : null, + "toscaPresentation" : { + "ownerId" : null + }, + "getPolicyValues" : null, + "inputPath" : null + } ] + }, + "response" : { + "status" : 200, + "json" : [ { + "uniqueId" : "3694ef05-56e3-44d0-9103-7805ef8d2929.ip_address", + "type" : "string", + "required" : false, + "definition" : false, + "defaultValue" : null, + "description" : null, + "schema" : { + "derivedFrom" : null, + "constraints" : null, + "properties" : null, + "property" : { + "uniqueId" : null, + "type" : null, + "required" : false, + "definition" : true, + "defaultValue" : null, + "description" : null, + "schema" : null, + "password" : false, + "name" : null, + "value" : null, + "label" : null, + "hidden" : false, + "immutable" : false, + "inputPath" : null, + "status" : null, + "inputId" : null, + "instanceUniqueId" : null, + "propertyId" : null, + "parentPropertyType" : null, + "subPropertyInputPath" : null, + "annotations" : null, + "parentUniqueId" : null, + "getInputValues" : null, + "isDeclaredListInput" : false, + "getPolicyValues" : null, + "getInputProperty" : false, + "schemaType" : null, + "schemaProperty" : null, + "version" : null, + "ownerId" : null, + "empty" : false + }, + "version" : null, + "ownerId" : null, + "empty" : false, + "type" : null + }, + "password" : false, + "name" : "ip_address", + "value" : "1.1.1.2", + "label" : null, + "hidden" : false, + "immutable" : false, + "inputPath" : null, + "status" : null, + "inputId" : null, + "instanceUniqueId" : null, + "propertyId" : null, + "parentPropertyType" : null, + "subPropertyInputPath" : null, + "annotations" : null, + "parentUniqueId" : null, + "getInputValues" : null, + "isDeclaredListInput" : false, + "getPolicyValues" : null, + "constraints" : [ ], + "valueUniqueUid" : null, + "path" : [ "ff654717-85e1-4458-a9ce-7dedca7be552.3694ef05-56e3-44d0-9103-7805ef8d2929.extztecp0" ], + "rules" : null, + "componentInstanceName" : null, + "componentInstanceId" : null, + "getInputProperty" : false, + "schemaType" : null, + "schemaProperty" : { + "uniqueId" : null, + "type" : null, + "required" : false, + "definition" : true, + "defaultValue" : null, + "description" : null, + "schema" : null, + "password" : false, + "name" : null, + "value" : null, + "label" : null, + "hidden" : false, + "immutable" : false, + "inputPath" : null, + "status" : null, + "inputId" : null, + "instanceUniqueId" : null, + "propertyId" : null, + "parentPropertyType" : null, + "subPropertyInputPath" : null, + "annotations" : null, + "parentUniqueId" : null, + "getInputValues" : null, + "isDeclaredListInput" : false, + "getPolicyValues" : null, + "getInputProperty" : false, + "schemaType" : null, + "schemaProperty" : null, + "version" : null, + "ownerId" : null, + "empty" : false + }, + "version" : null, + "ownerId" : null, + "empty" : false + } ] + } +} ] \ No newline at end of file diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/service-model/ns-model-set-property-sample.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/service-model/ns-model-set-property-sample.yaml new file mode 100644 index 00000000..540bb0f8 --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/service-model/ns-model-set-property-sample.yaml @@ -0,0 +1,9 @@ +open_cli_sample_version: 1.0 +name: --host-url +version: open-cli +samples: + sample1: + name: --host-url + input: https://159.138.32.178:30204 --host-username cs0008 --host-password demo123456! --service-uniqueId 66bc211e-27a1-4a1c-aee3-75952617b7fe --resource-uuid 3694ef05-56e3-44d0-9103-7805ef8d2929 --resource-uniqueId ff654717-85e1-4458-a9ce-7dedca7be552.3694ef05-56e3-44d0-9103-7805ef8d2929.extztecp0 --property-name ip_address --property-value 1.1.1.2 --debug + moco: ns-model-set-property-moco.json + output: \ No newline at end of file diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-set-property.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-set-property.yaml new file mode 100644 index 00000000..a7ea76b7 --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-set-property.yaml @@ -0,0 +1,67 @@ +# Copyright 2019 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +open_cli_schema_version: 1.0 +name: service-model-set-property +description: Set property to a service model + +info: + product: onap-dublin + service: sdc + author: ONAP HPA Team onap-discuss@lists.onap.org + + +parameters: + - name: service-uniqueId + description: service UniqueId + type: string + long_option: service-uniqueId + short_option: x + is_optional: false + - name: resource-uuid + description: resource uuid + type: string + long_option: resource-uuid + short_option: y + is_optional: false + - name: resource-uniqueId + description: resource UniqueId + type: string + long_option: resource-uniqueId + short_option: z + is_optional: false + - name: property-name + description: property name + type: string + long_option: property-name + short_option: b + is_optional: false + - name: property-value + description: property value + type: string + long_option: property-value + short_option: r + is_optional: false +http: + service: + name: sdc + version: v1.0 + auth: basic + mode: direct + request: + uri: /sdc2/rest/v1/catalog/services/${service-uniqueId}/resourceInstance/${resource-uniqueId}/properties + method: POST + body: '[{"constraints":null,"defaultValue":null,"description":null,"name":"${property-name}","parentUniqueId":null,"password":false,"required":false,"schema":{"property":{}},"schemaType":null,"type":"string","uniqueId":"${resource-uuid}.${property-name}","value":"${property-value}","definition":false,"getInputValues":null,"parentPropertyType":null,"subPropertyInputPath":null,"toscaPresentation":{"ownerId":null},"getPolicyValues":null,"inputPath":null}]' + success_codes: + - 200 -- cgit 1.2.3-korg From e37f93825f352caceebc9976d3834134cd933f99 Mon Sep 17 00:00:00 2001 From: Kanagaraj M Date: Fri, 2 Aug 2019 13:57:01 +0530 Subject: Add VF checkin command Issue-ID: CLI-169 Change-Id: I86df570ef28100c61b79e9074caba4794a62436c Signed-off-by: Kanagaraj Manickam k00365106 --- .../vf/vf-model-checkin-schema-dublin-moco.json | 72 ++++++++++++++++++++++ .../vf/vf-model-checkin-schema-dublin-sample.yaml | 9 +++ .../vf/vf-model-checkin-schema-dublin.yaml | 50 +++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkin-schema-dublin-moco.json create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkin-schema-dublin-sample.yaml create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-checkin-schema-dublin.yaml (limited to 'products/onap-dublin') diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkin-schema-dublin-moco.json b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkin-schema-dublin-moco.json new file mode 100644 index 00000000..e572c8ee --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkin-schema-dublin-moco.json @@ -0,0 +1,72 @@ +[ { + "request" : { + "method" : "post", + "uri" : "/sdc2/rest/v1/catalog/resources/c5d9a74a-c617-4542-8b83-31c4d8a7269b/lifecycleState/CHECKIN", + "headers" : { + "Authorization" : "Basic Y3MwMDA4OmRlbW8xMjM0NTYh", + "X-FromAppId" : "ONAP CLI", + "Accept" : "application/json", + "USER_ID" : "cs0008", + "X-TransactionId" : "req-26632f77-01a9-4a8a-949b-34b42544d67e", + "Content-Type" : "application/json" + }, + "json" : { + "userRemarks" : "Checked in by ONAP CLI" + } + }, + "response" : { + "status" : 200, + "json" : { + "uniqueId" : "c5d9a74a-c617-4542-8b83-31c4d8a7269b", + "name" : "ovp-test", + "version" : "1.4", + "isHighestVersion" : true, + "creationDate" : 1564379661410, + "lastUpdateDate" : 1564379845325, + "description" : "ovp-test", + "lifecycleState" : "NOT_CERTIFIED_CHECKIN", + "tags" : [ "ovp-test" ], + "icon" : "defaulticon", + "normalizedName" : "ovptest", + "systemName" : "OvpTest", + "contactId" : "cs0008", + "allVersions" : { + "1.0" : "3f0de55b-90be-459d-a30f-a24553baacaa", + "1.1" : "53235bc8-2619-4d23-b1f6-e41e64d0af47", + "1.2" : "ef2ce8c3-af1c-480a-a12f-6bd1fe0384f4", + "1.3" : "168c1a0d-82d8-4a86-a934-9e685389516f", + "1.4" : "c5d9a74a-c617-4542-8b83-31c4d8a7269b" + }, + "csarUUID" : "aa92c8177d754587b621a951a522a942", + "csarVersion" : "1.0", + "invariantUUID" : "c918f6b2-5067-4c10-91a8-672964f3fd10", + "componentType" : "RESOURCE", + "categories" : [ { + "name" : "Generic", + "normalizedName" : "generic", + "uniqueId" : "resourceNewCategory.generic", + "subcategories" : [ { + "name" : "Network Elements", + "normalizedName" : "network elements", + "uniqueId" : "resourceNewCategory.generic.network elements", + "icons" : [ "network", "connector" ], + "empty" : false + } ], + "empty" : false + } ], + "creatorUserId" : "cs0008", + "creatorFullName" : "Carlos Santana", + "lastUpdaterUserId" : "cs0008", + "lastUpdaterFullName" : "Carlos Santana", + "archiveTime" : 0, + "vendorName" : "onap", + "vendorRelease" : "1.0", + "resourceVendorModelNumber" : "", + "resourceType" : "VF", + "toscaResourceName" : "org.openecomp.resource.vf.OvpTest", + "vspArchived" : false, + "archived" : false, + "uuid" : "24d20439-1d8c-44dc-acaf-cb0929a6a5f3" + } + } +} ] \ No newline at end of file diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkin-schema-dublin-sample.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkin-schema-dublin-sample.yaml new file mode 100644 index 00000000..940a5fb1 --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkin-schema-dublin-sample.yaml @@ -0,0 +1,9 @@ +open_cli_sample_version: 1.0 +name: --host-url +version: open-cli +samples: + sample1: + name: --host-url + input: https://159.138.32.178:30204 --host-username cs0008 --host-password demo123456! --vf-model-uuid c5d9a74a-c617-4542-8b83-31c4d8a7269b --debug + moco: vf-model-checkin-schema-dublin-moco.json + output: \ No newline at end of file diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-checkin-schema-dublin.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-checkin-schema-dublin.yaml new file mode 100644 index 00000000..9ec09f0a --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-checkin-schema-dublin.yaml @@ -0,0 +1,50 @@ +# Copyright © Intel Corporation 2019 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +open_cli_schema_version: 1.0 +name: vf-model-checkin +description: Checkin VF model in SDC + +info: + product: onap-dublin + service: sdc + author: ONAP CLI Team onap-discuss@lists.onap.org + +parameters: + - name: vf-model-uuid + description: VF model UUID (can be found by running vf-model-list) + type: string + long_option: vf-model-uuid + short_option: b + is_optional: false + - name: remarks + description: checkin remarks + type: string + long_option: remarks + short_option: r + default_value: Checked in by ONAP CLI + is_optional: false + +http: + service: + name: sdc + version: v1.0 + auth: basic + mode: direct + request: + uri: /sdc2/rest/v1/catalog/resources/${vf-model-uuid}/lifecycleState/CHECKIN + method: POST + body: '{"userRemarks": "${remarks}"}' + success_codes: + - 200 -- cgit 1.2.3-korg From 0233b19e5c4940e5d6a3b56044409d626f075620 Mon Sep 17 00:00:00 2001 From: Kanagaraj M Date: Fri, 2 Aug 2019 13:57:51 +0530 Subject: Add VF model checkout command Issue-ID: CLI-169 Change-Id: I0ddcdc1c4c98cf23d8bc4ff8faf8dc1d9d11574e Signed-off-by: Kanagaraj Manickam k00365106 --- .../vf/vf-model-checkout-schema-dublin-moco.json | 70 ++++++++++++++++++++++ .../vf/vf-model-checkout-schema-dublin-sample.yaml | 9 +++ .../vf/vf-model-checkout-schema-dublin.yaml | 54 +++++++++++++++++ 3 files changed, 133 insertions(+) create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkout-schema-dublin-moco.json create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkout-schema-dublin-sample.yaml create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-checkout-schema-dublin.yaml (limited to 'products/onap-dublin') diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkout-schema-dublin-moco.json b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkout-schema-dublin-moco.json new file mode 100644 index 00000000..c688dcb4 --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkout-schema-dublin-moco.json @@ -0,0 +1,70 @@ +[ { + "request" : { + "method" : "post", + "uri" : "/sdc2/rest/v1/catalog/resources/168c1a0d-82d8-4a86-a934-9e685389516f/lifecycleState/CHECKOUT", + "headers" : { + "Authorization" : "Basic Y3MwMDA4OmRlbW8xMjM0NTYh", + "X-FromAppId" : "ONAP CLI", + "Accept" : "application/json", + "USER_ID" : "cs0008", + "X-TransactionId" : "req-4616b1ae-ca5f-4a74-97de-144647202745", + "Content-Type" : "application/json" + }, + "json" : { } + }, + "response" : { + "status" : 200, + "json" : { + "uniqueId" : "c5d9a74a-c617-4542-8b83-31c4d8a7269b", + "name" : "ovp-test", + "version" : "1.4", + "isHighestVersion" : true, + "creationDate" : 1564379661410, + "lastUpdateDate" : 1564379661410, + "description" : "ovp-test", + "lifecycleState" : "NOT_CERTIFIED_CHECKOUT", + "tags" : [ "ovp-test" ], + "icon" : "defaulticon", + "normalizedName" : "ovptest", + "systemName" : "OvpTest", + "contactId" : "cs0008", + "allVersions" : { + "1.0" : "3f0de55b-90be-459d-a30f-a24553baacaa", + "1.1" : "53235bc8-2619-4d23-b1f6-e41e64d0af47", + "1.2" : "ef2ce8c3-af1c-480a-a12f-6bd1fe0384f4", + "1.3" : "168c1a0d-82d8-4a86-a934-9e685389516f", + "1.4" : "c5d9a74a-c617-4542-8b83-31c4d8a7269b" + }, + "csarUUID" : "aa92c8177d754587b621a951a522a942", + "csarVersion" : "1.0", + "invariantUUID" : "c918f6b2-5067-4c10-91a8-672964f3fd10", + "componentType" : "RESOURCE", + "categories" : [ { + "name" : "Generic", + "normalizedName" : "generic", + "uniqueId" : "resourceNewCategory.generic", + "subcategories" : [ { + "name" : "Network Elements", + "normalizedName" : "network elements", + "uniqueId" : "resourceNewCategory.generic.network elements", + "icons" : [ "network", "connector" ], + "empty" : false + } ], + "empty" : false + } ], + "creatorUserId" : "cs0008", + "creatorFullName" : "Carlos Santana", + "lastUpdaterUserId" : "cs0008", + "lastUpdaterFullName" : "Carlos Santana", + "archiveTime" : 0, + "vendorName" : "onap", + "vendorRelease" : "1.0", + "resourceVendorModelNumber" : "", + "resourceType" : "VF", + "toscaResourceName" : "org.openecomp.resource.vf.OvpTest", + "vspArchived" : false, + "archived" : false, + "uuid" : "24d20439-1d8c-44dc-acaf-cb0929a6a5f3" + } + } +} ] \ No newline at end of file diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkout-schema-dublin-sample.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkout-schema-dublin-sample.yaml new file mode 100644 index 00000000..39885784 --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/vf/vf-model-checkout-schema-dublin-sample.yaml @@ -0,0 +1,9 @@ +open_cli_sample_version: 1.0 +name: --host-url +version: open-cli +samples: + sample1: + name: --host-url + input: https://159.138.32.178:30204 --host-username cs0008 --host-password demo123456! --vf-model-uuid 168c1a0d-82d8-4a86-a934-9e685389516f --debug + moco: vf-model-checkout-schema-dublin-moco.json + output: | diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-checkout-schema-dublin.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-checkout-schema-dublin.yaml new file mode 100644 index 00000000..511e29fd --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-checkout-schema-dublin.yaml @@ -0,0 +1,54 @@ +# Copyright © Intel Corporation 2019 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +open_cli_schema_version: 1.0 +name: vf-model-checkout +description: Checkout VF model in SDC + +info: + product: onap-dublin + service: sdc + author: ONAP CLI Team onap-discuss@lists.onap.org + + +parameters: + - name: vf-model-uuid + description: VF model UUID (can be found from vf-model-list) + type: string + long_option: vf-model-uuid + short_option: b + is_optional: false + +results: + direction: portrait + attributes: + - name: ID + description: VF checked out version unique ID + scope: short + type: string + +http: + service: + name: sdc + version: v1.0 + auth: basic + mode: direct + request: + uri: /sdc2/rest/v1/catalog/resources/${vf-model-uuid}/lifecycleState/CHECKOUT + method: POST + body: '{}' + success_codes: + - 200 + result_map: + ID: $b{$.uniqueId} \ No newline at end of file -- cgit 1.2.3-korg From b86ad66a6f0cf043baef67bfc3a413f16129ac94 Mon Sep 17 00:00:00 2001 From: Kanagaraj M Date: Fri, 2 Aug 2019 14:00:29 +0530 Subject: Add service model artifact add command Issue-ID: CLI-169 Change-Id: I07d22e8102242c6d68d9248824b92334fb83fee8 Signed-off-by: Kanagaraj Manickam k00365106 --- ...ce-model-add-artifact-schema-dublin-sample.yaml | 0 .../service-model-add-artifact-schema-dublin.yaml | 72 ++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/service-model/service-model-add-artifact-schema-dublin-sample.yaml create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-add-artifact-schema-dublin.yaml (limited to 'products/onap-dublin') diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/service-model/service-model-add-artifact-schema-dublin-sample.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-sample/service-model/service-model-add-artifact-schema-dublin-sample.yaml new file mode 100644 index 00000000..e69de29b diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-add-artifact-schema-dublin.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-add-artifact-schema-dublin.yaml new file mode 100644 index 00000000..dc881d90 --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-add-artifact-schema-dublin.yaml @@ -0,0 +1,72 @@ +# Copyright 2019 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +open_cli_schema_version: 1.0 +name: service-model-add-artifact +description: Add a artifact to a Service model + +info: + product: onap-dublin + service: sdc + author: ONAP HPA Team onap-discuss@lists.onap.org + + +parameters: + - name: service-uniqueId + description: Service Unique Id + type: string + long_option: service-uniqueId + short_option: x + is_optional: false + - name: remarks + description: certification remarks + type: string + long_option: remarks + short_option: y + default_value: Uploaded from ONAP CLI + is_optional: true + - name: artifact + description: NS CSAR file + type: byte + long_option: artifact + short_option: z + is_optional: false + - name: artifact-name + description: NS CSAR name + type: string + long_option: artifact-name + short_option: b + is_optional: false + - name: user-id + description: Designer user id + type: string + long_option: user-id + short_option: e + default_value: cs0008 + is_optional: true +http: + service: + name: sdc + version: v1.0 + auth: basic + mode: direct + request: + uri: /sdc2/rest/v1/catalog/services/${service-uniqueId}/artifacts + method: POST + headers: + Content-MD5: $s{md5:__body__} + USER_ID: ${user-id} + body: '{"payloadData":"${artifact}","artifactDisplayName":"${artifact-name}","artifactType":"OTHER","description":"${remarks}","artifactName":"${artifact-name}", "artifactLabel":"${artifact-name}","artifactGroupType":"INFORMATIONAL", artifactChecksum="$s{md5:artifact}"}' + success_codes: + - 200 -- cgit 1.2.3-korg From f24ae00ec10cdcbab41429841926051ba08c88ec Mon Sep 17 00:00:00 2001 From: Kanagaraj M Date: Fri, 2 Aug 2019 14:02:50 +0530 Subject: Add vf model add artifact command Issue-ID: CLI-169 Change-Id: I1217d391e5527b74a8e8af28fd97117fd70a8c05 Signed-off-by: Kanagaraj Manickam k00365106 --- .../vf/vf-model-add-artifact-schema-dublin.yaml | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-add-artifact-schema-dublin.yaml (limited to 'products/onap-dublin') diff --git a/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-add-artifact-schema-dublin.yaml b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-add-artifact-schema-dublin.yaml new file mode 100644 index 00000000..1a6c6b7c --- /dev/null +++ b/products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-add-artifact-schema-dublin.yaml @@ -0,0 +1,72 @@ +# Copyright 2019 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +open_cli_schema_version: 1.0 +name: vf-model-add-artifact +description: Add a artifact to a Virtual function + +info: + product: onap-dublin + service: sdc + author: ONAP HPA Team onap-discuss@lists.onap.org + + +parameters: + - name: vf-uniqueId + description: VF UniqueId + type: string + long_option: vf-uniqueId + short_option: x + is_optional: false + - name: remarks + description: certification remarks + type: string + long_option: remarks + short_option: y + default_value: Uploaded from ONAP CLI + is_optional: true + - name: artifact + description: VNF CSAR file + type: byte + long_option: artifact + short_option: z + is_optional: false + - name: artifact-name + description: VNF CSAR name + type: string + long_option: artifact-name + short_option: b + is_optional: false + - name: user-id + description: Designer user id + type: string + long_option: user-id + short_option: e + default_value: cs0008 + is_optional: true +http: + service: + name: sdc + version: v1.0 + auth: basic + mode: direct + request: + uri: /sdc2/rest/v1/catalog/resources/${vf-uniqueId}/artifacts + method: POST + headers: + Content-MD5: $s{md5:__body__} + USER_ID: ${user-id} + body: '{"payloadData":"${artifact}","artifactDisplayName":"${artifact-name}","artifactType":"OTHER","description":"${remarks}","artifactName":"${artifact-name}", "artifactLabel":"${artifact-name}","artifactGroupType":"DEPLOYMENT", artifactChecksum="$s{md5:artifact}"}' + success_codes: + - 200 -- cgit 1.2.3-korg From b9d85a33892c99949aff8e3471eb0fdc039d44aa Mon Sep 17 00:00:00 2001 From: Kanagaraj M Date: Fri, 2 Aug 2019 14:21:46 +0530 Subject: Add integration support Issue-ID: CLI-169 Change-Id: I816a1dbb2241e52e533411dcae26dfbf1c39e2d6 Signed-off-by: Kanagaraj Manickam k00365106 --- deployment/zip/pom.xml | 13 +- products/onap-dublin/features/integration/pom.xml | 45 ++ .../resources/conf/ovp-tosca-vnf-provision.json | 141 +++++++ .../open-cli-schema/ovp-tosca-vnf-provision.yaml | 90 ++++ .../resources/script/ovp-tosca-vnf-provision.py | 456 +++++++++++++++++++++ products/onap-dublin/features/pom.xml | 1 + 6 files changed, 742 insertions(+), 4 deletions(-) create mode 100644 products/onap-dublin/features/integration/pom.xml create mode 100644 products/onap-dublin/features/integration/src/main/resources/conf/ovp-tosca-vnf-provision.json create mode 100644 products/onap-dublin/features/integration/src/main/resources/open-cli-schema/ovp-tosca-vnf-provision.yaml create mode 100644 products/onap-dublin/features/integration/src/main/resources/script/ovp-tosca-vnf-provision.py (limited to 'products/onap-dublin') diff --git a/deployment/zip/pom.xml b/deployment/zip/pom.xml index cb34efe1..6af31ca3 100644 --- a/deployment/zip/pom.xml +++ b/deployment/zip/pom.xml @@ -102,16 +102,21 @@ fileset(dir: "${project.build.directory}/../../../grpc/target/lib/") } + ant.copy(todir: "${deployUnzip}/conf") { + fileset(dir: + "${project.build.directory}/../../../products/target/conf/") + fileset(dir: + "${project.build.directory}/../../../profiles/target/conf/") fileset(file: - "${basedir}/src/main/release/conf/open-cli.properties") + "${basedir}/src/main/release/conf/*.properties") } ant.copy(todir: - "${deployUnzip}/conf") { - fileset(file: - "${basedir}/src/main/release/conf/log4j.properties") + "${deployUnzip}/script") { + fileset(dir: + "${project.build.directory}/../../../products/target/script/") } ant.copy(todir: diff --git a/products/onap-dublin/features/integration/pom.xml b/products/onap-dublin/features/integration/pom.xml new file mode 100644 index 00000000..10ca092d --- /dev/null +++ b/products/onap-dublin/features/integration/pom.xml @@ -0,0 +1,45 @@ + + + + + 4.0.0 + + + org.onap.cli + cli-products-onap-dublin-features + 4.0.0-SNAPSHOT + + + cli-products-onap-dublin-features-integration + cli/products/onap-dublin/features/integration + jar + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.apache.maven.plugins + maven-resources-plugin + + + + diff --git a/products/onap-dublin/features/integration/src/main/resources/conf/ovp-tosca-vnf-provision.json b/products/onap-dublin/features/integration/src/main/resources/conf/ovp-tosca-vnf-provision.json new file mode 100644 index 00000000..f3a5354e --- /dev/null +++ b/products/onap-dublin/features/integration/src/main/resources/conf/ovp-tosca-vnf-provision.json @@ -0,0 +1,141 @@ +{ + "open_cli_product" : "onap-dublin", + "open_cli_home" : "/opt/vtp", + "aai_url" : "https://10.12.5.224:30233", + "aai_username" : "AAI", + "aai_password" : "AAI", + + "sdc_onboarding_url" : "http://10.43.89.129:8081", + "sdc_catalog_url" : "http://10.12.5.224:30205", + "sdc_password" : "demo123456!", + "sdc_creator" : "cs0008", + "sdc_tester" : "jm0007", + "sdc_governor" : "gv0001", + "sdc_operator" : "op0001", + "sdc_consumer" : "ocomp", + + "multicloud_url" : "http://10.12.5.224:30280", + + "//" : "#Parameters required to create cloud complex", + "complex_name" : "OVP-LCM", + "street1" : "street1", + "street2" : "street2", + "physical_location" : "phy_type", + "data_center_code" : "ocomp", + "latitude" : "32.89948", + "longitude" : "97.045443", + "lata" : "example-lata-val-28399", + "elevation" : "example-elevation-val-28399", + "region" : "northwest", + "state" : "oregon", + "city" : "hillsboro", + "postal-code" : "00000", + "country" : "USA", + "identity_url" : "http://10.12.11.1:5000/v3", + "service-model-name" : "usn", + "//" : "#Dictionary containing cloud regions and their Parameters", + + "cloud_region_data":{ + "ONAP-POD-01-Rail-05":{ + "cloud-region-version" : "titanium_cloud", + "esr-system-info-id":"5c85ce1f-aa78-4ebf-8d6f-4b62784e9bc7", + "service-url": "http://10.12.11.1:5000/v3", + "user-name":"${cloud-username}", + "password":"${cloud-password}", + "system-type": "VIM", + "ssl-insecure":true, + "cloud-domain":"Default", + "default-tenant":"Integration-HPA", + "tenant-id" : "709ba629fe194f8699b12f9d6ffd86a0", + "cloud-type" : "openstack", + "identity-url": "WillBeUpdatedByMultiCloud", + "system-status":"active" + } + }, + + "//" : "#Parameters to register cloud region", + "cloud-owner" : "CloudOwner", + "owner-defined-type" : "t1", + "cloud-zone" : "CloudZone", + + "service_name" : "USN", + "customer_name" : "ocomp", + "subscriber_name" : "ocomp", + + "//" : "Onboarding parameters", + "vendor-name" : "Huawei", + "entitlement-pool-name" : "ovp-pool", + "entitlement-description" : "ovp-pool", + "start-date" : "08/01/2019", + "expiry-date" : "12/31/2019", + "key-group-name" : "ovp-key", + "key-group-type" : "Universal", + "feature-grp-name" : "ovp-feature", + "feature-grp-desc" : "ovp-feature", + "part-no" : "ovp-part", + "agreement-name" : "ovp-agreement", + "agreement-desc" : "ovp-agreement", + + "onboarding-method" : "NetworkPackage", + + "//" : "Be sure to include single quotes in parameters that have spaces", + "project-code" : "000000", + "service-model-name" : "usn", + "service-model-desc" : "'usn service'", + "icon-id" : "network_l_1-3", + "category-display" : "'Network L1-3'", + "category" : "'network l1-3'", + + "service-test-remarks" : "ovp test", + "service-accept-remarks" : "accepted", + "service-approve-remarks" : "approved", + + "//" : "#Parameters to vfc", + "vfc-url": "http://10.12.5.224:30280", + "vnfs":{ + "usn":{ + "path": "/opt/vtp/data/usn.csar", + "csar-id": "You need change it", + "vsp-name" : "ovp-usn", + "vsp-desc" : "ovp usn", + "vsp-version" : "1.0", + "vf-name" : "ovp-vf", + "vf-description" : "ovp vf", + "vf-remarks" :"ovp test", + "vf-version" : "1.0", + "key": "key2", + "value": "value2" + } + }, + "ns":{ + "csar-id": "You need change it", + "key": "key1", + "value": "value1", + "path": "/opt/vtp/data/usn_service.csar", + "name": "ovp-usn" + }, + "location": "CloudOwner_ONAP-POD-01-Rail-05", + "vnfm_params":{ + "GVNFMDRIVER":{ + "type": "gvnfmdriver", + "vendor": "vfc", + "version": "v1.0", + "url": "http://msb-iag:80/", + "vim-id": "CloudOwner_ONAP-POD-01-Rail-05", + "user-name": "admin", + "user-password": "admin", + "vnfm-version": "v1.0" + }, + "HWVNFMDRIVER":{ + "type": "hwvnfmdriver", + "vendor": "vfc", + "version": "v1.0", + "url": "http://msb-iag:80/", + "vim-id": "CloudOwner_ONAP-POD-01-Rail-05", + "user-name": "admin", + "user-password": "admin", + "vnfm-version": "v1.0" + } + }, + "sdc-controller-id": "2" +} diff --git a/products/onap-dublin/features/integration/src/main/resources/open-cli-schema/ovp-tosca-vnf-provision.yaml b/products/onap-dublin/features/integration/src/main/resources/open-cli-schema/ovp-tosca-vnf-provision.yaml new file mode 100644 index 00000000..b98bef76 --- /dev/null +++ b/products/onap-dublin/features/integration/src/main/resources/open-cli-schema/ovp-tosca-vnf-provision.yaml @@ -0,0 +1,90 @@ +# Copyright 2019 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +open_cli_schema_version: 1.0 +name: tosca-vnf-provision +description: | + Provision TOSCA based VNF using ONAP. + More details: https://wiki.lfnetworking.org/display/LN/TOSCA+VNF+Validation+Planning + +info: + product: onap-dublin + service: vnf-validation + author: ONAP VTP Team onap-discuss@lists.onap.org + +parameters: + - name: config-json + description: Configuration file path + type: string + short_option: x + long_option: config-json + default_value: $s{env:OPEN_CLI_HOME}/conf/ovp-tosca-vnf-provision.json + is_optional: false + - name: vsp + description: Path to the ONAP vendor service product (VSP) for the VNF to provision + type: binary + short_option: y + long_option: vsp + is_optional: false + - name: vnf-csar + description: Path to the TOSCA CSAR for the VNF to provision + type: binary + short_option: r + long_option: vnf-csar + is_optional: false + - name: ns-csar + description: Path to the TOSCA CSAR for the NS service to provision + type: binary + short_option: b + long_option: ns-csar + is_optional: true + default: false + - name: vnfm-driver + description: VNFM driver to use + type: string + short_option: c + long_option: vnfm-driver + is_optional: false + +results: + direction: portrait + attributes: + - name: vnf-id + description: ONAP VNF instance id + scope: short + type: string + - name: vnf-status + description: Onap VNF status + scope: short + type: string + - name: ns-id + description: Onap NS service instance id + scope: short + type: string + - name: ns-status + description: Onap NS status + scope: short + type: string +cmd: + command: + - python $s{env:OPEN_CLI_HOME}/script/ovp-tosca-vnf-provision.py --result-json $s{tmp:result.json} --config-json ${config-json} --vsp ${vsp} --vnf-csar ${vnf-csar} --ns-csar ${ns-csar} --vnfm-driver ${vnfm-driver} + success_codes: + - 0 + working_directory: . + output: $s{tmp:result.json} + result_map: + vnf-id: $o{$.vnf_id} + vnf-status: $o{$.vnf_status} + ns-id: $o{$.ns_id} + ns-status: $o{$.vnf_status} \ No newline at end of file diff --git a/products/onap-dublin/features/integration/src/main/resources/script/ovp-tosca-vnf-provision.py b/products/onap-dublin/features/integration/src/main/resources/script/ovp-tosca-vnf-provision.py new file mode 100644 index 00000000..dddb0a08 --- /dev/null +++ b/products/onap-dublin/features/integration/src/main/resources/script/ovp-tosca-vnf-provision.py @@ -0,0 +1,456 @@ +#!/usr/bin/python + +import json +import os +import time +import argparse +import sys +import requests +import __main__ + +def get_parameters(file): + parameters = json.load(file) + return parameters + +def get_out_helper(in_string): + out_list = (((in_string.replace('-','')).replace('|', '')).replace('+', '')).split() + return out_list + +def get_out_helper_2(in_string): + out_list = ((in_string.replace('|', '')).replace('+', '')).split() + return out_list + +def set_open_cli_env(parameters): + os.environ["OPEN_CLI_PRODUCT_IN_USE"] = parameters["open_cli_product"] + os.environ["OPEN_CLI_HOME"] = parameters["open_cli_home"] + +def create_complex(parameters): + complex_create_string = "oclip complex-create -j {} -r {} -x {} -y {} -lt {} -l {} -i {} -lo {} \ + -S {} -la {} -g {} -w {} -z {} -k {} -o {} -q {} -m {} -u {} -p {}".format(parameters["street2"], \ + parameters["physical_location"], parameters["complex_name"], \ + parameters["data_center_code"], parameters["latitude"], parameters["region"], \ + parameters["street1"], parameters["longitude"], parameters["state"], \ + parameters["lata"], parameters["city"], parameters["postal-code"], \ + parameters["complex_name"], parameters["country"], parameters["elevation"], \ + parameters["identity_url"], parameters["aai_url"], parameters["aai_username"], \ + parameters["aai_password"]) + + os.system(complex_create_string) + +def create_vlm(parameters): + vlm_create_string = "oclip vlm-create -x {} -u {} -p {} -m {}".format(parameters["vendor-name"], \ + parameters["sdc_creator"], parameters["sdc_password"], parameters["sdc_onboarding_url"]) + command_out = (os.popen(vlm_create_string)).read() + out_list = get_out_helper(command_out) + vlm_id = out_list[3] + vlm_version = out_list[5] + + entitlement_string = "oclip vlm-entitlement-pool-create -x {} -y {} -e {} -z {} -k {} -g {} -l {} -u {} -p {} -m {}".format( \ + parameters["entitlement-pool-name"], vlm_id, vlm_version, parameters["entitlement-description"], parameters["vendor-name"], \ + parameters["expiry-date"], parameters["start-date"], parameters["sdc_creator"], parameters["sdc_password"], \ + parameters["sdc_onboarding_url"]) + command_out = (os.popen(entitlement_string)).read() + entitlement_id = (get_out_helper(command_out))[3] + + + key_group_string = "oclip vlm-key-group-create -c {} -e {} -x {} -y {} -u {} -p {} -m {}".format(vlm_id, vlm_version, \ + parameters["key-group-name"], parameters["key-group-type"], parameters["sdc_creator"], parameters["sdc_password"], \ + parameters["sdc_onboarding_url"]) + command_out = (os.popen(key_group_string)).read() + key_group_id = (get_out_helper(command_out))[3] + + feature_group_string = "oclip vlm-feature-group-create -x {} -y {} -e {} -z {} -g {} -b {} -c {} -u {} -p {} -m {}".format( + parameters["feature-grp-name"], vlm_id, vlm_version, parameters["feature-grp-desc"], key_group_id, entitlement_id, \ + parameters["part-no"], parameters["sdc_creator"], parameters["sdc_password"], parameters["sdc_onboarding_url"]) + command_out = (os.popen(feature_group_string)).read() + feature_group_id = (get_out_helper(command_out))[3] + + agreement_string = "oclip vlm-aggreement-create -x {} -y {} -e {} -z {} -g {} -u {} -p {} -m {}".format(parameters["agreement-name"], \ + vlm_id, vlm_version, parameters["agreement-desc"], feature_group_id, parameters["sdc_creator"], parameters["sdc_password"], \ + parameters["sdc_onboarding_url"]) + command_out = (os.popen(agreement_string)).read() + agreement_id = (get_out_helper(command_out))[3] + + submit_string = "oclip vlm-submit -x {} -y {} -u {} -p {} -m {}".format(vlm_id, vlm_version, parameters["sdc_creator"], \ + parameters["sdc_password"], parameters["sdc_onboarding_url"]) + os.system(submit_string) + + output = [feature_group_id, agreement_id, vlm_version, vlm_id ] + return output + +def create_vsp(parameters, in_list): + vnfs = parameters["vnf"] + vsp_dict = {} + for name, value in vnfs.iteritems(): + create_string = "oclip vsp-create -j {} -o {} -e {} -x {} -y {} -i {} -c {} -g {} -u {} -p {} -m {}".format( in_list[0], \ + parameters["onboarding-method"], parameters["vendor-name" ], value.get("vsp-name"), value.get("vsp-desc"), in_list[1], \ + in_list[2], in_list[3], parameters["sdc_creator"], parameters["sdc_password"], parameters["sdc_onboarding_url"] ) + command_out = (os.popen(create_string)).read() + out_list = get_out_helper(command_out) + vsp_id = out_list[3] + vsp_version = out_list[5] + + os.system("oclip vsp-add-artifact -x {} -y {} -z {} -u {} -p {} -m {}".format(vsp_id, vsp_version, value.get("path"), \ + parameters["sdc_creator"], parameters["sdc_password"], parameters["sdc_onboarding_url"])) + + os.system("oclip vsp-validate -x {} -y {} -u {} -p {} -m {}".format(vsp_id, vsp_version, parameters["sdc_creator"], \ + parameters["sdc_password"], parameters["sdc_onboarding_url"])) + + os.system("oclip vsp-submit -x {} -y {} -u {} -p {} -m {}".format(vsp_id, vsp_version, parameters["sdc_creator"], \ + parameters["sdc_password"], parameters["sdc_onboarding_url"])) + + os.system("oclip vsp-package -x {} -y {} -u {} -p {} -m {}".format(vsp_id, vsp_version, parameters["sdc_creator"], \ + parameters["sdc_password"], parameters["sdc_onboarding_url"])) + + vsp_ids[name] = vsp_id + return vsp_ids + +def create_vf_model(parameters, vsp_dict): + vnfs = parameters["vnfs"] + vf_dict = {} + for name, value in vnfs.iteritems(): + create_string = "oclip vf-model-create -y {} -g {} -x {} -z {} -b {} -u {} -p {} -m {}".format(value.get("vf-description"), \ + value.get("vsp-version"), value.get("vf-name"), parameters["vendor-name"], vsp_dict[name], \ + parameters["sdc_creator"], parameters["sdc_password"], parameters["sdc_catalog_url"]) + os.system(create_string) + + output = (os.popen("oclip vf-model-list -m {} -u {} -p {} | grep {}".format(parameters["sdc_catalog_url"], \ + parameters["sdc_creator"], parameters["sdc_password"], value.get("vf-name")))).read() + output = (get_out_helper_2(output)) + + vf_unique_id = output[1] + + # checkout + output = (os.popen("oclip vf-model-checkout --host-url {} --host-username {} --host-password {} --vf-model-uuid {} --format json".format( + parameters["sdc_catalog_url"], parameters["sdc_creator"], parameters["sdc_password"], vf_unique_id))).read() + vf_unique_id = (json.loads(output))['ID'] + + # add consumer, if already exist , just ignore, below command would fail simply !! + os.system("oclip sdc-consumer-create --consumer-name {}".format(parameters["sdc_consumer"])) + + def get_vnf_name(vnf_csar_path): + return vnf_csar_path.replace("_"," ").replace(".", " ").replace("-"," ") + + # add artifact + os.system("oclip vf-model-add-artifact --host-url {} --host-username {} --host-password {} --vf-model-uuid {} --artifact {} --artifact-name {}".format( + parameters["sdc_catalog_url"], parameters["sdc_consumer"], parameters["sdc_password"], vf_unique_id, vnf_csar, get_vnf_name(vnf_csar))) + + # check-in + os.system("oclip vf-model-checkin --host-url {} --host-username {} --host-password {} --vf-model-uuid {}".format( + parameters["sdc_catalog_url"], parameters["sdc_creator"], parameters["sdc_password"], vf_unique_id)) + + os.system("oclip vf-model-certify -b {} -r {} -u {} -p {} -m {}".format(vf_unique_id, value.get("vf-remarks"), \ + parameters["sdc_creator"], parameters["sdc_password"], parameters["sdc_catalog_url"])) + + #Check for new parameters after certification + output = (os.popen("oclip vf-model-list -m {} -u {} -p {} | grep {}".format(parameters["sdc_catalog_url"], \ + parameters["sdc_creator"], parameters["sdc_password"], value.get("vf-name")))).read() + output = (get_out_helper_2(output)) + + vf_dict[name] = output[1] + + return vf_dict + + +def create_service_model(parameters, vf_dict): + vnfs = parameters["vnfs"] + + create_string = "oclip service-model-create -z {} -y {} -e {} -x {} -c {} -b {} -u {} -p {} -m {} |grep ID".format(parameters["project-code"], \ + parameters["service-model-desc"], parameters["icon-id"], parameters["service-model-name"], parameters["category-display"], \ + parameters["category"],parameters["sdc_creator"], parameters["sdc_password"], parameters["sdc_catalog_url"]) + + service_model_id = (get_out_helper_2((os.popen(create_string)).read()))[1] + + # checkout + output = (os.popen("oclip service-model-checkout --host-url {} --host-username {} --host-password {} --service-model-uuid {} --format json".format( + parameters["sdc_catalog_url"], parameters["sdc_creator"], parameters["sdc_password"], service_model_id))).read() + service_model_id = (json.loads(output))['ID'] + + # add consumer, if already exist , just ignore, below command would fail simply !! + os.system("oclip sdc-consumer-create --consumer-name {}".format(parameters["sdc_consumer"])) + + for name, value in vnfs.iteritems(): + output = (os.popen("oclip service-model-add-vf -x {} -b {} -y {} -z {} -u {} -p {} -m {}".format(service_model_id, \ + parameters["vf-version"], vf_dict[name], value.get("vf-name"), parameters["sdc_creator"], \ + parameters["sdc_password"], parameters["sdc_catalog_url"] ))).read() + vf_unique_id = (json.loads(output))['ID'] + vf_uuid = (json.loads(output))['UUID'] + + def get_ns_name(ns_csar_path): + return vnf_csar_path.replace("_"," ").replace(".", " ").replace("-"," ") + + # add artifact + os.system("oclip service-model-add-artifact --host-url {} --host-username {} --host-password {} --service-uniqueId {} --artifact {} --artifact-name {}".format( + parameters["sdc_catalog_url"], parameters["sdc_consumer"], parameters["sdc_password"], vf_unique_id, ns_csar, get_vnf_name(ns_csar))) + + # set properties + os.system("oclip service-model-set-property --host-url {} --host-username {} --host-password {} --service-uniqueId {} --resource-uuid {} --resource-uniqueId {} --property-name nf_type --property-value {}".format( + parameters["sdc_catalog_url"], parameters["sdc_consumer"], parameters["sdc_password"], service_model_id , vf_unique_id, vf_uuid, vnfm_driver)) + + # check-in + os.system("oclip service-model-checkin --host-url {} --host-username {} --host-password {} --service-model-uuid {}".format( + parameters["sdc_catalog_url"], parameters["sdc_creator"], parameters["sdc_password"], service_model_id)) + + + os.system("oclip service-model-test-request -b {} -r {} -u {} -p {} -m {}".format(service_model_id, parameters["service-test-remarks"], \ + parameters["sdc_creator"], parameters["sdc_password"], parameters["sdc_catalog_url"])) + + os.system("oclip service-model-test-start -b {} -u {} -p {} -m {}".format(service_model_id, parameters["sdc_tester"], \ + parameters["sdc_password"], parameters["sdc_catalog_url"])) + + os.system("oclip service-model-test-accept -b {} -r {} -u {} -p {} -m {}".format(service_model_id, parameters["service-accept-remarks"], \ + parameters["sdc_tester"], parameters["sdc_password"], parameters["sdc_catalog_url"])) + + #Get uniqueId for the service model + service_model_values = (os.popen("oclip service-model-list -u {} -p {} -m {} |grep {}".format(parameters["sdc_creator"], \ + parameters["sdc_password"], parameters["sdc_catalog_url"], parameters["service-model-name"]))).read() + service_model_values = get_out_helper_2(service_model_values) + service_model_uniqueId = (service_model_values)[1] + + os.system("oclip service-model-approve -b {} -r {} -u {} -p {} -m {}".format(service_model_uniqueId, parameters["service-approve-remarks"], \ + parameters["sdc_governor"], parameters["sdc_password"], parameters["sdc_catalog_url"])) + + os.system("oclip service-model-distribute -b {} -u {} -p {} -m {}".format(service_model_uniqueId, parameters["sdc_operator"], \ + parameters["sdc_password"], parameters["sdc_catalog_url"])) + + return service_model_values + +def register_cloud_helper(cloud_region, values, parameters): + #Create Cloud + cloud_create_string = 'oclip cloud-create -e {} -b {} -I {{\\\\\\"openstack-region-id\\\\\\":\\\\\\"{}\\\\\\"}} \ + -x {} -y {} -j {} -w {} -l {} -url {} -n {} -q {} -r {} -Q {} -i {} -g {} -z {} -k {} -c {} -m {} -u {} -p {}'.format( + values.get("esr-system-info-id"), values.get("user-name"), cloud_region, parameters["cloud-owner"], \ + cloud_region, values.get("password"), values.get("cloud-region-version"), values.get("default-tenant"), \ + values.get("service-url"), parameters["complex_name"], values.get("cloud-type"), parameters["owner-defined-type"], \ + values.get("system-type"), values.get("identity-url"), parameters["cloud-zone"], values.get("ssl-insecure"), \ + values.get("system-status"), values.get("cloud-domain"), parameters["aai_url"], parameters["aai_username"], \ + parameters["aai_password"]) + + + os.system(cloud_create_string) + + #Associate Cloud with complex + complex_associate_string = "oclip complex-associate -x {} -y {} -z {} -m {} -u {} -p {}".format(parameters["complex_name"], \ + cloud_region, parameters["cloud-owner"], parameters["aai_url"], parameters["aai_username"], parameters["aai_password"]) + os.system(complex_associate_string) + + #Register Cloud with Multicloud + multicloud_register_string = "oclip multicloud-register-cloud -y {} -x {} -m {}".format(parameters["cloud-owner"], \ + cloud_region, parameters["multicloud_url"]) + os.system(multicloud_register_string) + +def register_all_clouds(parameters): + cloud_dictionary = parameters["cloud_region_data"] + for cloud_region, cloud_region_values in cloud_dictionary.iteritems(): + register_cloud_helper(cloud_region, cloud_region_values, parameters) + +def create_service_type(parameters): + create_string = "oclip service-type-create -x {} -m {} -u {} -p {}".format( parameters["service_name"], \ + parameters["aai_url"], parameters["aai_username"], parameters["aai_password"]) + os.system(create_string) + +def create_customer(parameters): + create_string = "oclip customer-create -x {} -y {} -m {} -u {} -p {}".format( parameters["customer_name"], \ + parameters["subscriber_name"], parameters["aai_url"], parameters["aai_username"], parameters["aai_password"]) + os.system(create_string) + +def add_customer_subscription(parameters): + subscription_check = 0 + for cloud_region, cloud_region_values in (parameters["cloud_region_data"]).iteritems(): + if subscription_check == 0 : + subscription_string = "oclip subscription-create -x {} -c {} -z {} -e {} -y {} -r {} -m {} -u {} -p {}".format(\ + parameters["customer_name"], cloud_region_values.get("tenant-id"), parameters["cloud-owner"], parameters["service_name"],\ + cloud_region_values.get("default-tenant"), cloud_region, parameters["aai_url"], parameters["aai_username"], parameters["aai_password"] ) + else: + subscription_string = "oclip subscription-cloud-add -x {} -c {} -z {} -e {} -y {} -r {} -m {} -u {} -p {}".format(\ + parameters["customer_name"], cloud_region_values.get("tenant-id"), parameters["cloud-owner"], parameters["service_name"],\ + cloud_region_values.get("default-tenant"), cloud_region, parameters["aai_url"], parameters["aai_username"], parameters["aai_password"] ) + os.system(subscription_string) + subscription_check+=1 + +def register_vnfm_helper(vnfm_key, values, parameters): + #Create vnfm + vnfm_create_string = 'oclip vnfm-create -b {} -c {} -e {} -v {} -g {} -x {} -i {} -j {} -q {} \ + -m {} -u {} -p {}'.format(vnfm_key, values.get("type"), values.get("vendor"), \ + values.get("version"), values.get("url"), values.get("vim-id"), \ + values.get("user-name"), values.get("user-password"), values.get("vnfm-version"), \ + parameters["aai_url"], parameters["aai_username"], parameters["aai_password"]) + + os.system(vnfm_create_string) + +def register_vnfm(parameters): + vnfm_params = parameters["vnfm_params"] + for vnfm_key, vnfm_values in vnfm_params.iteritems(): + register_vnfm_helper(vnfm_key, vnfm_values, parameters) + + +def onboard_vnf(parameters): + vnfs = parameters["vnfs"] + vnf_onboard_outputs = {} + + for key, value in vnfs.items(): + vnf_onboard_string = 'oclip vfc-catalog-onboard-vnf -c {}'.format(value.get("csar-id")) + vnf_onboard_outs[key] = (os.popen(ns_onboard_string)).read() + return vnf_onboard_outputs + +def onboard_ns(parameters): + ns_onboard_string = 'oclip vfc-catalog-onboard-ns -c {}'.format(parameters["ns-csar-id"]) + ns_onboard_out = (os.popen(ns_onboard_string)).read() + return ns_onboard_out + +def create_ns(parameters, csar_id): + ns = parameters["ns"] + ns_create_string = 'oclip vfc-nslcm-create -m {} -c {} -n {} -q {} -S {}'.format(parameters["vfc-url"], \ + csar_id, ns.get("name"), parameters["customer_name"], parameters["service_name"]) + print ns_create_string + ns_create_out = (os.popen(ns_create_string)).read() + print ns_create_out + ns_instance_id = (get_out_helper_2(ns_create_out))[3] + return ns_instance_id + +def instantiate_ns(parameters, ns_instance_id): + ns_instantiate_string = 'oclip vfc-nslcm-instantiate -m {} -i {} -c {} -n {}'.format(parameters["vfc-url"], \ + ns_instance_id, parameters["location"], parameters["sdc-controller-id"]) + print ns_instantiate_string + + ns_instantiate_out = (os.popen(ns_instantiate_string)).read() + return ns_instantiate_out + +def create_ns_package(parameters): + ns = parameters["ns"] + create_ns_string = 'oclip vfc-catalog-create-ns -m {} -c {} -e {}'.format(parameters["vfc-url"], \ + ns.get("key"), ns.get("value")) + cmd_out = (os.popen(create_ns_string)).read() + out_list = get_out_helper_2(cmd_out) + return out_list[4] + +def create_vnf_package(parameters): + vnfs = parameters["vnfs"] + outputs = {} + + for vnf_key, vnf_values in vnfs.iteritems(): + create_vnf_string = 'oclip vfc-catalog-create-vnf -m {} -c {} -e {}'.format(parameters["vfc-url"], \ + vnf_values.get("key"), vnf_values.get("value")) + cmd_out = (os.popen(create_vnf_string)).read() + out_list = get_out_helper_2(cmd_out) + outputs[vnf_key] = out_list[4] + + return outputs + +def upload_ns_package(parameters, ns_package_output): + ns = parameters["ns"] + ns_upload_string = '{}/api/nsd/v1/ns_descriptors/{}/nsd_content'.format(parameters["vfc-url"], ns_package_output) + print ns_upload_string + print ns.get("path") + resp = requests.put(ns_upload_string, files={'file': open(ns.get("path"), 'rb')}) + return resp + +def upload_vnf_package(parameters, vnf_package_output): + vnfs = parameters["vnfs"] + for vnf_key, vnf_values in vnfs.iteritems(): + vnf_upload_str = '{}/api/vnfpkgm/v1/vnf_packages/{}/package_content'.format(parameters["vfc-url"], \ + vnf_package_output[vnf_key], vnf_package_output[vnf_key]) + resp = requests.put(vnf_upload_str, files={'file': open(vnf_values.get("path"), 'rb')}) + return resp + + +def provision_vnf(): + + result_json = {} + result_json['vnf_id'] = '' + result_json['vnf_status'] = '' + result_json['ns_id'] = '' + result_json['ns_status'] = '' + + # 1.Setup cloud and service + #setup cloud and region + create_complex(parameters) + register_all_clouds(parameters) + + # setup subscription and customer + create_service_type(parameters) + create_customer(parameters) + add_customer_subscription(parameters) + + # setup vnfm + register_vnfm(parameters) + + # Setup License + vlm_output = create_vlm(parameters) + print "vlm parameters={}".format(vlm_output) + + # 2. on-board VSP + vsp_id = create_vsp(parameters, vlm_output) + print "vsp id={}".format(vsp_id) + + # 3. model VF + vf_model_dict = create_vf_model(parameters, vsp_id) + print "vf model parameters={}".format(vf_model_dict) + vf_id = vf_model_dict["vf_id"] + vf_unique_id = vf_model_dict["vf_unique_id"] + + # 4. model NS and 5. Approve and distribute + service_model_list = create_service_model(parameters, vf_unique_id) + print "service model parameters={}".format(service_model_list) + + # 6. onboard VNF + vnf_onboard_output = onboard_vnf(parameters) + print vnf_onboard_output + + # 7. onboard NS + ns_onboard_out = onboard_ns(parameters) + print ns_onboard_out + + # 8. create NS + ns_instance_id = create_ns(parameters, ns_package_output) + print ns_instance_id + + instantiate_ns_output = instantiate_ns(parameters, ns_instance_id) + print instantiate_ns_output + + return result_json + +def persist_result(result_path, result): + f = open(result_json_path, "w") + + result_json = {} + result_json['vnf_id'] = result['vnf_id'] + result_json['vnf_status'] = result['vnf_status'] + result_json['ns_id'] = result['ns_id'] + result_json['ns_status'] = result['ns_status'] + + f.write(json.dumps(result_json)) + + print result_json + + f.close() + +#Main +parser = argparse.ArgumentParser() +parser.add_argument('--config-json', action='store', dest='config_file_path', help='Config file path') +parser.add_argument('--vsp', action='store', dest='vsp', help='ONAP VSP') +parser.add_argument('--vnf-csar', action='store', dest='vnf_csar', help='VNF CSAR') +parser.add_argument('--ns-csar', action='store', dest='ns_csar', help='NS CSAR') +parser.add_argument('--vnfm-driver', action='store', dest='vnfm_driver', help='gVNFM or hwVNFM') +parser.add_argument('--result-json', action='store', dest='result_json_path', help='Output result json') + +#Retrive the params +args = parser.parse_args() +print args + +config_file = open(args.config_file_path) +vsp = args.vsp +vnf_csar = args.vnf_csar +ns_csar = args.ns_csar +vnfm_driver = args.vnfm_driver +result_json_path = args.result_json_path + +# setup CLI +parameters = get_parameters(config_file) +set_open_cli_env(parameters) + +output = provision_vnf() + +persist_result(result_json_path, output) + +print "Provision is completed !" \ No newline at end of file diff --git a/products/onap-dublin/features/pom.xml b/products/onap-dublin/features/pom.xml index 4fa428b5..95b25338 100644 --- a/products/onap-dublin/features/pom.xml +++ b/products/onap-dublin/features/pom.xml @@ -41,6 +41,7 @@ sdnc so vnfsdk + integration -- cgit 1.2.3-korg