1 # Copyright (C) 2019 ZTE. All Rights Reserved.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 instantiate_grant_result = {
22 "tenant": 'chinamobile'
26 "vnfId": "413aa1fe-b4d1-11e8-8268-dff5aab95c63",
28 "computeResourceFlavours": [
30 "resourceProviderId": "vgw",
31 "vimFlavourId": "yui",
39 "flavourId": "flavour_1",
40 "instantiationLevelId": "instantiationLevel_1",
43 "id": "extVirtualLink_1",
44 "vimConnectionId": "vimConnection_1",
45 "resourceProviderId": "resourceProvider_1",
46 "resourceId": "resource_1",
47 "resourceSubnetId": "resourceSubnet_1",
53 "cpInstanceId": "cpInstance_1",
54 "linkPortId": "linkPort_1",
57 "layerProtocol": "IP_OVER_ETHERNET",
59 "macAddress": "00:f3:43:20:a2:a3",
63 "fixedAddresses": ["192.168.104.2", ],
64 "numDynamicAddresses": 0,
66 "subnetId": "subnet_1",
78 "id": "extLinkPort_1",
80 "vimConnectionId": "vimConnection_1",
81 "resourceProviderId": "resourceProvider_1",
82 "resourceId": "resource_1",
83 "vimLevelResourceType": "vimLevelResourceType_1",
89 "extManagedVirtualLinks": [
91 "id": 'extManagedVirtualLink_1',
92 "virtualLinkDescId": 'virtualLinkDesc_1',
93 "vimConnectionId": 'vimConnection_1',
94 "resourceProviderId": 'resourceProvider_1',
95 "resourceId": 'resource_1',
98 "vimConnectionInfo": [
100 "id": 'vimConnection_1',
104 "apiVersion": "apiVersion_1",
105 "protocolType": "http"
108 "tenant": "tenant_vCPE",
110 "password": "vCPE_321",
115 "localizationLanguage": "en_US",
116 "additionalParams": {
129 'version': 'v4.14.10',
130 'vmnumber_overquota_alarm': False,
133 'vnfd_version': 'V00000001',
134 'id': 'sss-vnf-template',
135 'name': 'sss-vnf-template'
140 "description": "vdu description",
142 "name": "vduinstname",
145 "support_scaling": True,
148 "tenant": "tenantname",
149 "availability_zone": "zone1",
152 "local_affinity_antiaffinity_rule": [
154 "affinity_antiaffinity": "anti-affinity",
158 "affinity_antiaffinity": "affinity",
162 "inject_data_list": [
164 "file_name": "abc.xml",
165 "file_data": "<a>xxx</a><b>ssss</b>"
168 "storage_policy": "HIGH",
170 "manual_scale_select_vim": False,
172 "enabledelay": 600000,
175 "is_predefined": False,
176 "allow_scale_updown": False,
177 "inject_network_address": True,
178 "inner_hugepage_num": 100,
179 "inner_hugepage_size": "2048",
187 "virtual_storages": [
189 "virtual_storage_id": "volume_storage1",
190 "location": "/usr/data",
191 "device": "/dev/hda1"
201 "cpu_frequency": "1GHz",
202 "flavor_extra_specs": {
203 "hw: cpu_policy": "shared",
204 "hw: cpu_max_threads": 50,
205 "hw: cpu_sockets": 10,
206 "hw: cpu_max_sockets": 20,
207 "hw: cpu_max_cores": 8,
208 "hw: cpu_threads": 30,
209 "hw: numa_mem.0": 12288,
210 "hw: hugepage_num": 100,
211 "hw: high_performance": "dvs_high",
213 "hw: numa_cpus.0": "2,4,8",
214 "hw: numa_pci": True,
216 "pci_passthrough: alias": "ColetoCreek: 1",
217 "hw: mem_page_size": "large",
218 "hw: mem_paging_mechanism": "EPT"
230 "default_instances": 1
235 "implementation": "<implementationScript>",
237 "param1Name": "value1",
238 "paramNName": "valueN"
242 "implementation": "<implementationScript>",
244 "param1Name": "value1",
245 "paramNName": "valueN"
249 "implementation": "<implementationScript>",
251 "param1Name": "value1",
252 "paramNName": "valueN"
256 "implementation": "<implementationScript>",
258 "param1Name": "value1",
259 "paramNName": "valueN"
263 "implementation": "<implementationScript>",
265 "param1Name": "value1",
266 "paramNName": "valueN"
277 "volume_storage_id": "volume_storage1",
280 "size": "\"100 GB\"",
282 "volume_name": "volumeStorage1",
283 "custom_volume_type": "type1",
285 "delete_on_termination_vm": True,
288 "tenant": "tenantname_1",
289 "availability_zone": "zone1"
291 "is_predefined": False,
304 'policy_id': 'policy_scale_sss-vnf-template',
306 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
315 'name': 'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
317 'disk_format': 'VMDK',
318 'file_url': './zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
319 'container_type': 'vm',
321 'hypervisor_type': 'kvm'
323 'image_file_id': 'opencos_sss_omm_img_release_20150723-1-disk1'
330 'disk_format': 'VMDK',
331 'file_url': './zte-cn-sss-main-image/NE/sss.vmdk',
332 'container_type': 'vm',
334 'hypervisor_type': 'kvm'
336 'image_file_id': 'sss'
344 "name": "umac_241_control",
345 "network_name": "umac_control",
346 "is_predefined": False,
348 "netmask": "255.255.255.0",
350 "network_type": "vlan",
351 "physical_network": "phynet01",
352 "segmentation_id": "30",
353 "vlan_transparent": False,
355 "cidr": "192.168.199.0/24",
357 "gateway_ip": "192.168.199.1",
358 "dhcp_enabled": False,
363 "start_ip": "192.168.199.2",
364 "end_ip": "192.168.199.254",
367 "destination": "10.43.26.0/24",
368 "nexthop": "10.41.23.1"
373 "tenant": "tenantname_1"
377 "route_id": "router01",
378 "route_external": False
387 "mac_address": "00:d9:00:82:11:e1",
388 "ip_address:": "192.168.1.21",
389 "ip_range_start": "192.168.1.20",
390 "ip_range_end": "192.168.1.29",
391 "floating_ip_address": {
392 "external_network": "extnet01",
393 "ip_address": "10.43.53.23"
395 "service_ip_address": "192.168.1.23",
398 "vnic_type": "normal",
399 "allowed_address_pairs": [
401 "ip": "192.168.1.13",
402 "mac": "00:f3:43:20:a2:a3"
407 "macbond": "00:d9:00:82:11:d1",
408 "sfc_encapsulation": "",
410 "gateway_ip": "192.168.199.1",
411 "netmask": "255.255.255.0",
412 "interface_name": "fe-01-02",
414 "function": "control"
426 c1_data_get_tenant_id = {
430 "name": "chinamobile"
434 c1_data_get_tenant_id_1 = {
444 c2_data_create_volume = {
445 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
448 "vimId": "vim_volume_1",
449 "vimName": "vim_volume_1",
450 "tenantId": "vim_volume_1",
452 "availabilityZone": "availabilityZone",
453 "status": "availuable",
454 "createTime": "2015-12-02T06:39:40.000000",
460 c3_data_get_volume = {
461 "status": "available",
465 "device": "/dev/vdc",
466 "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
467 "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
469 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
472 "createTime": "2015-12-02T06:39:40.000000",
474 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
479 c4_data_create_network = {
484 "id": "3c9eebdbbfd345658269340b9ea6fb73",
486 "tenantId": "tenant1",
487 "networkName": "ommnet",
489 "vlanTransparent": True,
490 "networkType": "vlan",
491 "segmentationId": 202,
492 "physicalNetwork": "physnet1",
493 "routerExternal": False
497 c5_data_create_subnet = {
502 "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
503 "tenantId": "tenant1",
504 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
505 "networkName": "networkName",
507 "cidr": "10.43.35.0/24",
510 "gatewayIp": "10.43.35.1",
511 "dnsNameservers": [],
514 "start": "192.168.199.2",
515 "end": "192.168.199.254"
522 c6_data_create_port = {
527 "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
528 "tenantId": "tenant1",
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",
536 "vnicType": "direct",
541 c7_data_create_flavor = {
545 "id": "142019d3-bc6e-4319-9c1d-6722fc136afg",
546 "tenantId": "tenant1",
554 "extraSpecs": "testtt"
558 c8_data_list_image = {
564 "id": "5e2757c1-f846-4727-915c-9a872553ed75",
572 c9_data_create_vm = {
574 "id": "3c9eebdbbfd345658269340b9ea6fb73",
578 "tenantId": "tenant1",
581 "volumeArray": "dfdf",
582 "availabilityZone": "fdvfdv",
583 "flavorId": "fdvfdv",
584 "metadata": "fdvfdv",
585 "securityGroups": "fdvfdv",
586 "serverGroup": "fdvfdv",
593 "id": "3c9eebdbbfd345658269340b9ea6fb73",
597 "tenantId": "tenant1",
604 "volume_storage_id": "test",
608 "tenant": "chinamobile",
609 "availability_zone": "test",
611 "volume_name": "test",
612 "custom_volume_type": "test",
613 "size_of_storage": "\"10 GB\"",
615 "image_file": "test",
624 "tenant": "chinamobile",
627 "networkName": "test",
628 "networkType": "test",
629 "physicalNetwork": "test",
630 "vlanTransparent": "test",
631 "segmentationId": "1",
633 "dhcpEnabled": "test",
638 "connectivity_type": {
639 "layer_protocol": "ipv4",
641 "dns_nameservers": "test",
642 "host_routes": "test",
644 "route_external": "test",
651 "networkId": "", # TODO
652 "subnetId": "", # TODO
656 "mac_address": "test",
661 "fixed_ip_address": "test"
666 "vnic_type": "direct",
668 "virtual_network_interface_requirements": [
670 "network_interface_requirements": {
671 "interfaceType": '{"schemaVersion": "0", "schemaLocation":"", "platformId": "generic", "mandatory": false, "configurationValue": "SR-IOV"}'
673 "support_mandatory": False,
674 "name": "SRIOV_Port",
675 "description": "sriov"
687 "tenant": "chinamobile",
688 "availability_zone": "test",
695 "vduName": "VDU_vbng_0",
707 "type": "tosca.nodes.nfv.Vdu.Compute",
710 "num_virtual_cpu": "16",
713 "virtual_mem_size": "8000 MB",
714 "vdu_memory_requirements": {
715 "memoryPageSize": "8 MB",
719 "virtual_storages": [{
720 "virtual_storage_id": "test",
721 "type_of_storage": "ephemeral",
722 "size_of_storage": "10 GB",
724 "type": "tosca.nodes.nfv.Vdu.Compute",
727 "artifact_name": "sw_image",
733 "volume_storage_id": "test",
740 "local_storages": [],
748 "description": "pe1_idofunderlayvpn"
752 "description": "pe2_idofunderlayvpn"
756 "description": "serviceTypeofunderlayvpn"
760 "description": "descriptionofunderlayvpn"
764 "description": "ac2_routeofunderlayvpn"
768 "description": "ac1_routeofunderlayvpn"
772 "description": "ac1_svlanofunderlayvpn"
776 "description": "ac2_ipofunderlayvpn"
780 "description": "ac1_ipofunderlayvpn"
784 "description": "ac2_portofunderlayvpn"
788 "description": "topologyofunderlayvpn"
792 "description": "technologyofunderlayvpn"
796 "description": "ac1_portofunderlayvpn"
800 "description": "ac2_svlanofunderlayvpn"
804 "description": "Nameofunderlayervpn"
809 "name": "underlayervpn",
810 "csarVersion": "1.0",
812 "csarProvider": "huawei",
815 "id": "ns_underlayervpn_1_0"
821 "csarId": "vOpenNAT",
823 "csarName": "vOpenNAT.csar",
824 "vnfdModel": json.dumps(vnfdModel),
825 "vnfdProvider": "Intel",
826 "vnfdId": "openNAT_1.0",
827 "downloadUrl": "http://10.96.33.39:8806/static/catalog/vOpenNAT/vOpenNAT.csar",
828 "vnfVersion": "v1.0",
829 "vnfdVersion": "v1.0",
830 "vnfPackageId": "vOpenNAT"
834 single_vnf_lcm_op = {
835 "id": "99442b18-a5c7-11e8-998c-bf1755941f16",
836 "operationState": "STARTING",
837 "stateEnteredTime": "2018-07-09",
838 "startTime": "2018-07-09",
839 "vnfInstanceId": "cd552c9c-ab6f-11e8-b354-236c32aa91a1",
841 "operation": "SCALE",
842 "isAutomaticInvocation": False,
843 "operationParams": {},
844 "isCancelPending": False,
847 "resourceChanges": None,
849 "changedExtConnectivity": None,
854 "vnfInstance": "demo"
858 vnflcmop_with_exclude_default = [{
859 "id": "99442b18-a5c7-11e8-998c-bf1755941f16",
860 "operationState": "STARTING",
861 "stateEnteredTime": "2018-07-09",
862 "startTime": "2018-07-09",
863 "vnfInstanceId": "cd552c9c-ab6f-11e8-b354-236c32aa91a1",
865 "operation": "SCALE",
866 "isAutomaticInvocation": False,
867 "isCancelPending": False,
873 "vnfInstance": "demo"
877 multiple_vnf_lcm_op = [{
878 "id": "a6b9415c-ab99-11e8-9d37-dbb5e0378955",
879 "operationState": "STARTING",
880 "stateEnteredTime": "2018-07-09",
881 "startTime": "2018-07-09",
882 "vnfInstanceId": "cd552c9c-ab6f-11e8-b354-236c32aa91a1",
884 "operation": "INSTANTIATE",
885 "isAutomaticInvocation": False,
886 "operationParams": {},
887 "isCancelPending": False,
890 "resourceChanges": None,
892 "changedExtConnectivity": None,
897 "vnfInstance": "demo"
906 # "designer": "sdno",
907 # "name": "underlayervpn",
908 # "csarVersion": "1.0",
909 # "csarType": "SSAR",
910 # "csarProvider": "huawei",
913 # "id": "ns_underlayervpn_1_0"
917 # "id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
918 # "type_name": "tosca.nodes.sdn.l3ac",
919 # "template_name": "ac2",
922 # "type_name": "string"
925 # "type_name": "string"
928 # "type_name": "string"
931 # "type_name": "string"
936 # "name": "Standard",
937 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
943 # "type_name": "tosca.capabilities.Node"
947 # "type_name": "tosca.capabilities.sdn.ac"
952 # "target_node_id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
953 # "target_capability_name": "feature"
956 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
957 # "target_capability_name": "feature"
962 # "id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
963 # "type_name": "tosca.nodes.sdn.l3ac",
964 # "template_name": "ac1",
967 # "type_name": "string"
970 # "type_name": "string"
973 # "type_name": "string"
976 # "type_name": "string"
981 # "name": "Standard",
982 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
988 # "type_name": "tosca.capabilities.Node"
992 # "type_name": "tosca.capabilities.sdn.ac"
997 # "target_node_id": "pe1_e58ekps6m45g6w9egs9lue2j7",
998 # "target_capability_name": "feature"
1001 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
1002 # "target_capability_name": "feature"
1007 # "id": "vpn_ie0xim076f7cje67fvrrq9tg1",
1008 # "type_name": "tosca.nodes.sdn.underlayVPN",
1009 # "template_name": "vpn",
1012 # "type_name": "string"
1015 # "type_name": "string"
1018 # "type_name": "string"
1021 # "type_name": "string"
1026 # "name": "Standard",
1027 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
1032 # "name": "feature",
1033 # "type_name": "tosca.capabilities.Node"
1036 # "relationships": [
1038 # "target_node_id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
1039 # "target_capability_name": "feature"
1042 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
1043 # "target_capability_name": "feature"
1048 # "id": "pe1_e58ekps6m45g6w9egs9lue2j7",
1049 # "type_name": "tosca.nodes.sdn.l3pe",
1050 # "template_name": "pe1",
1053 # "type_name": "string"
1058 # "name": "Standard",
1059 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
1064 # "name": "feature",
1065 # "type_name": "tosca.capabilities.Node"
1069 # "type_name": "tosca.capabilities.sdn.pe"
1074 # "id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
1075 # "type_name": "tosca.nodes.sdn.l3pe",
1076 # "template_name": "pe2",
1079 # "type_name": "string"
1084 # "name": "Standard",
1085 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
1090 # "name": "feature",
1091 # "type_name": "tosca.capabilities.Node"
1095 # "type_name": "tosca.capabilities.sdn.pe"
1101 # "node_type_name": "tosca.nodes.sdn.ext.NS.ns_underlayervpn"
1105 # "type_name": "string",
1106 # "description": "ac2_ipofunderlayvpn"
1109 # "type_name": "string",
1110 # "description": "ac2_routeofunderlayvpn"
1113 # "type_name": "string",
1114 # "description": "serviceTypeofunderlayvpn"
1117 # "type_name": "string",
1118 # "description": "descriptionofunderlayvpn"
1121 # "type_name": "string",
1122 # "description": "pe2_idofunderlayvpn"
1125 # "type_name": "string",
1126 # "description": "ac1_routeofunderlayvpn"
1129 # "type_name": "integer",
1130 # "description": "ac1_svlanofunderlayvpn"
1133 # "type_name": "string",
1134 # "description": "Nameofunderlayervpn"
1137 # "type_name": "string",
1138 # "description": "ac1_ipofunderlayvpn"
1141 # "type_name": "string",
1142 # "description": "ac2_portofunderlayvpn"
1145 # "type_name": "string",
1146 # "description": "pe1_idofunderlayvpn"
1149 # "type_name": "string",
1150 # "description": "technologyofunderlayvpn"
1153 # "type_name": "string",
1154 # "description": "ac1_portofunderlayvpn"
1157 # "type_name": "integer",
1158 # "description": "ac2_svlanofunderlayvpn"
1161 # "type_name": "string",
1162 # "description": "topologyofunderlayvpn"
1169 "volume_storages": [
1171 "volume_storage_id": "test",
1175 "tenant": "chinamobile",
1176 "availability_zone": "test",
1178 "volume_name": "test",
1179 "custom_volume_type": "test",
1180 "size_of_storage": "\"10 GB\"",
1182 "image_file": "test",
1186 "type": "tosca.nodes.nfv.VNF",
1194 "descriptor_id": "b1bb0ce7-1234-4fa7-95ed-4840d70a1179",
1195 "flavour_description": "simple",
1196 "descriptor_verison": "1.0",
1197 "software_version": "1.0.0",
1198 "template_name": "test",
1202 "descriptor_version": "1.0.0",
1204 "flavour_id": "simple",
1205 "product_name": "test"
1211 "template_name": "test",
1212 "template_version": "1.0",
1213 "template_author": "ZTE"
1219 "virtual_storages": [
1221 "virtual_storage_id": "test",
1222 "type_of_storage": "ephemeral",
1223 "size_of_storage": "10 GB",
1226 "volume_storages": [
1228 "volume_storage_id": "test",
1231 "vdu_id": "sunshine",
1234 "artifact_name": "sw_image",
1235 "type": "tosca.artifacts.nfv.SwImage",
1242 "virtual_compute": {
1244 "num_virtual_cpu": 2
1247 "virtual_mem_size": "4096 MB"
1256 "type": "tosca.nodes.nfv.Vdu.Compute",
1259 "max_number_of_instances": 3,
1260 "min_number_of_instances": 1
1262 "name": "sunshine1234",
1264 "operating_system": "linux",
1267 "hash": "d0e7828293355a07c2dccaaa765c80b507e60e6167067c950dc2e6b0da0dbd34",
1268 "algorithm": "SHA-256"
1271 "disk_format": "qcow2",
1273 "container_format": "bare",
1277 "description": "vdu test",
1281 "availability_zone": "",
1285 "cloudRegionId": "",
1288 "vduName": "sunshine1234",
1289 "flavorId": "12345",
1297 "description": "test",
1309 "basepath": "/tmp/tmpil6wVG",
1313 "key_name": "virtual_link",
1323 "type": "tosca.policies.nfv.InstantiationLevels",
1326 "default_level": "instantiation_level_1",
1328 "instantiation_level_1": {
1330 "sunshine_aspect": {
1334 "description": "vnf test instantiation_level_1"
1336 "instantiation_level_2": {
1338 "sunshine_aspect": {
1342 "description": "vnf test instantiation_level_2"
1344 "instantiation_level_3": {
1346 "sunshine_aspect": {
1350 "description": "vnf test instantiation_level_3"
1356 "type": "tosca.policies.nfv.VduInstantiationLevels",
1362 "instantiation_level_1": {
1363 "number_of_instances": 1
1365 "instantiation_level_2": {
1366 "number_of_instances": 2
1368 "instantiation_level_3": {
1369 "number_of_instances": 3
1375 "type": "tosca.policies.nfv.ScalingAspects",
1379 "sunshine_aspect": {
1380 "max_scale_level": 2,
1381 "description": "sunshine aspect",
1382 "name": "sunshine_aspect",
1391 "type": "tosca.policies.nfv.VduInitialDelta",
1397 "number_of_instances": 1
1402 "type": "tosca.policies.nfv.VduScalingAspectDeltas",
1409 "number_of_instances": 1
1412 "aspect": "sunshine_aspect"
1423 "vdu_id": "sunshine",
1425 "trunk_mode": "false",
1428 "address_type": "ip_address",
1429 "l3_address_data": {
1430 "floating_ip_activated": False,
1431 "ip_address_assignment": False
1441 "template_name": "test",
1442 "template_version": "1.0",
1443 "template_author": "ZTE"