Merge "fixed oclip.sh execption on ubuntu"
[cli.git] / docs / user_guide_end_to_end_onap_cli_commands.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2017 Huawei Technologies Co., Ltd.
4
5 .. _end_to_end_onap_cli_commands:
6
7
8 End-to-End command guide for working with ONAP
9 ==============================================
10
11 This document demonstrates end to end working with ONAP using cli.
12
13 Currently, in ONAP, it is getting initialized by robot script (`demo.sh init`),
14 which requires programming knowledge to modify the scripts as per the requirement.
15 Cli provides an interface to communicate with different services in ONAP and it can
16 be used to configure ONAP as per requirement without any programming knowledge.
17
18 Following operations are involved to deploy a VNF.
19
20 CLI communicate with:
21
22 - SDC to
23     - Create Vendor License Model (VLM)
24     - Create Vendor Software Product (VSP), VF and Service
25     - Distribute service
26
27 - Policy to
28     - Put HPA policies
29
30 - AAI to create
31     - Complex
32     - Cloud
33     - Customer
34     - Service-type
35         - Add customer subscription
36
37 - Multicloud to
38     - register cloud with multicloud to discover HPA
39
40 - SO to create
41     - Service-instance
42     - VNF Instance
43     - VF module (deploys stack)
44
45 - SDNC to
46     - Preload VF module parameters
47
48
49
50 Creating Vendor License Model (VLM)
51 ===================================
52
53 For creating a VLM we need to define in SDC using CLI:
54 - entitlement pool
55 - key group
56 - feature group
57 - license agreement
58
59
60 Create license
61 --------------
62
63 Run following command to create license.
64
65 ::
66
67   onap>vlm-create -x ${vendor-name} -u cs0008 -p demo123456! -m ${sdc-onboarding-url}
68
69 **Output**: vlm-id, vlm-version
70
71 Create license entitlement pool
72 -------------------------------
73
74 Run following command to create license entitlement pool.
75
76 ::
77
78   onap>vlm-entitlement-pool-create -x ${entitlement-pool-name} -y ${vlm-id} -e ${vlm-version} -z ${entitlement-pool-description} -k ${vendor-name} -g {license-expiry-date} -l {license-start-date} -u cs0008 -p demo123456! -m ${sdc-onboarding-url}
79
80 **Output**: vlm-entitlement-pool-id
81
82 Create license key group
83 ------------------------
84
85 Run following command to crate license key group.
86
87 ::
88
89   onap>vlm-key-group-create -c ${vlm-id} -e ${vlm-version} -x {key-group-name} -y {key-group-type} -u cs0008 -p demo123456! -m ${sdc-onboarding-url}
90
91 **Output**: key-group-id
92
93 Create license feature group
94 ----------------------------
95
96 Run following command to create license feature group.
97
98 ::
99
100   onap>vlm-feature-group-create -x ${feature-group-name} -y ${vlm-id} -e {vlm-version} -z {feature-grp-description} -g ${key-group-id} -b ${vlm-entitlement-pool-id} -c ${part-no} -u cs0008 -p demo123456! -m ${sdc-onboarding-url}
101
102 **Output**: feature-group-id
103
104
105 Create license agreement
106 ------------------------
107
108 Run following command to create license agreement.
109
110 ::
111
112   onap>vlm-aggreement-create -x ${aggreement-name} -y ${vlm-id} -e ${vlm-version} -z ${agreement-description} -g ${feature-group-id} -u cs0008 -p demo123456! -m ${sdc-onboarding-url}
113
114 **Output**: agreement-id
115
116
117 Now, VLM is ready to submit.
118
119 Checkin and submin vlm
120 ----------------------
121
122 Run following command to check-in and submit created VLM.
123
124 ::
125
126
127   vlm-submit -x ${vlm-id} -y ${vlm-version} -u cs0008 -p demo123456! -m ${sdc-onboarding-url}
128
129
130 Now, VLM is available in catalog to be used for VSP.
131
132
133 Create and distribute Vendor Software Product (VSP)
134 ===================================================
135
136 Service distribution involves following steps:
137 - Create, validate and submit VSP
138 - Creation and certificaion of VF
139 - Creation and certification of Service
140
141 Create VSP
142 ----------
143
144 Run following command to create VSP.
145
146 ::
147
148   onap>vsp-create -j ${feature-group-id} -o ${onboarding-method} -e ${vendor-name} -x ${vsp-name} -y ${vsp-description} -i ${aggreement-id} -c ${vlm-version} -g ${vlm-id} -u cs0008 -p demo123456! -m ${sdc-onboarding-url}
149
150
151 **Output**: vsp-id, vsp-version
152
153
154 Add artifact to VSP
155 -------------------
156
157 This command associates artifacts to VSP.
158
159 ::
160
161   onap>vsp-add-artifact -x ${vsp-id} -y ${vsp-version}  -z ${csar-file} -u cs0008 -p demo123456! -m ${sdc-onboarding-url}
162
163 Validate VSP
164 ------------
165
166 After uploading artifacts to VSP you need to validate the VSP using following command.
167
168 ::
169
170   onap>vsp-validate -x ${vsp-id} -y ${vsp-version} -u cs0008 -p demo123456! -m ${sdc-onboarding-url}
171
172
173
174 NOTE: In most cases `warning` is reported for VSP validation, this can be ignored.
175
176 Submit VSP
177 ----------------------
178
179 After VSP validation it can be checked in and submit. Run following command to
180 complete check-in and VSP submission.
181
182 ::
183
184   onap>vsp-submit -x ${vsp-id} -y ${vsp-version} -u cs0008 -p demo123456! -m ${sdc-onboarding-url}
185
186 To list created VSPs, run the following command;
187
188 ::
189
190   onap>vsp-list -u cs0008 -p demo123456! -m ${sdc-onboarding-url}
191
192
193 package VSP
194 -----------
195
196 After submitting VSP you require to generate CSAR artifact which can be done using
197 following command.
198
199 ::
200
201   onap>vsp-package -x ${vsp-id} -y ${vsp-version} -u cs0008 -p demo123456! -m ${sdc-onboarding-url}
202
203 Now, you can proceed for defining VF.
204
205 Create vf model for VSP
206 -----------------------
207
208 Run following command to create VF by specifying correct VSP id.
209
210 ::
211
212   onap> vf-model-create -x ${vf-model-name} -y ${vf-model-description} -g ${vsp-version} -z ${vlm-vendor-name} -b ${vsp-id} -u cs0008 -p demo123456! -m ${sdc-catalog-url}
213
214 Output: vf-model-id
215
216 To view newly created vf;
217 ::
218
219  onap> vf-model-list -u cs0008 -p demo123456! -m ${sdc-catalog-url}
220
221 Save the **vf-unique-id** , it will be used for certification
222
223 Now, VF is ready for certification.
224
225
226 Certify VF
227 ----------
228
229 Certification will be conducted by tester(jm0007), tester can use following command
230 to mark VF certification start and complete.
231
232 ::
233
234   onap> vf-model-certify -b ${vf-unique-id} -r ${vf-remarks} -u cs0008 -p demo123456! -m ${sdc-catalog-url}
235
236 After certifications, the id values change so run the above vf-model-list command to see the new values which will be used in the next steps.
237 After successful VF creation you can proceed for service model creation.
238
239 Create service model
240 --------------------
241
242 Run following command to create service model.
243
244 ::
245
246   onap>service-model-create -x ${service-model-name} -y ${service-model-description} -z ${project-code} -e ${icon-id} -c ${category-display} -b ${category} -u cs0008 -p demo123456! -m ${sdc-catalog-url}
247
248 **project code can be a random string**
249
250 **Output**: service-model-id
251
252 Add VF to service model
253 -----------------------
254
255 Associate VF to service model using following command.
256
257 ::
258
259   onap>service-model-add-vf -x ${service-model-id} -b ${vf-version} -y ${vf-model-unique-id} -z ${vf-model-name} -u cs0008 -p demo123456! -m ${sdc-catalog-url}
260
261
262 Submit Service for Testing
263 --------------------------------
264
265 Now, service is ready for Testing. Use following command
266 to initiate service test request.
267
268 ::
269
270   onap>service-model-test-request -b ${service-model-id} -u cs0008 -p demo123456! -m ${sdc-catalog-url}
271
272 Test service
273 ---------------
274
275 Now, tester(jm0007) can see service in his dashboard and he can start testing. Tester can use following command to start test and complete test
276
277 ::
278
279   onap>service-model-test-start -b ${service-model-id} -u jm0007 -p demo123456! -m ${sdc-catalog-url}
280
281   onap>service-model-test-accept -b ${service-model-id} -r ${test-remarks} -u jm0007 -p demo123456! -m ${sdc-catalog-url}
282
283   onap>service-model-list -u cs0008 -p demo123456! -m ${sdc-catalog-url}
284
285 Run the above list command to get the service-model-unique-id, it will be used to approve the service model
286
287
288 Approve service model
289 ---------------------
290
291 After successful Testing, service will be submitted to governor(gv0001) to
292 approve service model.
293
294 ::
295
296   onap>service-model-approve -b ${service-model-unique-id} -r ${approval-remarks} -u gv0001 -p demo123456! -m ${sdc-catalog-url}
297
298   onap>service-model-list -u cs0008 -p demo123456! -m ${sdc-catalog-url}
299
300
301 Distribute service model
302 ------------------------
303
304 Now operator can distribute the service and it will be available in VID dashboard.
305
306 ::
307
308   onap>service-model-distribute -b ${service-model-unique-id} -u op0001 -p demo123456! -m ${sdc-catalog-url}
309
310   onap>service-model-list -u cs0008 -p demo123456! -m ${sdc-catalog-url}
311
312 Creating Policies (Only Required if HPA is being Used)
313 ======================================================
314 Before Running these commands to create policies, you must have uploaded policy models. See Method 2 (Manual upload) `here <https://wiki.onap.org/display/DW/OOF+-+HPA+guide+for+integration+testing>`_
315
316 ::
317
318   onap> policy-create-outdated -m ${pdp-url} -u testpdp -p alpha123 -x ${policy-name} -S ${policy-scope} -T ${policy-config-type} -o ${policy-onap-name} -b ${policy}
319
320   onap> policy-push-outdated -m ${pdp-url} -u testpdp -p alpha123 -x ${policy-name} -b ${policy-config-type} -c ${policy-pdp-group}
321
322 When creating policies, the resource-module-name of the vf-model is required. This can be gotten by running the following command;
323
324 ::
325
326   onap> get-resource-module-name -u cs0008 -p demo123456! -m ${sdc-catalog-url}
327
328 **Note:** See Step 16 in `vFW with HPA Tutorial: Setting Up and Configuration <https://onap.readthedocs.io/en/casablanca/submodules/integration.git/docs/docs_vfwHPA.html#docs-vfw-hpa>`_
329 for sample policies as well as example values for policy-scope, config-type ...etc.
330
331
332 Creating Cloud, Customer and Service-type
333 =========================================
334
335 It is required to specify the complex and cloud configuration in AAI system before deploying
336 the service. Following are the steps to configure cloud and related information
337 for service deployment.
338
339
340 Create Complex
341 --------------
342 ::
343
344   onap>complex-create -x ${complex-name} -r ${physical-location} -y ${data-center-code} -l ${region} -i ${street-1-name} -j ${street-2-name}  -lt ${latitude} -lo ${longitude} -S ${state}  -la ${lata} -g ${city} -w ${postal-code} -z ${complex-name} -k ${country} -o ${elevation} -q ${identity-url} -m ${aai-url} -u AAI -p AAI
345
346 Create Cloud
347 ------------
348
349 Use following command to create cloud and region in AAI system.
350
351 ::
352
353   onap>cloud-create -x ${cloud-owner-name} -y ${cloud-region-name} -e ${esr-system-info-id} -b ${cloud-user-name} -j ${cloud-user-password} -I ${extra-info} -w ${cloud-region-version} -l ${default-tenant} -url ${keystone-url} -n ${complex-name} -q ${cloud-type} -r ${owner-defined-type} -Q ${system-type} -i ${identity-url} -g ${cloud-zone} -z ${ssl-insecure-boolean} -k ${system-status} -c ${cloud-domain} -m ${aai-url} -u AAI -p AAI
354
355 **Sample Command**
356 ::
357
358  onap> cloud-create -e 5c85ce1f-aa78-4ebf-8d6f-4b62773e9ade -b ${cloud-username} -I {\\"openstack-region-id\\":\\"ONAP-POD-01-Rail-06\\"} -x CloudOwner -y ONAP-POD-01-Rail-06 -j ${cloud-password} -w titanium_cloud -l Integration-HPA -url http://10.12.11.1:5000/v3 -n clli1 -q openstack -r t1 -Q VIM -i url -g CloudZone -z true -k active -c Default
359
360
361
362 Associate Cloud Region with complex
363 -----------------------------------
364 ::
365
366   onap> complex-associate -x ${complex-name} -y ${cloud-region} -z ${cloud-owner} -m ${aai-url} -u AAI -p AAI
367   onap> cloud-list -u AAI -p AAI -m ${aai-url}
368
369
370 Register Cloud Region with Multicloud (only required for HPA)
371 -------------------------------------------------------------
372
373 ::
374
375   onap> multicloud-register-cloud -y ${cloud-owner} -x ${cloud-region} -m ${multicloud-url}
376
377
378 Create Customer
379 ---------------
380
381 A customer subscribes for the service. Use follwing command to create customer.
382
383 ::
384
385   onap>customer-create -x ${customer-name} -y ${subscriber-name} -u AAI -p AAI -m ${aai-url}
386
387   onap>customer-list -u AAI -p AAI -m ${aai-url}
388
389
390 Create service type
391 -------------------
392
393 Use following command to create service type.
394
395 ::
396
397   onap>service-type-create -x ${service-name} -u AAI -p AAI -m ${aai-url}
398
399   onap>service-type-list -u AAI -p AAI -m ${aai-url}
400
401 Create subscription
402 -------------------
403
404 Use the following command to create subscription for a customer.
405
406 ::
407
408   onap>subscription-create -x ${customer-name} -z ${cloud-owner} -c ${tenant-id} -e ${service-name} -y ${default-tenant} -r ${cloud-region} -m ${aai-url} -u AAI -p AAI
409
410
411 If the subscription has already been created, you can add more clouds to it using the following command;
412
413 ::
414
415   onap>subscription-cloud-add -x ${customer-name} -z ${cloud-owner} -c ${tenant-id} -e ${service-name} -y ${default-tenant} -r ${cloud-region} -m ${aai-url} -u AAI -p AAI
416
417
418 Create Service-instance, VNF Instance and deploy VFMODULE
419 =========================================================
420
421 Now, all the required configuration and artifacts are available for the SO service to
422 create a service-instance, VNF-Instance and VFMODULE.
423
424 Create service instance
425 -----------------------
426
427 Using following command you can create service-instance in specified cloud region.
428 Command requires service model identifier which can be obtained from previously
429 used CLIs for creating and listing service model.
430
431 ::
432
433   onap> service-create -w ${service-name} -la ${customer-latitude} -lo ${customer-longitude} -o ${orchestrator} -A {alacart-boolean} -i ${service-model-name} -y ${company-name} -x ${project-name} -q ${requestor-id} -O ${owning-entity-name} -k ${service-instance-name} -P ${test-api} -H ${homing-solution} -n ${service-model-uuid} -e ${service-model-invariant-uuid} -j ${service-model-version} -S ${subscriber-name} -g ${service-model-uuid} -z ${owning-entity-id} -c ${customer-name} -u InfraPortalClient -p password1$ -m ${so-url}
434
435 When Homing and HPA are not being used, you do not need to specify longitude, latitude, homing-solution, orchestator
436
437 **Sample service-create commands**
438
439 **Without Homing**
440 ::
441
442   onap> service-create -w vFW -o multicloud -A true -i vfw-demo-service -y some_company  -x Project-Demonstration -q demo -O OE-Demonstration -k rand-2 -P VNF_API -n 545bca3c-8cc0-4dac-b464-1720894e0213 -e 41d0ebba-4b89-4437-9b22-4d83d2183aaa -j 1.0 -S Demonstration -g 545bca3c-8cc0-4dac-b464-1720894e0213 -z d005274f-d295-4538-a6b0-a090a7807dae -c Demonstration -u InfraPortalClient -p password1$ -m http://192.168.1.147:30277
443
444 **With Homing**
445 ::
446
447   onap> service-create -w vFW -la 32.897480 -lo 97.040443 -o multicloud -A true -i vfw-demo-service -y some_company  -x Project-Demonstration -q demo -O OE-Demonstration -k cli-instance-new -P VNF_API -H oof -n 545bca3c-8cc0-4dac-b464-1720894e0213 -e 41d0ebba-4b89-4437-9b22-4d83d2183aaa -j 1.0 -S Demonstration -g 545bca3c-8cc0-4dac-b464-1720894e0213 -z d005274f-d295-4538-a6b0-a090a7807dae -c Demonstration -u InfraPortalClient -p password1$ -m http://192.168.1.147:30277
448
449 You can get the values for the owning entity by running the following command;
450 ::
451
452   onap> owning-entity-list -u AAI -p AAI -m ${aai-url}
453
454 Create VNF Instance
455 -------------------
456
457 Use the following command to create the VNF instance, Do a Preload and create the VFModule in a particular cloud region
458
459 ::
460
461    onap> vnf-create -j ${service-model-invariant-uuid} -q ${service-model-name} -k ${service-model-id} -l ${cloud-region} -y ${service-instance-id} -z ${tenant-id} -r ${requestor-id} -c ${vf-model-uuid} -o ${generic-vnf-name} -e ${vf-model-name} -g ${vf-model-version} -b ${vf-model-invariant-uuid} -n ${service-version} -i ${vf-model-customization-id} -vn ${vf-model-customization-name} -w ${service-name} -pn ${platform-name} -lob ${lob-name} -u InfraPortalClient -p password1$ -m ${so-url}
462
463 **Output:** vnf-id
464
465
466 **Sample vnf-create command**
467 ::
468
469   onap>  vnf-create -j 41d0ebba-4b89-4437-9b22-4d83d2183aaa -q vfw-demo-service -k 545bca3c-8cc0-4dac-b464-1720894e0213 -l cloud-two -y 43143a2c-f0e1-499d-b042-97fb0c05166b -z a0ea4cfd751e40e0a093848dd9e03e6c -r demo  -c 04ffd583-5625-4471-b20b-38394b513efd -o cli-vnf-test -e vfw-hpa-sriov_v2 -g 1.0 -b b7d993a3-3870-4096-a16c-90110d402349 -n 1.0 -i 123f896f-c6a4-4560-8786-7607e832bb6f -vn "vfw-hpa-sriov_v2 0" -w vFW -pn Platform-Demonstration -lob LOB-Demonstration -u InfraPortalClient -p password1$ -m http://192.168.1.147:30277
470
471
472 Preload VF-Module
473 -----------------
474 ::
475
476   onap> vf-preload -y ${preload-file} -u admin -p Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U -m ${sdnc-url}
477
478 See Step 20 of `vFW with HPA Tutorial: Setting Up and Configuration <https://onap.readthedocs.io/en/casablanca/submodules/integration.git/docs/docs_vfwHPA.html#docs-vfw-hpa>`_ for sample preload file.
479
480 Create VF-module
481 ----------------
482 ::
483
484   onap>  vf-module-create -w ${tenant-id} -mn ${vf-model-customization-name} -x ${service-instance-id} -l ${cloud-region} -sv ${service-version} -vc ${vf-module-customization-id} -vm ${v-module-model-version} -mv ${vf-model-version} -i ${vf-module-name} -vf ${vf-model-name} -vi ${vf-module-model-invariant-id} -r ${suppress-rollback-boolean} -mc ${vf-model-customization-id} -api ${test-api} -mi ${vf-model-invariant-id} -vid ${vf-model-id} -y ${vnf-instance-id} -R ${requestor-id} -si ${service-uuid} -up ${use-preload} -sd ${service-invariat-id} -z ${service-model-name} -vn ${vf-module-model-name} -vv ${vf-module-model-version-id} -co ${cloud-owner} -u InfraPortalClient -p password1$ -m ${so-url}
485
486 **Sample vf-module-create command**
487 ::
488
489   onap> vf-module-create -w a0ea4cfd751e40e0a093848dd9e03e6c -mn "vfw-hpa-sriov_v2 0" -x d353ace3-52e9-4c79-b3c8-63c97e15cc29 -l cloud-two -sv 1.0 -vc 0f837829-0dbb-4768-88d4-3cdf01e073f6 -vm 1 -mv 1.0 -i vfw-sriov-cli -vf vfw-hpa-sriov_v2 -vi 8d3071e4-0d4e-4520-aa92-c01b9a019142 -r false -mc 123f896f-c6a4-4560-8786-7607e832bb6f -api VNF_API -mi b7d993a3-3870-4096-a16c-90110d402349 -vid 04ffd583-5625-4471-b20b-38394b513efd -y dad645a3-7e01-47cd-8e70-cdc8b5e880ec -R demo -si 545bca3c-8cc0-4dac-b464-1720894e0213 -up true -sd 41d0ebba-4b89-4437-9b22-4d83d2183aaa -z vfw-demo-service -vn VfwHpaSriovV2..base_vfw..module-0 -vv d5c83591-0f22-4543-ada2-24197847b7d2 -u InfraPortalClient -p password1$ -m http://192.168.1.147:30277