Issue-ID: DOC-500
[doc.git] / docs / guides / onap-user / instantiate / instantiation / pnf_instance / index.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0
2 .. International License. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2019 ONAP Contributors. All rights reserved.
4
5
6
7 Declare PNF instances in ONAP
8 =============================
9
10 PNF instances can be declared in ONAP inventory (AAI) using REST API
11
12
13 An example:
14
15 ::
16
17   curl -X PUT \
18     https://{{ONAP_LB_IP@}}:30233/aai/v16/network/pnfs/pnf/my_pnf_instance_001 \
19     -H 'Accept: application/json' \
20     -H 'Authorization: Basic QUFJOkFBSQ==' \
21     -H 'Cache-Control: no-cache' \
22     -H 'Content-Type: application/json' \
23     -H 'Postman-Token: f5e2aae0-dc1c-4edb-b9e9-a93b05aee5e8' \
24     -H 'X-FromAppId: AAI' \
25     -H 'X-TransactionId: 999' \
26     -H 'depth: all' \
27     -d '{
28     "pnf-name":" my_pnf_instance_001",
29     "equip-type":" router",
30     "nf-role":"primary",
31     "p-interfaces": {
32         "p-interface": [
33             {
34                 "interface-name": "ae1",
35                 "port-description": "Link aggregate for trunk between switches"
36             },
37             {
38                 "interface-name": "xe-0/0/6",
39                 "port-description": "to PNF_instance_002 trunk1"
40             },
41             {
42                 "interface-name": "xe-0/0/2",
43                 "port-description": "to PNF_instance_003 trunk1"
44             },
45             {
46                 "interface-name": "xe-0/0/10",
47                 "port-description": "to PNF_instance_004 trunk1"
48             },
49             {
50                 "interface-name": "xe-0/0/0",
51                 "port-description": "firewall trunk"
52             },
53             {
54                 "interface-name": "xe-0/0/14",
55                 "port-description": "to PNF_instance_005 trunk1"
56             }
57         ]
58     }
59   }' -k
60
61
62 It is possible to declare the location where is deployed the PNF
63 (called a "complex" in ONAP AAI)
64
65 ::
66
67   curl -X PUT \
68     https:// {{ONAP_LB_IP@}}:30233/aai/v11/cloud-infrastructure/complexes/complex/my_complex_name \
69     -H 'Accept: application/json' \
70     -H 'Authorization: Basic QUFJOkFBSQ==' \
71     -H 'Cache-Control: no-cache' \
72     -H 'Content-Type: application/json' \
73     -H 'Postman-Token: 43523984-db01-449a-8a58-8888871110bc' \
74     -H 'X-FromAppId: AAI' \
75     -H 'X-TransactionId: 999' \
76     -H 'depth: all' \
77     -d '{
78     "physical-location-type":"PoP",
79     "physical-location-id":"my_complex_name",
80     "complex-name":"Name of my Complex",
81     "city":"LANNION",
82     "postal-code":"22300",
83     "country":"FRANCE",
84     "street1":"Avenue Pierre Marzin",
85     "region":"Europe"
86   }' -k
87
88
89
90 To indicate that a PNF instance is located in a complex, we create a relation
91
92 ::
93
94   curl -X PUT \
95     https:// {{ONAP_LB_IP@}}:30233/aai/v14/network/pnfs/pnf/my_pnf_instance_001/relationship-list/relationship \
96     -H 'Accept: application/json' \
97     -H 'Authorization: Basic QUFJOkFBSQ==' \
98     -H 'Cache-Control: no-cache' \
99     -H 'Content-Type: application/json' \
100     -H 'Postman-Token: 15315304-17c5-4e64-aada-bb149f1af915' \
101     -H 'X-FromAppId: AAI' \
102     -H 'X-TransactionId: 999' \
103     -H 'depth: all' \
104     -d '{
105       "related-to": "complex",
106       "related-link": "/aai/v11/cloud-infrastructure/complexes/complex/my_complex_name"
107   }' -k