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