Reduced code complexity
[cli.git] / docs / user_guide_pnf_on_boarding.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 2018 Huawei Technologies Co., Ltd.
4
5 .. Step to import VNF/PNF:
6
7
8 Step to import VNF/PNF
9 ==============================================
10
11 This document describes how to insert existing PNF/VNF to AAI with CLI project.
12
13 Main steps:
14 1. create customer and service instance in AAI. This step could be done by UUI or VID, OR user can insert customer/service instance node by CLI cmd.
15
16 2. create PNF/VNF
17
18 3. create relation-ship between service-instance and created PNF/VNFs
19
20 4. check the Topology graph through AAI portal
21
22
23 create customer
24 ================
25 optional,since the customer/subscription/service-instance may already exist
26
27 create customer:
28 --------------------
29
30 ::
31
32   onap>customer-create -u AAI -p AAI -m https://172.19.44.123:8443 --customer-name testCustomer --subscriber-name EC
33
34 Check if customer created successfully:
35 -------------------------------------------
36
37 ::
38
39   onap>customer-list -u AAI -p AAI -m https://172.19.44.123:8443
40
41   +--------------+------------------+
42   |name          |resource-version  |
43   +--------------+------------------+
44   |testCustomer  |1521772326346     |
45   +--------------+------------------+
46   |Orange1       |1521771120855     |
47   +--------------+------------------+
48   |Orange        |1520304126184     |
49   +--------------+------------------+
50   |test          |1521098144163     |
51   +--------------+------------------+
52
53 delete customer cmd:
54 -------------------------------------------
55
56 ::
57
58   onap>customer-delete -u AAI -p AAI -m https://172.19.44.123:8443 --customer-name testCustomer --resource-version 1521772326346
59
60
61 create subscription (optional)
62 ==============================
63
64 create subscription cmd:
65 -------------------------
66
67 ::
68
69
70   onap>subscription-create-with-template -u AAI -p AAI -m https://172.19.44.123:8443 --customer-name testCustomer --service-type EC --template /opt/oclip/template/sub-create.json
71
72         content of /opt/oclip/template/sub-create.json:
73             {
74             "service-subscription": [
75                 {
76                     "service-type": "EC",
77                 }
78                  ]
79                 }
80
81
82
83 Check if subscription created successfully:
84 --------------------------------------------
85
86 ::
87
88   onap>subscription-list -u AAI -p AAI -m https://172.19.44.123:8443 --customer-name testCustomer
89
90   output:
91   +--------------+------------------+
92   |service-type  |resource-version  |
93   +--------------+------------------+
94   |EEC           |1521773231094     |
95   +--------------+------------------+
96   |EC            |1522058350020     |
97   +--------------+------------------+
98
99 delete subscription cmd:
100 --------------------------------------------
101
102 ::
103
104   onap>subscription-delete -u AAI -p AAI -m https://172.19.44.123:8443 --customer-name testCustomer --service-type EC --resource-version 1521772326346
105
106 create service instance(optional)
107 =================================
108
109 create service instance with template cmd:
110 ------------------------------------------
111
112
113 ::
114
115   onap>service-instance-create-with-template -u AAI -p AAI -m https://172.19.44.123:8443 --service-instance-id 176d9eba-1662-4289-8396-0097b50fd486 --template /opt/oclip/open-cli-schema/service-instance-template.json  --global-customer-id testCustomer --service-type EC
116
117    content of /opt/oclip/open-cli-schema/service-instance-template.json:
118
119         {
120             "global-customer-id": "testCustomer",
121             "subscriber-name": "EC",
122             "subscriber-type": "INFRA",
123             "service-subscriptions": {
124                 "service-subscription": [
125                     {
126                         "service-type": "EC",
127                         "service-instances": {
128                             "service-instance": [
129                                 {
130                                     "service-instance-id": "176d9eba-1662-4289-8396-0097b50fd486",
131                                     "service-instance-name": "template-service",
132                                     "service-type": "NetworkService",
133                                     "relationship-list": {
134                                     }
135                                 }
136                             ]
137                         }
138                     }
139                 ]
140             }
141         }
142
143
144 Create PNF
145 ==========
146
147     there are many ways to create PNF, cmd:
148
149 A: create pnf with pnf name:
150 ----------------------------
151
152 ::
153
154   onap>pnf-create -u AAI -p AAI -m https://172.19.44.123:8443 -n testcmdpnfname
155
156 B: create pnf with all option (including relationship json):
157 ------------------------------------------------------------
158
159
160 ::
161
162   onap>pnf-create -u AAI -p AAI -m https://172.19.44.123:8443 -n testcmdpnfname -q MME -x generic --in-maint false --prov-status PROV --relationship /opt/oclip/open-cli-schema/pnf-sub-relation.json
163
164        Sample content of /opt/oclip/open-cli-schema/pnf-sub-relation.json:
165
166            {
167                 "relationship": [
168                     {
169                         "related-to": "logical-link",
170                         "related-link": "/aai/v11/network/logical-links/logical-link/S11-00001",
171                         "relationship-data": [
172                             {
173                                 "relationship-key": "logical-link.link-name",
174                                 "relationship-value": "S11-00001"
175                             }
176                         ]
177                     }
178                   ]
179         }
180
181 C: create pnf with template
182 ----------------------------
183 since pnf contains logs of parameters , user can put all the parameters in a json file.e.g to create a PNF with p-interface,user should use this cmd:
184
185
186 ::
187
188   onap>pnf-create-with-template -u AAI -p AAI -m https://172.19.44.123:8443 -n pnf_template -r /opt/oclip/open-cli-schema/pnf-template.json
189
190         Sample content of /opt/oclip/open-cli-schema/pnf-template.json
191
192         {
193             "pnf-name" : "pnf_template",
194             "equip-type" : "pnf_template",
195             "equip-vendor" : "Generic",
196             "in-maint" : "false",
197             "prov-status" : "PROV",
198             "p-interfaces" : {
199                  "p-interface" : [
200                      {
201                         "interface-name" : "pnf_template-p-interface",
202                         "speed-value" : "1",
203                         "speed-units" : "Gbps",
204                         "port-description" : "downstream  port 1",
205                         "interface-type" : "port",
206                         "prov-status" : "PROV",
207                         "in-maint" : "false",
208                         "l-interfaces" : {
209                               "l-interface" : [
210                                    {
211                                         "interface-name" : "pnf_template-i-interface",
212                                         "interface-role" : "Eth logical interface",
213                                         "is-port-mirrored" : "false",
214                                         "prov-status" : "PROV",
215                                         "in-maint" : "false"
216                                    }
217                                ]
218                         }
219                     }
220                  ]
221               }
222             }
223
224 List Created PNF cmd:
225 -----------------------
226
227
228 ::
229
230   onap>pnf-list -u AAI -p AAI -m https://172.19.44.123:8443
231     output:
232             +----------------+--------------------------------------+------------------+
233             |pnf-name        |pnf-id                                |resource-version  |
234             +----------------+--------------------------------------+------------------+
235             |batch-name-2    |176d9eba-1662-4289-8396-0097b50fd470  |1521790894608     |
236             +----------------+--------------------------------------+------------------+
237             |pnf_template    |176d9eba-1662-4289-8396-0097b50fd467  |1521702068121     |
238             +----------------+--------------------------------------+------------------+
239             |testcmdpnfname  |176d9eba-1662-4289-8396-0097b50fd466  |1521687589914     |
240             +----------------+--------------------------------------+------------------+
241             |batch-name-1    |176d9eba-1662-4289-8396-0097b50fd470  |1521790894391     |
242             +----------------+--------------------------------------+------------------+
243             |SPGW-0001       |                                      |1520304310122     |
244             +----------------+--------------------------------------+------------------+
245             |test            |                                      |1520417818047     |
246             +----------------+--------------------------------------+------------------+
247             |MME-000111      |                                      |1520417147010     |
248             +----------------+--------------------------------------+------------------+
249             |MME-0001        |                                      |1520303982165     |
250             +----------------+--------------------------------------+------------------+
251             |SP GW-0001      |                                      |1520304000840     |
252             +----------------+--------------------------------------+------------------+
253
254 Delete PNF cmd:
255 ----------------
256
257 ::
258
259   onap>pnf-delete -n testname -b 1521685031379 -u AAI -p AAI -m https://172.19.44.123:8443
260
261 Create VNF
262 ===========
263
264     there are many ways to create VNF, cmd:
265
266 A: create VNF with VNF id:
267 ---------------------------
268
269 ::
270   onap>vnf-create -u AAI -p AAI -m https://172.19.44.123:8443  --name vn1 --vnf-id d9b1b05f-44c8-45ef-89aa-d27ad060ceb8 --vnf-type t1 --debug
271
272 B: create VNF with template:
273 -----------------------------
274
275 ::
276
277   onap>vnf-create-with-template -u AAI -p AAI -m https://172.19.44.123:8443 --vnf-id d9b1b05f-44c8-45ef-89aa-d27ad060ceb9 --template /opt/oclip/open-cli-schema/vnf-template.json
278
279         Sample content of /opt/oclip/open-cli-schema/vnf-template.json
280         {
281             "vnf-id": "d9b1b05f-44c8-45ef-89aa-d27ad060ceb9",
282             "vnf-name": "vvnf-name",
283             "vnf-type": "vnf-type-1",
284             "in-maint": true,
285             "is-closed-loop-disabled": false
286         }
287
288 Create relationship between service instance and PNF/VNF:
289 =========================================================
290
291 ::
292
293   onap>service-instance-relationship-create -u AAI -p AAI -m https://172.19.44.123:8443 -g Orange -z EC -i 176d9eba-1662-4289-8396-0097b50fd485 -r /opt/oclip/open-cli-schema/relation.json
294
295     Sample content of  /opt/oclip/open-cli-schema/relation.json:
296
297             {
298                         "related-to": "pnf",
299                         "related-link": "/aai/v11/network/pnfs/pnf/pnf_template",
300                         "relationship-data": [
301                             {
302                                 "relationship-key": "pnf.pnf-name",
303                                 "relationship-value": "pnf_template"
304                             }
305                         ]
306             }
307
308 List Service-instance relationship:
309 ------------------------------------
310
311 ::
312
313   onap>service-instance-relationship-list -u AAI -p AAI -m https://172.19.44.123:8443 -g Orange -z EPC -i 176d9eba-1662-4289-8396-0097b50fd485
314
315     Output:
316
317         +--------------+----------------------------------------------------+
318         |related-to    |related-link                                        |
319         +--------------+----------------------------------------------------+
320         |pnf           |/aai/v11/network/pnfs/pnf/pnf_template              |
321         +--------------+----------------------------------------------------+
322         |pnf           |/aai/v11/network/pnfs/pnf/testcmdpnfname            |
323         +--------------+----------------------------------------------------+
324         |logical-link  |/aai/v11/network/logical-links/logical-link/S11-00  |
325         |              |001                                                 |
326         +--------------+----------------------------------------------------+
327         |pnf           |/aai/v11/network/pnfs/pnf/MME-0001                  |
328         +--------------+----------------------------------------------------+
329         |pnf           |/aai/v11/network/pnfs/pnf/SP%20GW-0001              |
330         +--------------+----------------------------------------------------+
331
332 Delete Service-instance relationship:
333 --------------------------------------
334
335 ::
336
337   onap>service-instance-relationship-delete -u AAI -p AAI -m https://172.19.44.123:8443 -g Orange -z EPC -i 176d9eba-1662-4289-8396-0097b50fd485 -r /opt/oclip/open-cli-schema/relation.json
338
339     Sample content of     /opt/oclip/open-cli-schema/relation.json is same as the one used to create relation.
340
341 batch import PNF/VNF:
342 =====================
343     Since all the cmd support batch model, user can import multi-PNF/VNF one time:
344     This CMD should be run on system terminal:
345
346 cmd:
347 -------
348
349 ::
350
351   onap>oclip -p create-batch.yaml pnf-create
352
353         Sample content of create-batch.yaml:
354
355         pnf1:
356           - name: batch-name-1
357           - host-username: AAI
358           - host-password: AAI
359           - host-url: https://172.19.44.123:8443
360
361         pnf2:
362           - name: batch-name-2
363           - host-username: AAI
364           - host-password: AAI
365           - host-url: https://172.19.44.123:8443
366           - template: |
367                         {
368                             "relationship": [
369                                 {
370                                     "related-to": "logical-link",
371                                     "related-link": "/aai/v11/network/logical-links/logical-link/S11-00001",
372                                     "relationship-data": [
373                                         {
374                                             "relationship-key": "logical-link.link-name",
375                                             "relationship-value": "S11-00001"
376                                         }
377                                     ]
378                                 }
379                             ]
380                          }
381
382 User can also use create with template cmd for batch execute:
383
384 sample cmd:
385 ----------------
386
387 ::
388
389   oclip -p create-batch.yaml pnf-create-with-template
390
391 Checke AAI topology through portal:
392 ====================================
393
394 Typing the key word, (service,PNF,generic-vnf,customer),the search text box will pup up auto suggestion of the search key word.
395 e.g.
396 ::
397
398     service-instance called 176d9eba-1662-4289-8396-0097b50fd485
399     customer called test
400     pnf called MME-0001
401     generic-vnf called d9b1b05f-44c8-45ef-89aa-d27ad060ceb4
402
403
404
405
406
407