Add port of SR-IOV NIC support
[vfc/gvnfm/vnflcm.git] / lcm / lcm / nf / const.py
1 # Copyright 2017 ZTE Corporation.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #         http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 import json
15
16 from lcm.pub.utils.jobutil import enum
17
18 HEAL_ACTION_TYPE = enum(START="vmCreate", RESTART="vmReset")
19 ACTION_TYPE = enum(START=1, STOP=2, REBOOT=3)
20 GRANT_TYPE = enum(INSTANTIATE="Instantiate", TERMINATE="Terminate", HEAL_CREATE="Heal Create", HEAL_RESTART="Heal Restart", OPERATE="Operate")
21 VNF_STATUS = enum(NULL='null', INSTANTIATING="instantiating", INACTIVE='inactive', ACTIVE="active",
22                   FAILED="failed", TERMINATING="terminating", SCALING="scaling", OPERATING="operating",
23                   UPDATING="updating", HEALING="healing")
24
25 RESOURCE_MAP = {'Storage': 'volumn', 'Network': 'network', 'SubNetwork': 'subnet', 'Port': 'port',
26                 'Flavour': 'flavor', 'Vm': 'vm'}
27
28 ROOT_URI = "api/vnflcm/v1/subscriptions/"
29
30 AUTH_TYPES = ["BASIC", "OAUTH2_CLIENT_CREDENTIALS", "TLS_CERT"]
31
32 BASIC = "BASIC"
33
34 OAUTH2_CLIENT_CREDENTIALS = "OAUTH2_CLIENT_CREDENTIALS"
35
36 LCCNNOTIFICATION = "VnfLcmOperationOccurrenceNotification"
37
38 inst_req_data = {
39     "flavourId": "flavour_1",
40     "instantiationLevelId": "instantiationLevel_1",
41     "extVirtualLinks": [
42         {
43             "id": "extVirtualLink_1",
44             "vimConnectionId": "vimConnection_1",
45             "resourceProviderId": "resourceProvider_1",
46             "resourceId": "resource_1",
47             "resourceSubnetId": "resourceSubnet_1",
48             "extCps": [
49                 {
50                     "cpdId": "cpd_1",
51                     "cpConfig": [
52                         {
53                             "cpInstanceId": "cpInstance_1",
54                             "linkPortId": "linkPort_1",
55                             "cpProtocolData": [
56                                 {
57                                     "layerProtocol": "IP_OVER_ETHERNET",
58                                     "ipOverEthernet": {
59                                         "macAddress": "00:f3:43:20:a2:a3",
60                                         "ipAddresses": [
61                                             {
62                                                 "type": "IPV4",
63                                                 "fixedAddresses": ["192.168.104.2", ],
64                                                 "numDynamicAddresses": 0,
65                                                 "addressRange": None,
66                                                 "subnetId": "subnet_1",
67                                             }
68                                         ]
69                                     }
70                                 }
71                             ]
72                         }
73                     ]
74                 }
75             ],
76             "extLinkPorts": [
77                 {
78                     "id": "extLinkPort_1",
79                     "resourceHandle": {
80                         "vimConnectionId": "vimConnection_1",
81                         "resourceProviderId": "resourceProvider_1",
82                         "resourceId": "resource_1",
83                         "vimLevelResourceType": "vimLevelResourceType_1",
84                     }
85                 }
86             ]
87         }
88     ],
89     "extManagedVirtualLinks": [
90         {
91             "id": 'extManagedVirtualLink_1',
92             "virtualLinkDescId": 'virtualLinkDesc_1',
93             "vimConnectionId": 'vimConnection_1',
94             "resourceProviderId": 'resourceProvider_1',
95             "resourceId": 'resource_1',
96         }
97     ],
98     "vimConnectionInfo": [
99         {
100             "id": 'vimConnection_1',
101             "vimId": 'vim_1',
102             "vimType": 'vim',
103             "interfaceInfo": {
104                 "apiVersion": "apiVersion_1",
105                 "protocolType": "http"
106             },
107             "accessInfo": {
108                 "tenant": "tenant_vCPE",
109                 "username": "vCPE",
110                 "password": "vCPE_321",
111             },
112             "extra": None,
113         }
114     ],
115     "localizationLanguage": "en_US",
116     "additionalParams": {
117         "vimId": "vim_1",
118         "key1": "test1",
119         "key2": "test2",
120     }
121 }
122
123
124 vnfd_model_dict = {
125     'metadata': {
126         'vendor': u'zte',
127         'is_shared': False,
128         'description': '',
129         'domain_type': u'CN',
130         'version': u'v4.14.10',
131         'vmnumber_overquota_alarm': False,
132         'cross_dc': False,
133         'vnf_type': u'SSS',
134         'vnfd_version': u'V00000001',
135         'id': u'sss-vnf-template',
136         'name': u'sss-vnf-template'
137     },
138     'vdus': [
139         {
140             "vdu_id": "vdu1Id",
141             "description": "vdu description",
142             "properties": {
143                 "name": "vduinstname",
144                 "vdu_type": "OMP",
145                 "key_vdu": True,
146                 "support_scaling": True,
147                 "location_info": {
148                     "vimid": "vimid",
149                     "tenant": "tenantname",
150                     "availability_zone": "zone1",
151                     "host": "host1"
152                 },
153                 "local_affinity_antiaffinity_rule": [
154                     {
155                         "affinity_antiaffinity": "anti-affinity",
156                         "scope": "node"
157                     },
158                     {
159                         "affinity_antiaffinity": "affinity",
160                         "scope": "zone"
161                     }
162                 ],
163                 "inject_data_list": [
164                     {
165                         "file_name": "abc.xml",
166                         "file_data": "<a>xxx</a><b>ssss</b>"
167                     }
168                 ],
169                 "storage_policy": "HIGH",
170                 "template_id": "26",
171                 "manual_scale_select_vim": False,
172                 "watchdog": {
173                     "enabledelay": 600000,
174                     "action": "reset"
175                 },
176                 "is_predefined": False,
177                 "allow_scale_updown": False,
178                 "inject_network_address": True,
179                 "inner_hugepage_num": 100,
180                 "inner_hugepage_size": "2048",
181                 "action": "add"
182             },
183             "image_file": u'sss',
184             "local_storages": [
185                 "local_storage_id1",
186                 "local_storage_id2"
187             ],
188             "volume_storages": [
189                 {
190                     "volume_storage_id": "volume_storage1",
191                     "location": "/usr/data",
192                     "device": "/dev/hda1"
193                 }
194             ],
195             "dependencies": [
196                 "vdu1Id",
197                 "vduNId"
198             ],
199             "nfv_compute": {
200                 "num_cpus": 4,
201                 "mem_size": "1 GB",
202                 "cpu_frequency": "1GHz",
203                 "flavor_extra_specs": {
204                     "hw: cpu_policy": "shared",
205                     "hw: cpu_max_threads": 50,
206                     "hw: cpu_sockets": 10,
207                     "hw: cpu_max_sockets": 20,
208                     "hw: cpu_max_cores": 8,
209                     "hw: cpu_threads": 30,
210                     "hw: numa_mem.0": 12288,
211                     "hw: hugepage_num": 100,
212                     "hw: high_performance": "dvs_high",
213                     "hw: numa_nodes": 1,
214                     "hw: numa_cpus.0": "2,4,8",
215                     "hw: numa_pci": True,
216                     "hw: cpu_cores": 4,
217                     "pci_passthrough: alias": "ColetoCreek: 1",
218                     "hw: mem_page_size": "large",
219                     "hw: mem_paging_mechanism": "EPT"
220                 }
221             },
222             "vls": [
223                 "vlId1",
224             ],
225             "cps": [
226                 "cpId1",
227             ],
228             "scalable": {
229                 "min_instances": 1,
230                 "max_instances": 2,
231                 "default_instances": 1
232             },
233             "interfaces": {
234                 "Standard": {
235                     "create": {
236                         "implementation": "<implementationScript>",
237                         "inputs": {
238                             "param1Name": "value1",
239                             "paramNName": "valueN"
240                         }
241                     },
242                     "configure": {
243                         "implementation": "<implementationScript>",
244                         "inputs": {
245                             "param1Name": "value1",
246                             "paramNName": "valueN"
247                         }
248                     },
249                     "start": {
250                         "implementation": "<implementationScript>",
251                         "inputs": {
252                             "param1Name": "value1",
253                             "paramNName": "valueN"
254                         }
255                     },
256                     "stop": {
257                         "implementation": "<implementationScript>",
258                         "inputs": {
259                             "param1Name": "value1",
260                             "paramNName": "valueN"
261                         }
262                     },
263                     "delete": {
264                         "implementation": "<implementationScript>",
265                         "inputs": {
266                             "param1Name": "value1",
267                             "paramNName": "valueN"
268                         }
269                     }
270                 }
271             },
272             "artifacts": [
273                 {
274                     "artifact_name": "software_version_file",
275                     "type": "tosca.artifacts.Deployment",
276                     "file": "AppSoftwares/zte-cn-xgw-V5.16.11_NFV-version.zip",
277                     "repository": "",
278                     "deploy_path": ""
279                 }
280             ]
281         }
282     ],
283     'volume_storages': [
284         {
285             "volume_storage_id": "volume_storage1",
286             "description": "",
287             "properties": {
288                 "size": "100 GB",
289                 "volume_id": "",
290                 "volume_name": "volumeStorage1",
291                 "custom_volume_type": "type1",
292                 "disk_type": "data",
293                 "delete_on_termination_vm": True,
294                 "location_info": {
295                     "vimid": "vimid_1",
296                     "tenant": "tenantname_1",
297                     "availability_zone": "zone1"
298                 },
299                 "is_predefined": False,
300                 "is_shared": False
301             },
302             "image_file": [
303                 "volume_image"
304             ]
305         }
306     ],
307     'policies': {
308         'scaling': {
309             'targets': {
310
311             },
312             'policy_id': u'policy_scale_sss-vnf-template',
313             'properties': {
314                 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
315             },
316             'description': ''
317         }
318     },
319     'image_files': [
320         {
321             'description': '',
322             'properties': {
323                 'name': u'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
324                 'checksum': '',
325                 'disk_format': u'VMDK',
326                 'file_url': u'./zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
327                 'container_type': 'vm',
328                 'version': '',
329                 'hypervisor_type': 'kvm'
330             },
331             'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'
332         },
333         {
334             'description': '',
335             'properties': {
336                 'name': u'sss.vmdk',
337                 'checksum': '',
338                 'disk_format': u'VMDK',
339                 'file_url': u'./zte-cn-sss-main-image/NE/sss.vmdk',
340                 'container_type': 'vm',
341                 'version': '',
342                 'hypervisor_type': 'kvm'
343             },
344             'image_file_id': u'sss'
345         }
346     ],
347     'vls': [
348         {
349             "vl_id": "vldId1",
350             "description": "",
351             "properties": {
352                 "name": "umac_241_control",
353                 "network_name": "umac_control",
354                 "is_predefined": False,
355                 "vendor": "zte",
356                 "netmask": "255.255.255.0",
357                 "mtu": 1500,
358                 "network_type": "vlan",
359                 "physical_network": "phynet01",
360                 "segmentation_id": "30",
361                 "vlan_transparent": False,
362                 "vds_name": "vds1",
363                 "cidr": "192.168.199.0/24",
364                 "ip_version": 4,
365                 "gateway_ip": "192.168.199.1",
366                 "dhcp_enabled": False,
367                 "dns_nameservers": [
368                     "192.168.0.4",
369                     "192.168.0.10"
370                 ],
371                 "start_ip": "192.168.199.2",
372                 "end_ip": "192.168.199.254",
373                 "host_routes": [
374                     {
375                         "destination": "10.43.26.0/24",
376                         "nexthop": "10.41.23.1"
377                     }
378                 ],
379                 "location_info": {
380                     "vimid": "vimid_1",
381                     "tenant": "tenantname_1"
382                 },
383                 "cloud_type": "IaaS"
384             },
385             "route_id": "router01",
386             "route_external": False
387         }
388     ],
389     'cps': [
390         {
391             "cp_id": "cpId1",
392             "description": "",
393             "properties": {
394                 "name": "",
395                 "mac_address": "00:d9:00:82:11:e1",
396                 "ip_address:": "192.168.1.21",
397                 "ip_range_start": "192.168.1.20",
398                 "ip_range_end": "192.168.1.29",
399                 "floating_ip_address": {
400                     "external_network": "extnet01",
401                     "ip_address": "10.43.53.23"
402                 },
403                 "service_ip_address": "192.168.1.23",
404                 "order": 1,
405                 "bandwidth": 1000,
406                 "vnic_type": "normal",
407                 "allowed_address_pairs": [
408                     {
409                         "ip": "192.168.1.13",
410                         "mac": "00:f3:43:20:a2:a3"
411                     }
412                 ],
413                 "bond": "none",
414                 "bond_index": 1,
415                 "macbond": "00:d9:00:82:11:d1",
416                 "sfc_encapsulation": "",
417                 "direction": "",
418                 "gateway_ip": "192.168.199.1",
419                 "netmask": "255.255.255.0",
420                 "interface_name": "fe-01-02",
421                 "is_virtual": False,
422                 "function": "control"
423             },
424             "vl_id": "vldId1",
425             "vdu_id": "vdu1Id"
426         }
427     ],
428     'local_storages': [
429
430     ],
431 }
432
433 # get_tenant_id
434 c1_data_get_tenant_id = {
435     "tenants": [
436         {
437             "id": "1",
438             "name": "chinamobile"
439         }
440     ]
441 }
442
443 # create_volume
444 c2_data_create_volume = {
445     "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
446     "name": "volume1",
447     "returnCode": 1,
448     "vimId": "vim_volume_1",
449     "vimName": "vim_volume_1",
450     "tenantId": "vim_volume_1",
451     "volumeType": "123",
452     "availabilityZone": "availabilityZone",
453     "status": "availuable",
454     "createTime": "2015-12-02T06:39:40.000000",
455     "type": None,
456     "size": 40
457 }
458
459 # get_volume
460 c3_data_get_volume = {
461     "status": "available",
462     "name": "wangsong",
463     "attachments": [
464         {
465             "device": "/dev/vdc",
466             "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
467             "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
468             "hostName": None,
469             "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
470         }
471     ],
472     "createTime": "2015-12-02T06:39:40.000000",
473     "type": None,
474     "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
475     "size": 40
476 }
477
478 # create_network
479 c4_data_create_network = {
480     "returnCode": 0,
481     "vimId": "11111",
482     "vimName": "11111",
483     "status": "ACTIVE",
484     "id": "3c9eebdbbfd345658269340b9ea6fb73",
485     "name": "net1",
486     "tenantId": "tenant1",
487     "networkName": "ommnet",
488     "shared": True,
489     "vlanTransparent": True,
490     "networkType": "vlan",
491     "segmentationId": 202,
492     "physicalNetwork": "physnet1",
493     "routerExternal": False
494 }
495
496 # create_subnet
497 c5_data_create_subnet = {
498     "returnCode": 0,
499     "vimId": "11111",
500     "vimName": "11111",
501     "status": " ACTIVE",
502     "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
503     "tenantId": "tenant1",
504     "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
505     "networkName": "networkName",
506     "name": "subnet1",
507     "cidr": "10.43.35.0/24",
508     "ipVersion": 4,
509     "enableDhcp": 1,
510     "gatewayIp": "10.43.35.1",
511     "dnsNameservers": [],
512     "allocationPools": [
513         {
514             "start": "192.168.199.2",
515             "end": "192.168.199.254"
516         }
517     ],
518     "hostRoutes": []
519 }
520
521 # create_ports
522 c6_data_create_port = {
523     "returnCode": 0,
524     "vimId": "11111",
525     "vimName": "11111",
526     "status": " ACTIVE",
527     "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
528     "tenantId": "tenant1",
529     "name": "subnet1",
530     "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
531     "networkName": "networkName",
532     "subnetId": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
533     "subnetName": "subnet1",
534     "macAddress": "212.12.61.23",
535     "ip": "10.43.38.11",
536     "vnicType": "direct",
537     "securityGroups": ""
538 }
539
540 # create_flavor
541 c7_data_create_flavor = {
542     "returnCode": 0,
543     "vimId": "11111",
544     "vimName": "11111",
545     "id": "142019d3-bc6e-4319-9c1d-6722fc136afg",
546     "tenantId": "tenant1",
547     "name": "subnet1",
548     "vcpu": 5,
549     "memory": 2,
550     "disk": 40,
551     "ephemeral": 40,
552     "swap": 20,
553     "isPublic": True,
554     "extraSpecs": "testtt"
555 }
556
557 # list_image
558 c8_data_list_image = {
559     "vimid": "",
560     "vimname": "",
561     "images": [
562         {
563             "status": "active",
564             "id": "5e2757c1-f846-4727-915c-9a872553ed75",
565             "size": 862016,
566             "name": u'sss.vmdk'
567         }
568     ]
569 }
570
571 # create_vm
572 c9_data_create_vm = {
573     "returnCode": 1,
574     "id": "3c9eebdbbfd345658269340b9ea6fb73",
575     "name": "vm1",
576     "vimId": "11111",
577     "vimName": "11111",
578     "tenantId": "tenant1",
579     "boot": "boot_1",
580     "nicArray": "dfdf",
581     "volumeArray": "dfdf",
582     "availabilityZone": "fdvfdv",
583     "flavorId": "fdvfdv",
584     "metadata": "fdvfdv",
585     "securityGroups": "fdvfdv",
586     "serverGroup": "fdvfdv",
587     "status": "ACTIVE"
588 }
589
590 # get_vm
591 c10_data_get_vm = {
592     "returnCode": 1,
593     "id": "3c9eebdbbfd345658269340b9ea6fb73",
594     "name": "vm1",
595     "vimId": "11111",
596     "vimName": "11111",
597     "tenantId": "tenant1",
598     "status": "ACTIVE"
599 }
600
601 vnfdModel = {
602     "volume_storages": [
603         {
604             "volume_storage_id": "test",
605             "properties": {
606                 "location_info": {
607                     "vimid": "vim_1",
608                     "tenant": "chinamobile",
609                     "availability_zone": "test",
610                 },
611                 "volume_name": "test",
612                 "custom_volume_type": "test",
613                 "size": "10 GB",
614             },
615             "image_file": "test",
616         },
617     ],
618     "vls": [
619         {
620             "vl_id": "test",
621             "properties": {
622                 "location_info": {
623                     "vimid": "test",
624                     "tenant": "chinamobile",
625                 },
626                 "vl_profile": {
627                     "networkName": "test",
628                     "networkType": "test",
629                     "physicalNetwork": "test",
630                     "vlanTransparent": "test",
631                     "segmentationId": "1",
632                     "cidr": "test",
633                     "dhcpEnabled": "test",
634                     "gatewayIp": "test",
635                     "startIp": "test",
636                     "endIp": "test",
637                 },
638                 "connectivity_type": {
639                     "layer_protocol": "ipv4",
640                 },
641                 "dns_nameservers": "test",
642                 "host_routes": "test",
643             },
644             "route_external": "test",
645         }
646     ],
647     "cps": [
648         {
649             "vdu_id": "test",
650             "cp_id": "cp1",
651             "networkId": "",  # TODO
652             "subnetId": "",  # TODO
653             "vl_id": "test",
654             "properties": {
655                 "name": "test",
656                 "mac_address": "test",
657                 "protocol_data": [
658                     {
659                         "address_data": {
660                             "l3_address_data": {
661                                 "fixed_ip_address": "test"
662                             },
663                         },
664                     },
665                 ],
666                 "vnic_type": "direct",
667                 "role": "root",
668                 "virtual_network_interface_requirements": [
669                     {
670                         "network_interface_requirements": {
671                             "interfaceType": '{"schema-version": "0", "schema-location":"", "platform-id": "generic", "mandatory": false, "configuration-value": "SR-IOV"}'
672                         },
673                         "support_mandatory": False,
674                         "name": "SRIOV_Port",
675                         "description": "sriov"
676                     }
677                 ]
678             }
679         }
680     ],
681     "vdus": [
682         {
683             "vdu_id": "test",
684             "properties": {
685                 "location_info": {
686                     "vimid": "test",
687                     "tenant": "chinamobile",
688                     "availability_zone": "test",
689                 },
690                 "name": "test",
691                 "inject_files": [],
692                 "user_data": "test",
693                 "meta_data": {},
694             },
695             "cps": [],
696             "type": "tosca.nodes.nfv.Vdu.Compute",
697             "virtual_compute": {
698                 "virtual_cpu": {
699                     "num_virtual_cpu": "16",
700                 },
701                 "virtual_memory": {
702                     "virtual_mem_size": "8000 MB",
703                     "vdu_memory_requirements": {
704                         "memoryPageSize": "8 MB",
705                     },
706                 },
707             },
708             "virtual_storage": {
709                 "type_of_storage": "ephemeral",
710                 "size_of_storage": "10 GB",
711             },
712             "type": "tosca.nodes.nfv.Vdu.Compute",
713             "artifacts": [
714                 {
715                     "artifact_name": "sw_image",
716                     "file": "sss.vmdk",
717                 },
718             ],
719             "volume_storages": [
720                 {
721                     "volume_storage_id": "test",
722                 }
723             ],
724         },
725     ],
726     "image_files": [],
727     "routers": [],
728     "local_storages": [],
729     "vnf_exposed": {
730         "external_cps": [],
731         "forward_cps": []
732     },
733     "inputs": {
734         "pe1_id": {
735             "type": "string",
736             "description": "pe1_idofunderlayvpn"
737         },
738         "pe2_id": {
739             "type": "string",
740             "description": "pe2_idofunderlayvpn"
741         },
742         "serviceType": {
743             "type": "string",
744             "description": "serviceTypeofunderlayvpn"
745         },
746         "description": {
747             "type": "string",
748             "description": "descriptionofunderlayvpn"
749         },
750         "ac2_route": {
751             "type": "string",
752             "description": "ac2_routeofunderlayvpn"
753         },
754         "ac1_route": {
755             "type": "string",
756             "description": "ac1_routeofunderlayvpn"
757         },
758         "ac1_svlan": {
759             "type": "integer",
760             "description": "ac1_svlanofunderlayvpn"
761         },
762         "ac2_ip": {
763             "type": "string",
764             "description": "ac2_ipofunderlayvpn"
765         },
766         "ac1_ip": {
767             "type": "string",
768             "description": "ac1_ipofunderlayvpn"
769         },
770         "ac2_port": {
771             "type": "string",
772             "description": "ac2_portofunderlayvpn"
773         },
774         "topology": {
775             "type": "string",
776             "description": "topologyofunderlayvpn"
777         },
778         "technology": {
779             "type": "string",
780             "description": "technologyofunderlayvpn"
781         },
782         "ac1_port": {
783             "type": "string",
784             "description": "ac1_portofunderlayvpn"
785         },
786         "ac2_svlan": {
787             "type": "integer",
788             "description": "ac2_svlanofunderlayvpn"
789         },
790         "name": {
791             "type": "string",
792             "description": "Nameofunderlayervpn"
793         }
794     },
795     "metadata": {
796         "designer": "sdno",
797         "name": "underlayervpn",
798         "csarVersion": "1.0",
799         "csarType": "SSAR",
800         "csarProvider": "huawei",
801         "version": "1.0",
802         "type": "SSAR",
803         "id": "ns_underlayervpn_1_0"
804     }
805 }
806
807 vnfpackage_info = {
808     "imageInfo": [],
809     "csarId": "vOpenNAT",
810     "packageInfo": {
811         "csarName": "vOpenNAT.csar",
812         "vnfdModel": json.dumps(vnfdModel),
813         "vnfdProvider": "Intel",
814         "vnfdId": "openNAT_1.0",
815         "downloadUrl": "http://10.96.33.39:8806/static/catalog/vOpenNAT/vOpenNAT.csar",
816         "vnfVersion": "v1.0",
817         "vnfdVersion": "v1.0",
818         "vnfPackageId": "vOpenNAT"
819     }
820 }
821
822 # # vnfd_rawdata
823 # vnfd_rawdata = {
824 #     "rawData": {
825 #         "instance": {
826 #             "metadata": {
827 #                 "designer": "sdno",
828 #                 "name": "underlayervpn",
829 #                 "csarVersion": "1.0",
830 #                 "csarType": "SSAR",
831 #                 "csarProvider": "huawei",
832 #                 "version": "1.0",
833 #                 "type": "SSAR",
834 #                 "id": "ns_underlayervpn_1_0"
835 #             },
836 #             "nodes": [
837 #                 {
838 #                     "id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
839 #                     "type_name": "tosca.nodes.sdn.l3ac",
840 #                     "template_name": "ac2",
841 #                     "properties": {
842 #                         "ip": {
843 #                             "type_name": "string"
844 #                         },
845 #                         "route": {
846 #                             "type_name": "string"
847 #                         },
848 #                         "port": {
849 #                             "type_name": "string"
850 #                         },
851 #                         "svlan": {
852 #                             "type_name": "string"
853 #                         }
854 #                     },
855 #                     "interfaces": [
856 #                         {
857 #                             "name": "Standard",
858 #                             "type_name": "tosca.interfaces.node.lifecycle.Standard"
859 #                         }
860 #                     ],
861 #                     "capabilities": [
862 #                         {
863 #                             "name": "feature",
864 #                             "type_name": "tosca.capabilities.Node"
865 #                         },
866 #                         {
867 #                             "name": "ac",
868 #                             "type_name": "tosca.capabilities.sdn.ac"
869 #                         }
870 #                     ],
871 #                     "relationships": [
872 #                         {
873 #                             "target_node_id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
874 #                             "target_capability_name": "feature"
875 #                         },
876 #                         {
877 #                             "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
878 #                             "target_capability_name": "feature"
879 #                         }
880 #                     ]
881 #                 },
882 #                 {
883 #                     "id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
884 #                     "type_name": "tosca.nodes.sdn.l3ac",
885 #                     "template_name": "ac1",
886 #                     "properties": {
887 #                         "ip": {
888 #                             "type_name": "string"
889 #                         },
890 #                         "route": {
891 #                             "type_name": "string"
892 #                         },
893 #                         "port": {
894 #                             "type_name": "string"
895 #                         },
896 #                         "svlan": {
897 #                             "type_name": "string"
898 #                         }
899 #                     },
900 #                     "interfaces": [
901 #                         {
902 #                             "name": "Standard",
903 #                             "type_name": "tosca.interfaces.node.lifecycle.Standard"
904 #                         }
905 #                     ],
906 #                     "capabilities": [
907 #                         {
908 #                             "name": "feature",
909 #                             "type_name": "tosca.capabilities.Node"
910 #                         },
911 #                         {
912 #                             "name": "ac",
913 #                             "type_name": "tosca.capabilities.sdn.ac"
914 #                         }
915 #                     ],
916 #                     "relationships": [
917 #                         {
918 #                             "target_node_id": "pe1_e58ekps6m45g6w9egs9lue2j7",
919 #                             "target_capability_name": "feature"
920 #                         },
921 #                         {
922 #                             "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
923 #                             "target_capability_name": "feature"
924 #                         }
925 #                     ]
926 #                 },
927 #                 {
928 #                     "id": "vpn_ie0xim076f7cje67fvrrq9tg1",
929 #                     "type_name": "tosca.nodes.sdn.underlayVPN",
930 #                     "template_name": "vpn",
931 #                     "properties": {
932 #                         "serviceType": {
933 #                             "type_name": "string"
934 #                         },
935 #                         "description": {
936 #                             "type_name": "string"
937 #                         },
938 #                         "name": {
939 #                             "type_name": "string"
940 #                         },
941 #                         "topology": {
942 #                             "type_name": "string"
943 #                         }
944 #                     },
945 #                     "interfaces": [
946 #                         {
947 #                             "name": "Standard",
948 #                             "type_name": "tosca.interfaces.node.lifecycle.Standard"
949 #                         }
950 #                     ],
951 #                     "capabilities": [
952 #                         {
953 #                             "name": "feature",
954 #                             "type_name": "tosca.capabilities.Node"
955 #                         }
956 #                     ],
957 #                     "relationships": [
958 #                         {
959 #                             "target_node_id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
960 #                             "target_capability_name": "feature"
961 #                         },
962 #                         {
963 #                             "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
964 #                             "target_capability_name": "feature"
965 #                         }
966 #                     ]
967 #                 },
968 #                 {
969 #                     "id": "pe1_e58ekps6m45g6w9egs9lue2j7",
970 #                     "type_name": "tosca.nodes.sdn.l3pe",
971 #                     "template_name": "pe1",
972 #                     "properties": {
973 #                         "id": {
974 #                             "type_name": "string"
975 #                         }
976 #                     },
977 #                     "interfaces": [
978 #                         {
979 #                             "name": "Standard",
980 #                             "type_name": "tosca.interfaces.node.lifecycle.Standard"
981 #                         }
982 #                     ],
983 #                     "capabilities": [
984 #                         {
985 #                             "name": "feature",
986 #                             "type_name": "tosca.capabilities.Node"
987 #                         },
988 #                         {
989 #                             "name": "pe",
990 #                             "type_name": "tosca.capabilities.sdn.pe"
991 #                         }
992 #                     ]
993 #                 },
994 #                 {
995 #                     "id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
996 #                     "type_name": "tosca.nodes.sdn.l3pe",
997 #                     "template_name": "pe2",
998 #                     "properties": {
999 #                         "id": {
1000 #                             "type_name": "string"
1001 #                         }
1002 #                     },
1003 #                     "interfaces": [
1004 #                         {
1005 #                             "name": "Standard",
1006 #                             "type_name": "tosca.interfaces.node.lifecycle.Standard"
1007 #                         }
1008 #                     ],
1009 #                     "capabilities": [
1010 #                         {
1011 #                             "name": "feature",
1012 #                             "type_name": "tosca.capabilities.Node"
1013 #                         },
1014 #                         {
1015 #                             "name": "pe",
1016 #                             "type_name": "tosca.capabilities.sdn.pe"
1017 #                         }
1018 #                     ]
1019 #                 }
1020 #             ],
1021 #             "substitution": {
1022 #                 "node_type_name": "tosca.nodes.sdn.ext.NS.ns_underlayervpn"
1023 #             },
1024 #             "inputs": {
1025 #                 "ac2_ip": {
1026 #                     "type_name": "string",
1027 #                     "description": "ac2_ipofunderlayvpn"
1028 #                 },
1029 #                 "ac2_route": {
1030 #                     "type_name": "string",
1031 #                     "description": "ac2_routeofunderlayvpn"
1032 #                 },
1033 #                 "serviceType": {
1034 #                     "type_name": "string",
1035 #                     "description": "serviceTypeofunderlayvpn"
1036 #                 },
1037 #                 "description": {
1038 #                     "type_name": "string",
1039 #                     "description": "descriptionofunderlayvpn"
1040 #                 },
1041 #                 "pe2_id": {
1042 #                     "type_name": "string",
1043 #                     "description": "pe2_idofunderlayvpn"
1044 #                 },
1045 #                 "ac1_route": {
1046 #                     "type_name": "string",
1047 #                     "description": "ac1_routeofunderlayvpn"
1048 #                 },
1049 #                 "ac1_svlan": {
1050 #                     "type_name": "integer",
1051 #                     "description": "ac1_svlanofunderlayvpn"
1052 #                 },
1053 #                 "name": {
1054 #                     "type_name": "string",
1055 #                     "description": "Nameofunderlayervpn"
1056 #                 },
1057 #                 "ac1_ip": {
1058 #                     "type_name": "string",
1059 #                     "description": "ac1_ipofunderlayvpn"
1060 #                 },
1061 #                 "ac2_port": {
1062 #                     "type_name": "string",
1063 #                     "description": "ac2_portofunderlayvpn"
1064 #                 },
1065 #                 "pe1_id": {
1066 #                     "type_name": "string",
1067 #                     "description": "pe1_idofunderlayvpn"
1068 #                 },
1069 #                 "technology": {
1070 #                     "type_name": "string",
1071 #                     "description": "technologyofunderlayvpn"
1072 #                 },
1073 #                 "ac1_port": {
1074 #                     "type_name": "string",
1075 #                     "description": "ac1_portofunderlayvpn"
1076 #                 },
1077 #                 "ac2_svlan": {
1078 #                     "type_name": "integer",
1079 #                     "description": "ac2_svlanofunderlayvpn"
1080 #                 },
1081 #                 "topology": {
1082 #                     "type_name": "string",
1083 #                     "description": "topologyofunderlayvpn"
1084 #                 }
1085 #             }
1086 #         }
1087 #     }
1088 # }