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