ff67ee5e69232be656d6060052217e55d62fbe44
[cli.git] /
1 # Copyright 2019 Huawei Technologies Co., Ltd.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 open_cli_schema_version: 1.0
16 name: vnf-tosca-provision
17 description: |
18   ONAP TOSCA VNF validation using ONAP CLI and Open Command Platform (OCOMP)
19
20   This command runs in 5 mode:
21   1. setup:    Create requires Vendor, Service Subscription and VNF cloud in ONAP
22   2. standup:  From the given VSP csar, VNF csar and NS csar, it creates VF Model, NS Model and NS service
23   3. cleanup:  Remove those entries provided in onap-objects parameter
24   4. provision:Run setup -> standup
25   5. validate: Run setup -> standup -> cleanup
26
27   On every execution, it reports the ONAP managed object's ids in result onap-objects attribute. so
28   if requires, these attribute value could be passed in input parameter onap-objects on subsequent
29   executions to avoid recreation of these ONA managed objects
30
31   prerequisites
32   -------------
33   1. Setup the OCOMP profile to configure the ONAP service URL and creadentials as given below
34
35   a. Run command 'oclip' to go to OCOMP interactive mode
36
37   b. Type 'use onap-dublin' to choose the onap-dublin product
38
39   c. Type 'profile onap-dublin' to create or to use existing onap-dublin profile
40
41   d. Set following entries:
42     set sdc.onboarding:host-url=http://159.138.8.8:30280
43     set sdc.onboarding:host-username=cs0008
44     set sdc.onboarding:host-password=demo123456!
45     set sdc.catalog:host-url=http://159.138.8.8:30205
46     set sdc.catalog:host-password=demo123456\!
47     set sdc.catalog:host-username=cs0008
48     set sdc.catalog:service-model-approve:host-username=gv0001
49     set sdc.catalog:service-model-distribute:host-username=op0001
50     set sdc.catalog:service-model-test-start:host-username=jm0007
51     set sdc.catalog:service-model-test-accept:host-username=jm0007
52     set sdc.catalog:service-model-add-artifact:host-username=ocomp
53     set sdc.catalog:vf-model-add-artifact:host-username=ocomp
54     set aai:host-url=https://159.138.8.8:30233
55     set aai:host-username=AAI
56     set aai:host-password=AAI
57     set vfc:host-url=http://159.138.8.8:30280
58     set multicloud:host-url=http://159.138.8.8:30280
59
60     NOTE:
61     By default, SDC onboarding service does not provide node port, which is available to access from external ONAP network.
62     so to enable for external access, register the SDC onboarding service into MSB and use MSB url for sdc.onboarding:host-url.
63
64       oclip --product onap-dublin microservice-create --host-url http://159.138.8.8:30280 --service-name sdcob --service-version v1.0 --service-url /onboarding-api/v1.0 --path /onboarding-api/v1.0  --node-ip 172.16.1.0 --node-port 8081
65
66       oclip --product onap-dublin microservice-create --host-url http://159.138.8.8:30280 --service-name sdcobs --service-version v1.0 --service-url /onboarding-api/v1.0 --path /onboarding-api/v1.0  --node-ip 172.16.1.0 --node-port 8445 --enable-ssl
67
68       Find out SDC onboarding service IP and port details as given here:
69         [root@onap-dublin-vfw-93996-50c1z ~]# kubectl get pods -n onap -o wide | grep sdc-onboarding-be
70         dev-sdc-sdc-onboarding-be-5564b877c8-vpwr5                        2/2     Running            0          29d   172.16.1.0     192.168.2.163   <none>           <none>
71         dev-sdc-sdc-onboarding-be-cassandra-init-mtvz6                    0/1     Completed          0          29d   172.16.0.220   192.168.2.163   <none>           <none>
72         [root@onap-dublin-vfw-93996-50c1z ~]#
73
74         Note down the IP address for sdc-onboarding-be 172.16.1.0
75
76         [root@onap-dublin-vfw-93996-50c1z ~]# kubectl get services -n onap -o wide | grep sdc-onboarding-be
77         sdc-onboarding-be                                           ClusterIP      10.247.198.92    <none>                                 8445/TCP,8081/TCP                                             29d   app=sdc-onboarding-be,release=dev-sdc
78         [root@onap-dublin-vfw-93996-50c1z ~]#
79
80         Note down the port for sdc-onboarding-be 8445 8081
81
82         Similarly, other service IP and Port could be discovered like above, in case not know earlier :)
83
84      This profile would be used while running the command with ONAP setup configured in it, as below
85        oclip --profile onap-dublin vnf-tosca-provision .....
86
87   e. Verify these details once by typing 'set'
88
89   f. Exit from the interactive console by typing 'exit'
90
91   2. Setup SDC consumer
92     oclip --product onap-dublin --profile onap-dublin sdc-consumer-create --consumer-name ocomp
93
94   3. Update the cloud and vnfm driver details in the configuration file $OPEN_CLI_HOME/conf/vnf-tosca-provision.json
95
96 info:
97   product: onap-dublin
98   service: vnf-validation
99   author: ONAP VTP Team kanagaraj.manickam@huawei.com
100
101 parameters:
102   - name: config-json
103     description: Configuration file path
104     type: string
105     short_option: x
106     long_option: config-json
107     default_value: $s{env:OPEN_CLI_HOME}/conf/vnf-tosca-provision.json
108     is_optional: false
109   - name: vsp
110     description: Path to the ONAP vendor service product (VSP) for the VNF to provision
111     type: binary
112     short_option: y
113     long_option: vsp
114     is_optional: false
115   - name: vnf-csar
116     description: Path to the TOSCA CSAR for the VNF to provision
117     type: binary
118     short_option: r
119     long_option: vnf-csar
120     is_optional: false
121   - name: ns-csar
122     description: Path to the TOSCA CSAR for the NS service to provision
123     type: binary
124     short_option: b
125     long_option: ns-csar
126     is_optional: true
127     default: false
128   - name: vnfm-driver
129     description: VNFM driver to use. One of gvnfmdriver or hwvnfmdriver
130     type: string
131     short_option: c
132     long_option: vnfm-driver
133     is_optional: false
134   - name: onap-objects
135     description: Existing ONAP object ids to use instead of creating them while running this task
136     type: json
137     short_option: Z
138     long_option: onap-objects
139     is_optional: true
140     default_value: {}
141   - name: mode
142     description: setup or standup or cleanup or provision or validate
143     type: string
144     short_option: Y
145     long_option: mode
146     is_optional: true
147     default_value: checkup
148   - name: vnf-name
149     description: VNF Name
150     type: string
151     short_option: A
152     long_option: vnf-name
153     is_optional: false
154   - name: vnf-vendor-name
155     description: VNF Vendor Name
156     type: string
157     short_option: B
158     long_option: vnf-vendor-name
159     is_optional: false
160 results:
161   direction: portrait
162   attributes:
163     - name: vnf-id
164       description: ONAP VNF instance id
165       scope: short
166       type: string
167     - name: vnf-status
168       description: Onap VNF status
169       scope: short
170       type: string
171     - name: ns-id
172       description: Onap NS service instance id
173       scope: short
174       type: string
175     - name: ns-status
176       description: Onap NS status
177       scope: short
178       type: string
179     - name: vnfm-driver
180       description: VNFM driver used
181       type: string
182       scope: short
183     - name: onap-objects
184       description: ONAP object used
185       type: json
186       scope: short
187     - name: vnf-vendor-name
188       description: VNF Vendor Name
189       type: string
190       scope: short
191     - name: vnf-name
192       description: VNF Name
193       type: string
194       scope: short
195 cmd:
196   command:
197     -  python $s{env:OPEN_CLI_HOME}/script/vnf-tosca-provision.py --vendor-name ${vnf-vendor-name} --vnf-name ${vnf-name} --mode ${mode} --result-json $s{tmp:result.json:onap-objects} --conf ${config-json} --vsp ${vsp} --vnf-csar ${vnf-csar} --ns-csar ${ns-csar} --vnfm-driver ${vnfm-driver}
198   success_codes:
199     - 0
200   working_directory: .
201   output: $s{tmp:result.json}
202   result_map:
203     vnf-id: $o{$.vnf_id}
204     vnf-status: $o{$.vnf_status}
205     ns-id: $o{$.ns_instance_id}
206     ns-status: $o{$.ns_instance_status}
207     vnfm-driver: ${vnfm-driver}
208     vnf-name: ${vnf-name}
209     vnf-vendor-name: ${vnf-vendor-name}
210     onap-objects: $o{$}