aboutsummaryrefslogtreecommitdiffstats
path: root/products/onap-dublin/features/integration/src/main/resources/open-cli-schema/vnf-tosca-provision-dublin-schema.yaml
blob: ff67ee5e69232be656d6060052217e55d62fbe44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# 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: vnf-tosca-provision
description: |
  ONAP TOSCA VNF validation using ONAP CLI and Open Command Platform (OCOMP)

  This command runs in 5 mode:
  1. setup:    Create requires Vendor, Service Subscription and VNF cloud in ONAP
  2. standup:  From the given VSP csar, VNF csar and NS csar, it creates VF Model, NS Model and NS service
  3. cleanup:  Remove those entries provided in onap-objects parameter
  4. provision:Run setup -> standup
  5. validate: Run setup -> standup -> cleanup

  On every execution, it reports the ONAP managed object's ids in result onap-objects attribute. so
  if requires, these attribute value could be passed in input parameter onap-objects on subsequent
  executions to avoid recreation of these ONA managed objects

  prerequisites
  -------------
  1. Setup the OCOMP profile to configure the ONAP service URL and creadentials as given below

  a. Run command 'oclip' to go to OCOMP interactive mode

  b. Type 'use onap-dublin' to choose the onap-dublin product

  c. Type 'profile onap-dublin' to create or to use existing onap-dublin profile

  d. Set following entries:
    set sdc.onboarding:host-url=http://159.138.8.8:30280
    set sdc.onboarding:host-username=cs0008
    set sdc.onboarding:host-password=demo123456!
    set sdc.catalog:host-url=http://159.138.8.8:30205
    set sdc.catalog:host-password=demo123456\!
    set sdc.catalog:host-username=cs0008
    set sdc.catalog:service-model-approve:host-username=gv0001
    set sdc.catalog:service-model-distribute:host-username=op0001
    set sdc.catalog:service-model-test-start:host-username=jm0007
    set sdc.catalog:service-model-test-accept:host-username=jm0007
    set sdc.catalog:service-model-add-artifact:host-username=ocomp
    set sdc.catalog:vf-model-add-artifact:host-username=ocomp
    set aai:host-url=https://159.138.8.8:30233
    set aai:host-username=AAI
    set aai:host-password=AAI
    set vfc:host-url=http://159.138.8.8:30280
    set multicloud:host-url=http://159.138.8.8:30280

    NOTE:
    By default, SDC onboarding service does not provide node port, which is available to access from external ONAP network.
    so to enable for external access, register the SDC onboarding service into MSB and use MSB url for sdc.onboarding:host-url.

      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

      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

      Find out SDC onboarding service IP and port details as given here:
        [root@onap-dublin-vfw-93996-50c1z ~]# kubectl get pods -n onap -o wide | grep sdc-onboarding-be
        dev-sdc-sdc-onboarding-be-5564b877c8-vpwr5                        2/2     Running            0          29d   172.16.1.0     192.168.2.163   <none>           <none>
        dev-sdc-sdc-onboarding-be-cassandra-init-mtvz6                    0/1     Completed          0          29d   172.16.0.220   192.168.2.163   <none>           <none>
        [root@onap-dublin-vfw-93996-50c1z ~]#

        Note down the IP address for sdc-onboarding-be 172.16.1.0

        [root@onap-dublin-vfw-93996-50c1z ~]# kubectl get services -n onap -o wide | grep sdc-onboarding-be
        sdc-onboarding-be                                           ClusterIP      10.247.198.92    <none>                                 8445/TCP,8081/TCP                                             29d   app=sdc-onboarding-be,release=dev-sdc
        [root@onap-dublin-vfw-93996-50c1z ~]#

        Note down the port for sdc-onboarding-be 8445 8081

        Similarly, other service IP and Port could be discovered like above, in case not know earlier :)

     This profile would be used while running the command with ONAP setup configured in it, as below
       oclip --profile onap-dublin vnf-tosca-provision .....

  e. Verify these details once by typing 'set'

  f. Exit from the interactive console by typing 'exit'

  2. Setup SDC consumer
    oclip --product onap-dublin --profile onap-dublin sdc-consumer-create --consumer-name ocomp

  3. Update the cloud and vnfm driver details in the configuration file $OPEN_CLI_HOME/conf/vnf-tosca-provision.json

info:
  product: onap-dublin
  service: vnf-validation
  author: ONAP VTP Team kanagaraj.manickam@huawei.com

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/vnf-tosca-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. One of gvnfmdriver or hwvnfmdriver
    type: string
    short_option: c
    long_option: vnfm-driver
    is_optional: false
  - name: onap-objects
    description: Existing ONAP object ids to use instead of creating them while running this task
    type: json
    short_option: Z
    long_option: onap-objects
    is_optional: true
    default_value: {}
  - name: mode
    description: setup or standup or cleanup or provision or validate
    type: string
    short_option: Y
    long_option: mode
    is_optional: true
    default_value: checkup
  - name: vnf-name
    description: VNF Name
    type: string
    short_option: A
    long_option: vnf-name
    is_optional: false
  - name: vnf-vendor-name
    description: VNF Vendor Name
    type: string
    short_option: B
    long_option: vnf-vendor-name
    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
    - name: vnfm-driver
      description: VNFM driver used
      type: string
      scope: short
    - name: onap-objects
      description: ONAP object used
      type: json
      scope: short
    - name: vnf-vendor-name
      description: VNF Vendor Name
      type: string
      scope: short
    - name: vnf-name
      description: VNF Name
      type: string
      scope: short
cmd:
  command:
    -  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}
  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_instance_id}
    ns-status: $o{$.ns_instance_status}
    vnfm-driver: ${vnfm-driver}
    vnf-name: ${vnf-name}
    vnf-vendor-name: ${vnf-vendor-name}
    onap-objects: $o{$}