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