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",
84 "tenant": "f7b17b0afd374d48a322e95cf4258eec",
85 "ipAddress": "10.0.101.1",
86 "macAddress": "fa:16:3e:a3:ac:5e",
87 "instId": "fb86af68-be48-4804-a454-3892333b9d4a",
88 "portid": "2dddd81b-a8d4-41f4-8a90-8f334bbbbe3b",
89 "networkid": "7d907188-46f0-4aa7-b61b-f2d349554a1b",
90 "subnetworkid": "08ef29e0-5e61-436a-a9ee-6a4ac502a622"
96 "extManagedVirtualLinks": [
98 "id": 'extManagedVirtualLink_1',
99 "virtualLinkDescId": 'virtualLinkDesc_1',
100 "vimConnectionId": 'vimConnection_1',
101 "resourceProviderId": 'resourceProvider_1',
102 "resourceId": 'resource_1',
105 "vimConnectionInfo": [
107 "id": 'vimConnection_1',
111 "apiVersion": "apiVersion_1",
112 "protocolType": "http"
115 "tenant": "tenant_vCPE",
117 "password": "vCPE_321",
122 "localizationLanguage": "en_US",
123 "additionalParams": {
136 'version': 'v4.14.10',
137 'vmnumber_overquota_alarm': False,
140 'vnfd_version': 'V00000001',
141 'id': 'sss-vnf-template',
142 'name': 'sss-vnf-template'
147 "description": "vdu description",
149 "name": "vduinstname",
152 "support_scaling": True,
155 "tenant": "tenantname",
156 "availability_zone": "zone1",
159 "local_affinity_antiaffinity_rule": [
161 "affinity_antiaffinity": "anti-affinity",
165 "affinity_antiaffinity": "affinity",
169 "inject_data_list": [
171 "file_name": "abc.xml",
172 "file_data": "<a>xxx</a><b>ssss</b>"
175 "storage_policy": "HIGH",
177 "manual_scale_select_vim": False,
179 "enabledelay": 600000,
182 "is_predefined": False,
183 "allow_scale_updown": False,
184 "inject_network_address": True,
185 "inner_hugepage_num": 100,
186 "inner_hugepage_size": "2048",
194 "virtual_storages": [
196 "virtual_storage_id": "volume_storage1",
197 "location": "/usr/data",
198 "device": "/dev/hda1"
208 "cpu_frequency": "1GHz",
209 "flavor_extra_specs": {
210 "hw: cpu_policy": "shared",
211 "hw: cpu_max_threads": 50,
212 "hw: cpu_sockets": 10,
213 "hw: cpu_max_sockets": 20,
214 "hw: cpu_max_cores": 8,
215 "hw: cpu_threads": 30,
216 "hw: numa_mem.0": 12288,
217 "hw: hugepage_num": 100,
218 "hw: high_performance": "dvs_high",
220 "hw: numa_cpus.0": "2,4,8",
221 "hw: numa_pci": True,
223 "pci_passthrough: alias": "ColetoCreek: 1",
224 "hw: mem_page_size": "large",
225 "hw: mem_paging_mechanism": "EPT"
237 "default_instances": 1
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"
270 "implementation": "<implementationScript>",
272 "param1Name": "value1",
273 "paramNName": "valueN"
284 "volume_storage_id": "volume_storage1",
287 "size": "\"100 GB\"",
289 "volume_name": "volumeStorage1",
290 "custom_volume_type": "type1",
292 "delete_on_termination_vm": True,
295 "tenant": "tenantname_1",
296 "availability_zone": "zone1"
298 "is_predefined": False,
311 'policy_id': 'policy_scale_sss-vnf-template',
313 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
322 'name': 'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
324 'disk_format': 'VMDK',
325 'file_url': './zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
326 'container_type': 'vm',
328 'hypervisor_type': 'kvm'
330 'image_file_id': 'opencos_sss_omm_img_release_20150723-1-disk1'
337 'disk_format': 'VMDK',
338 'file_url': './zte-cn-sss-main-image/NE/sss.vmdk',
339 'container_type': 'vm',
341 'hypervisor_type': 'kvm'
343 'image_file_id': 'sss'
351 "name": "umac_241_control",
352 "network_name": "umac_control",
353 "is_predefined": False,
355 "netmask": "255.255.255.0",
357 "network_type": "vlan",
358 "physical_network": "phynet01",
359 "segmentation_id": "30",
360 "vlan_transparent": False,
362 "cidr": "192.168.199.0/24",
364 "gateway_ip": "192.168.199.1",
365 "dhcp_enabled": False,
370 "start_ip": "192.168.199.2",
371 "end_ip": "192.168.199.254",
374 "destination": "10.43.26.0/24",
375 "nexthop": "10.41.23.1"
380 "tenant": "tenantname_1"
384 "route_id": "router01",
385 "route_external": False
394 "mac_address": "00:d9:00:82:11:e1",
395 "ip_address:": "192.168.1.21",
396 "ip_range_start": "192.168.1.20",
397 "ip_range_end": "192.168.1.29",
398 "floating_ip_address": {
399 "external_network": "extnet01",
400 "ip_address": "10.43.53.23"
402 "service_ip_address": "192.168.1.23",
405 "vnic_type": "normal",
406 "allowed_address_pairs": [
408 "ip": "192.168.1.13",
409 "mac": "00:f3:43:20:a2:a3"
414 "macbond": "00:d9:00:82:11:d1",
415 "sfc_encapsulation": "",
417 "gateway_ip": "192.168.199.1",
418 "netmask": "255.255.255.0",
419 "interface_name": "fe-01-02",
421 "function": "control"
433 c1_data_get_tenant_id = {
437 "name": "chinamobile"
441 c1_data_get_tenant_id_1 = {
451 c2_data_create_volume = {
452 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
455 "vimId": "vim_volume_1",
456 "vimName": "vim_volume_1",
457 "tenantId": "vim_volume_1",
459 "availabilityZone": "availabilityZone",
460 "status": "availuable",
461 "createTime": "2015-12-02T06:39:40.000000",
467 c3_data_get_volume = {
468 "status": "available",
472 "device": "/dev/vdc",
473 "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
474 "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
476 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
479 "createTime": "2015-12-02T06:39:40.000000",
481 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
486 c4_data_create_network = {
491 "id": "3c9eebdbbfd345658269340b9ea6fb73",
493 "tenantId": "tenant1",
494 "networkName": "ommnet",
496 "vlanTransparent": True,
497 "networkType": "vlan",
498 "segmentationId": 202,
499 "physicalNetwork": "physnet1",
500 "routerExternal": False
504 c5_data_create_subnet = {
509 "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
510 "tenantId": "tenant1",
511 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
512 "networkName": "networkName",
514 "cidr": "10.43.35.0/24",
517 "gatewayIp": "10.43.35.1",
518 "dnsNameservers": [],
521 "start": "192.168.199.2",
522 "end": "192.168.199.254"
529 c6_data_create_port = {
534 "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
535 "tenantId": "tenant1",
537 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
538 "networkName": "networkName",
539 "subnetId": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
540 "subnetName": "subnet1",
541 "macAddress": "212.12.61.23",
543 "vnicType": "direct",
548 c7_data_create_flavor = {
552 "id": "142019d3-bc6e-4319-9c1d-6722fc136afg",
553 "tenantId": "tenant1",
561 "extraSpecs": "testtt"
565 c8_data_list_image = {
571 "id": "5e2757c1-f846-4727-915c-9a872553ed75",
579 c9_data_create_vm = {
581 "id": "3c9eebdbbfd345658269340b9ea6fb73",
585 "tenantId": "tenant1",
588 "volumeArray": "dfdf",
589 "availabilityZone": "fdvfdv",
590 "flavorId": "fdvfdv",
591 "metadata": "fdvfdv",
592 "securityGroups": "fdvfdv",
593 "serverGroup": "fdvfdv",
600 "id": "3c9eebdbbfd345658269340b9ea6fb73",
604 "tenantId": "tenant1",
611 "volume_storage_id": "test",
615 "tenant": "chinamobile",
616 "availability_zone": "test",
618 "volume_name": "test",
619 "custom_volume_type": "test",
620 "size_of_storage": "\"10 GB\"",
622 "image_file": "test",
631 "tenant": "chinamobile",
634 "networkName": "test",
635 "networkType": "test",
636 "physicalNetwork": "test",
637 "vlanTransparent": "test",
638 "segmentationId": "1",
640 "dhcpEnabled": "test",
645 "connectivity_type": {
646 "layer_protocol": "ipv4",
648 "dns_nameservers": ["test"],
651 "route_external": False
658 "networkId": "", # TODO
659 "subnetId": "", # TODO
663 "mac_address": "test",
668 "fixed_ip_address": "test"
673 "vnic_type": "direct",
675 "virtual_network_interface_requirements": [
677 "network_interface_requirements": {
678 "interfaceType": '{"schemaVersion": "0", "schemaLocation":"", "platformId": "generic", "mandatory": false, "configurationValue": "SR-IOV"}'
680 "support_mandatory": False,
681 "name": "SRIOV_Port",
682 "description": "sriov"
694 "tenant": "chinamobile",
695 "availability_zone": "test",
702 "vduName": "VDU_vbng_0",
714 "type": "tosca.nodes.nfv.Vdu.Compute",
717 "num_virtual_cpu": "16",
720 "virtual_mem_size": "8000 MB",
721 "vdu_memory_requirements": {
722 "memoryPageSize": "8 MB",
726 "virtual_storages": [{
727 "virtual_storage_id": "test",
728 "type_of_storage": "ephemeral",
729 "size_of_storage": "10 GB",
731 "type": "tosca.nodes.nfv.Vdu.Compute",
734 "artifact_name": "sw_image",
740 "volume_storage_id": "test",
747 "local_storages": [],
755 "description": "pe1_idofunderlayvpn"
759 "description": "pe2_idofunderlayvpn"
763 "description": "serviceTypeofunderlayvpn"
767 "description": "descriptionofunderlayvpn"
771 "description": "ac2_routeofunderlayvpn"
775 "description": "ac1_routeofunderlayvpn"
779 "description": "ac1_svlanofunderlayvpn"
783 "description": "ac2_ipofunderlayvpn"
787 "description": "ac1_ipofunderlayvpn"
791 "description": "ac2_portofunderlayvpn"
795 "description": "topologyofunderlayvpn"
799 "description": "technologyofunderlayvpn"
803 "description": "ac1_portofunderlayvpn"
807 "description": "ac2_svlanofunderlayvpn"
811 "description": "Nameofunderlayervpn"
816 "name": "underlayervpn",
817 "csarVersion": "1.0",
819 "csarProvider": "huawei",
822 "id": "ns_underlayervpn_1_0"
828 "csarId": "vOpenNAT",
830 "csarName": "vOpenNAT.csar",
831 "vnfdModel": json.dumps(vnfdModel),
832 "vnfdProvider": "Intel",
833 "vnfdId": "openNAT_1.0",
834 "downloadUrl": "http://10.96.33.39:8806/static/catalog/vOpenNAT/vOpenNAT.csar",
835 "vnfVersion": "v1.0",
836 "vnfdVersion": "v1.0",
837 "vnfPackageId": "vOpenNAT"
841 single_vnf_lcm_op = {
842 "id": "99442b18-a5c7-11e8-998c-bf1755941f16",
843 "operationState": "STARTING",
844 "stateEnteredTime": "2018-07-09",
845 "startTime": "2018-07-09",
846 "vnfInstanceId": "cd552c9c-ab6f-11e8-b354-236c32aa91a1",
848 "operation": "SCALE",
849 "isAutomaticInvocation": False,
850 "operationParams": {},
851 "isCancelPending": False,
854 "resourceChanges": None,
856 "changedExtConnectivity": None,
861 "vnfInstance": "demo"
865 vnflcmop_with_exclude_default = [{
866 "id": "99442b18-a5c7-11e8-998c-bf1755941f16",
867 "operationState": "STARTING",
868 "stateEnteredTime": "2018-07-09",
869 "startTime": "2018-07-09",
870 "vnfInstanceId": "cd552c9c-ab6f-11e8-b354-236c32aa91a1",
872 "operation": "SCALE",
873 "isAutomaticInvocation": False,
874 "isCancelPending": False,
880 "vnfInstance": "demo"
884 multiple_vnf_lcm_op = [{
885 "id": "a6b9415c-ab99-11e8-9d37-dbb5e0378955",
886 "operationState": "STARTING",
887 "stateEnteredTime": "2018-07-09",
888 "startTime": "2018-07-09",
889 "vnfInstanceId": "cd552c9c-ab6f-11e8-b354-236c32aa91a1",
891 "operation": "INSTANTIATE",
892 "isAutomaticInvocation": False,
893 "operationParams": {},
894 "isCancelPending": False,
897 "resourceChanges": None,
899 "changedExtConnectivity": None,
904 "vnfInstance": "demo"
913 # "designer": "sdno",
914 # "name": "underlayervpn",
915 # "csarVersion": "1.0",
916 # "csarType": "SSAR",
917 # "csarProvider": "huawei",
920 # "id": "ns_underlayervpn_1_0"
924 # "id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
925 # "type_name": "tosca.nodes.sdn.l3ac",
926 # "template_name": "ac2",
929 # "type_name": "string"
932 # "type_name": "string"
935 # "type_name": "string"
938 # "type_name": "string"
943 # "name": "Standard",
944 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
950 # "type_name": "tosca.capabilities.Node"
954 # "type_name": "tosca.capabilities.sdn.ac"
959 # "target_node_id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
960 # "target_capability_name": "feature"
963 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
964 # "target_capability_name": "feature"
969 # "id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
970 # "type_name": "tosca.nodes.sdn.l3ac",
971 # "template_name": "ac1",
974 # "type_name": "string"
977 # "type_name": "string"
980 # "type_name": "string"
983 # "type_name": "string"
988 # "name": "Standard",
989 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
995 # "type_name": "tosca.capabilities.Node"
999 # "type_name": "tosca.capabilities.sdn.ac"
1002 # "relationships": [
1004 # "target_node_id": "pe1_e58ekps6m45g6w9egs9lue2j7",
1005 # "target_capability_name": "feature"
1008 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
1009 # "target_capability_name": "feature"
1014 # "id": "vpn_ie0xim076f7cje67fvrrq9tg1",
1015 # "type_name": "tosca.nodes.sdn.underlayVPN",
1016 # "template_name": "vpn",
1019 # "type_name": "string"
1022 # "type_name": "string"
1025 # "type_name": "string"
1028 # "type_name": "string"
1033 # "name": "Standard",
1034 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
1039 # "name": "feature",
1040 # "type_name": "tosca.capabilities.Node"
1043 # "relationships": [
1045 # "target_node_id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
1046 # "target_capability_name": "feature"
1049 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
1050 # "target_capability_name": "feature"
1055 # "id": "pe1_e58ekps6m45g6w9egs9lue2j7",
1056 # "type_name": "tosca.nodes.sdn.l3pe",
1057 # "template_name": "pe1",
1060 # "type_name": "string"
1065 # "name": "Standard",
1066 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
1071 # "name": "feature",
1072 # "type_name": "tosca.capabilities.Node"
1076 # "type_name": "tosca.capabilities.sdn.pe"
1081 # "id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
1082 # "type_name": "tosca.nodes.sdn.l3pe",
1083 # "template_name": "pe2",
1086 # "type_name": "string"
1091 # "name": "Standard",
1092 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
1097 # "name": "feature",
1098 # "type_name": "tosca.capabilities.Node"
1102 # "type_name": "tosca.capabilities.sdn.pe"
1108 # "node_type_name": "tosca.nodes.sdn.ext.NS.ns_underlayervpn"
1112 # "type_name": "string",
1113 # "description": "ac2_ipofunderlayvpn"
1116 # "type_name": "string",
1117 # "description": "ac2_routeofunderlayvpn"
1120 # "type_name": "string",
1121 # "description": "serviceTypeofunderlayvpn"
1124 # "type_name": "string",
1125 # "description": "descriptionofunderlayvpn"
1128 # "type_name": "string",
1129 # "description": "pe2_idofunderlayvpn"
1132 # "type_name": "string",
1133 # "description": "ac1_routeofunderlayvpn"
1136 # "type_name": "integer",
1137 # "description": "ac1_svlanofunderlayvpn"
1140 # "type_name": "string",
1141 # "description": "Nameofunderlayervpn"
1144 # "type_name": "string",
1145 # "description": "ac1_ipofunderlayvpn"
1148 # "type_name": "string",
1149 # "description": "ac2_portofunderlayvpn"
1152 # "type_name": "string",
1153 # "description": "pe1_idofunderlayvpn"
1156 # "type_name": "string",
1157 # "description": "technologyofunderlayvpn"
1160 # "type_name": "string",
1161 # "description": "ac1_portofunderlayvpn"
1164 # "type_name": "integer",
1165 # "description": "ac2_svlanofunderlayvpn"
1168 # "type_name": "string",
1169 # "description": "topologyofunderlayvpn"
1176 "volume_storages": [
1178 "volume_storage_id": "test",
1182 "tenant": "chinamobile",
1183 "availability_zone": "test",
1185 "volume_name": "test",
1186 "custom_volume_type": "test",
1187 "size_of_storage": "\"10 GB\"",
1189 "image_file": "test",
1193 "type": "tosca.nodes.nfv.VNF",
1201 "descriptor_id": "b1bb0ce7-1234-4fa7-95ed-4840d70a1179",
1202 "flavour_description": "simple",
1203 "descriptor_verison": "1.0",
1204 "software_version": "1.0.0",
1205 "template_name": "test",
1209 "descriptor_version": "1.0.0",
1211 "flavour_id": "simple",
1212 "product_name": "test"
1218 "template_name": "test",
1219 "template_version": "1.0",
1220 "template_author": "ZTE"
1226 "virtual_storages": [
1228 "virtual_storage_id": "test",
1229 "type_of_storage": "ephemeral",
1230 "size_of_storage": "10 GB",
1233 "volume_storages": [
1235 "volume_storage_id": "test",
1238 "vdu_id": "sunshine",
1241 "artifact_name": "sw_image",
1242 "type": "tosca.artifacts.nfv.SwImage",
1249 "virtual_compute": {
1251 "num_virtual_cpu": 2
1254 "virtual_mem_size": "4096 MB"
1263 "type": "tosca.nodes.nfv.Vdu.Compute",
1266 "max_number_of_instances": 3,
1267 "min_number_of_instances": 1
1269 "name": "sunshine1234",
1271 "operating_system": "linux",
1274 "hash": "d0e7828293355a07c2dccaaa765c80b507e60e6167067c950dc2e6b0da0dbd34",
1275 "algorithm": "SHA-256"
1278 "disk_format": "qcow2",
1280 "container_format": "bare",
1284 "description": "vdu test",
1288 "availability_zone": "",
1292 "cloudRegionId": "",
1295 "vduName": "sunshine1234",
1296 "flavorId": "12345",
1304 "description": "test",
1316 "basepath": "/tmp/tmpil6wVG",
1320 "key_name": "virtual_link",
1330 "type": "tosca.policies.nfv.InstantiationLevels",
1333 "default_level": "instantiation_level_1",
1335 "instantiation_level_1": {
1337 "sunshine_aspect": {
1341 "description": "vnf test instantiation_level_1"
1343 "instantiation_level_2": {
1345 "sunshine_aspect": {
1349 "description": "vnf test instantiation_level_2"
1351 "instantiation_level_3": {
1353 "sunshine_aspect": {
1357 "description": "vnf test instantiation_level_3"
1363 "type": "tosca.policies.nfv.VduInstantiationLevels",
1369 "instantiation_level_1": {
1370 "number_of_instances": 1
1372 "instantiation_level_2": {
1373 "number_of_instances": 2
1375 "instantiation_level_3": {
1376 "number_of_instances": 3
1382 "type": "tosca.policies.nfv.ScalingAspects",
1386 "sunshine_aspect": {
1387 "max_scale_level": 2,
1388 "description": "sunshine aspect",
1389 "name": "sunshine_aspect",
1398 "type": "tosca.policies.nfv.VduInitialDelta",
1404 "number_of_instances": 1
1409 "type": "tosca.policies.nfv.VduScalingAspectDeltas",
1416 "number_of_instances": 1
1419 "aspect": "sunshine_aspect"
1430 "vdu_id": "sunshine",
1432 "trunk_mode": "false",
1435 "address_type": "ip_address",
1436 "l3_address_data": {
1437 "floating_ip_activated": False,
1438 "ip_address_assignment": False
1448 "template_name": "test",
1449 "template_version": "1.0",
1450 "template_author": "ZTE"