908d33dc0742a117bc9e33cb79d81cc6065156a3
[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   NOTE: Before using this command, configure the $OPEN_CLI_HOME/conf/vnf-tosca-provision.json
20
21   This command runs in 4 mode:
22   1. setup: Create requires Vendor, Service Subscription and VNF cloud in ONAP
23   2. standup: From the given VSP csar, VNF csar and NS csar, it creates VF Model, NS Model and NS service
24   3. cleanup: Remove those entries provided in onap-objects parameter
25   4. 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 info:
32   product: onap-dublin
33   service: vnf-validation
34   author: ONAP VTP Team onap-discuss@lists.onap.org
35
36 parameters:
37   - name: config-json
38     description: Configuration file path
39     type: string
40     short_option: x
41     long_option: config-json
42     default_value: $s{env:OPEN_CLI_HOME}/conf/vnf-tosca-provision.json
43     is_optional: false
44   - name: vsp
45     description: Path to the ONAP vendor service product (VSP) for the VNF to provision
46     type: binary
47     short_option: y
48     long_option: vsp
49     is_optional: false
50   - name: vnf-csar
51     description: Path to the TOSCA CSAR for the VNF to provision
52     type: binary
53     short_option: r
54     long_option: vnf-csar
55     is_optional: false
56   - name: ns-csar
57     description: Path to the TOSCA CSAR for the NS service to provision
58     type: binary
59     short_option: b
60     long_option: ns-csar
61     is_optional: true
62     default: false
63   - name: vnfm-driver
64     description: VNFM driver to use. One of gvnfmdriver or hwvnfmdriver
65     type: string
66     short_option: c
67     long_option: vnfm-driver
68     is_optional: false
69   - name: onap-objects
70     description: Existing ONAP object ids to use instead of creating them while running this task
71     type: json
72     short_option: Z
73     long_option: onap-objects
74     is_optional: true
75     default_value: {}
76   - name: mode
77     description: setup or standup or cleanup
78     type: string
79     short_option: Y
80     long_option: mode
81     is_optional: true
82     default_value: validate
83   - name: vnf-name
84     description: VNF Name
85     type: string
86     short_option: A
87     long_option: vnf-name
88     is_optional: false
89   - name: vnf-vendor-name
90     description: VNF Vendor Name
91     type: string
92     short_option: B
93     long_option: vnf-vendor-name
94     is_optional: false
95 results:
96   direction: portrait
97   attributes:
98     - name: vnf-id
99       description: ONAP VNF instance id
100       scope: short
101       type: string
102     - name: vnf-status
103       description: Onap VNF status
104       scope: short
105       type: string
106     - name: ns-id
107       description: Onap NS service instance id
108       scope: short
109       type: string
110     - name: ns-status
111       description: Onap NS status
112       scope: short
113       type: string
114     - name: vnfm-driver
115       description: VNFM driver used
116       type: string
117       scope: short
118     - name: onap-objects
119       description: ONAP object used
120       type: json
121       scope: short
122     - name: vnf-vendor-name
123       description: VNF Vendor Name
124       type: string
125       scope: short
126     - name: vnf-name
127       description: VNF Name
128       type: string
129       scope: short
130 cmd:
131   command:
132     -  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}
133   success_codes:
134     - 0
135   working_directory: .
136   output: $s{tmp:result.json}
137   result_map:
138     vnf-id: $o{$.vnf_id}
139     vnf-status: $o{$.vnf_status}
140     ns-id: $o{$.ns_instance_id}
141     ns-status: $o{$.ns_instance_status}
142     vnfm-driver: ${vnfm-driver}
143     vnf-name: ${vnf-name}
144     vnf-vendor-name: ${vnf-vendor-name}
145     onap-objects: $o{$}