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",
29 "computeResourceFlavours": [
31 "resourceProviderId": "vgw",
32 "vimFlavourId": "yui",
41 "flavourId": "flavour_1",
42 "instantiationLevelId": "instantiationLevel_1",
45 "id": "extVirtualLink_1",
46 "vimConnectionId": "vimConnection_1",
47 "resourceProviderId": "resourceProvider_1",
48 "resourceId": "resource_1",
49 "resourceSubnetId": "resourceSubnet_1",
55 "cpInstanceId": "cpInstance_1",
56 "linkPortId": "linkPort_1",
59 "layerProtocol": "IP_OVER_ETHERNET",
61 "macAddress": "00:f3:43:20:a2:a3",
65 "fixedAddresses": ["192.168.104.2", ],
66 "numDynamicAddresses": 0,
68 "subnetId": "subnet_1",
80 "id": "extLinkPort_1",
82 "vimConnectionId": "vimConnection_1",
83 "resourceProviderId": "resourceProvider_1",
84 "resourceId": "resource_1",
85 "vimLevelResourceType": "vimLevelResourceType_1",
91 "extManagedVirtualLinks": [
93 "id": 'extManagedVirtualLink_1',
94 "virtualLinkDescId": 'virtualLinkDesc_1',
95 "vimConnectionId": 'vimConnection_1',
96 "resourceProviderId": 'resourceProvider_1',
97 "resourceId": 'resource_1',
100 "vimConnectionInfo": [
102 "id": 'vimConnection_1',
106 "apiVersion": "apiVersion_1",
107 "protocolType": "http"
110 "tenant": "tenant_vCPE",
112 "password": "vCPE_321",
117 "localizationLanguage": "en_US",
118 "additionalParams": {
132 'version': 'v4.14.10',
133 'vmnumber_overquota_alarm': False,
136 'vnfd_version': 'V00000001',
137 'id': 'sss-vnf-template',
138 'name': 'sss-vnf-template'
143 "description": "vdu description",
145 "name": "vduinstname",
148 "support_scaling": True,
151 "tenant": "tenantname",
152 "availability_zone": "zone1",
155 "local_affinity_antiaffinity_rule": [
157 "affinity_antiaffinity": "anti-affinity",
161 "affinity_antiaffinity": "affinity",
165 "inject_data_list": [
167 "file_name": "abc.xml",
168 "file_data": "<a>xxx</a><b>ssss</b>"
171 "storage_policy": "HIGH",
173 "manual_scale_select_vim": False,
175 "enabledelay": 600000,
178 "is_predefined": False,
179 "allow_scale_updown": False,
180 "inject_network_address": True,
181 "inner_hugepage_num": 100,
182 "inner_hugepage_size": "2048",
190 "virtual_storages": [
192 "virtual_storage_id": "volume_storage1",
193 "location": "/usr/data",
194 "device": "/dev/hda1"
204 "cpu_frequency": "1GHz",
205 "flavor_extra_specs": {
206 "hw: cpu_policy": "shared",
207 "hw: cpu_max_threads": 50,
208 "hw: cpu_sockets": 10,
209 "hw: cpu_max_sockets": 20,
210 "hw: cpu_max_cores": 8,
211 "hw: cpu_threads": 30,
212 "hw: numa_mem.0": 12288,
213 "hw: hugepage_num": 100,
214 "hw: high_performance": "dvs_high",
216 "hw: numa_cpus.0": "2,4,8",
217 "hw: numa_pci": True,
219 "pci_passthrough: alias": "ColetoCreek: 1",
220 "hw: mem_page_size": "large",
221 "hw: mem_paging_mechanism": "EPT"
233 "default_instances": 1
238 "implementation": "<implementationScript>",
240 "param1Name": "value1",
241 "paramNName": "valueN"
245 "implementation": "<implementationScript>",
247 "param1Name": "value1",
248 "paramNName": "valueN"
252 "implementation": "<implementationScript>",
254 "param1Name": "value1",
255 "paramNName": "valueN"
259 "implementation": "<implementationScript>",
261 "param1Name": "value1",
262 "paramNName": "valueN"
266 "implementation": "<implementationScript>",
268 "param1Name": "value1",
269 "paramNName": "valueN"
280 "volume_storage_id": "volume_storage1",
283 "size": "\"100 GB\"",
285 "volume_name": "volumeStorage1",
286 "custom_volume_type": "type1",
288 "delete_on_termination_vm": True,
291 "tenant": "tenantname_1",
292 "availability_zone": "zone1"
294 "is_predefined": False,
307 'policy_id': 'policy_scale_sss-vnf-template',
309 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
318 'name': 'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
320 'disk_format': 'VMDK',
321 'file_url': './zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
322 'container_type': 'vm',
324 'hypervisor_type': 'kvm'
326 'image_file_id': 'opencos_sss_omm_img_release_20150723-1-disk1'
333 'disk_format': 'VMDK',
334 'file_url': './zte-cn-sss-main-image/NE/sss.vmdk',
335 'container_type': 'vm',
337 'hypervisor_type': 'kvm'
339 'image_file_id': 'sss'
347 "name": "umac_241_control",
348 "network_name": "umac_control",
349 "is_predefined": False,
351 "netmask": "255.255.255.0",
353 "network_type": "vlan",
354 "physical_network": "phynet01",
355 "segmentation_id": "30",
356 "vlan_transparent": False,
358 "cidr": "192.168.199.0/24",
360 "gateway_ip": "192.168.199.1",
361 "dhcp_enabled": False,
366 "start_ip": "192.168.199.2",
367 "end_ip": "192.168.199.254",
370 "destination": "10.43.26.0/24",
371 "nexthop": "10.41.23.1"
376 "tenant": "tenantname_1"
380 "route_id": "router01",
381 "route_external": False
390 "mac_address": "00:d9:00:82:11:e1",
391 "ip_address:": "192.168.1.21",
392 "ip_range_start": "192.168.1.20",
393 "ip_range_end": "192.168.1.29",
394 "floating_ip_address": {
395 "external_network": "extnet01",
396 "ip_address": "10.43.53.23"
398 "service_ip_address": "192.168.1.23",
401 "vnic_type": "normal",
402 "allowed_address_pairs": [
404 "ip": "192.168.1.13",
405 "mac": "00:f3:43:20:a2:a3"
410 "macbond": "00:d9:00:82:11:d1",
411 "sfc_encapsulation": "",
413 "gateway_ip": "192.168.199.1",
414 "netmask": "255.255.255.0",
415 "interface_name": "fe-01-02",
417 "function": "control"
429 c1_data_get_tenant_id = {
433 "name": "chinamobile"
437 c1_data_get_tenant_id_1 = {
448 c2_data_create_volume = {
449 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
452 "vimId": "vim_volume_1",
453 "vimName": "vim_volume_1",
454 "tenantId": "vim_volume_1",
456 "availabilityZone": "availabilityZone",
457 "status": "availuable",
458 "createTime": "2015-12-02T06:39:40.000000",
464 c3_data_get_volume = {
465 "status": "available",
469 "device": "/dev/vdc",
470 "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
471 "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
473 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
476 "createTime": "2015-12-02T06:39:40.000000",
478 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
483 c4_data_create_network = {
488 "id": "3c9eebdbbfd345658269340b9ea6fb73",
490 "tenantId": "tenant1",
491 "networkName": "ommnet",
493 "vlanTransparent": True,
494 "networkType": "vlan",
495 "segmentationId": 202,
496 "physicalNetwork": "physnet1",
497 "routerExternal": False
501 c5_data_create_subnet = {
506 "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
507 "tenantId": "tenant1",
508 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
509 "networkName": "networkName",
511 "cidr": "10.43.35.0/24",
514 "gatewayIp": "10.43.35.1",
515 "dnsNameservers": [],
518 "start": "192.168.199.2",
519 "end": "192.168.199.254"
526 c6_data_create_port = {
531 "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
532 "tenantId": "tenant1",
534 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
535 "networkName": "networkName",
536 "subnetId": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
537 "subnetName": "subnet1",
538 "macAddress": "212.12.61.23",
540 "vnicType": "direct",
545 c7_data_create_flavor = {
549 "id": "142019d3-bc6e-4319-9c1d-6722fc136afg",
550 "tenantId": "tenant1",
558 "extraSpecs": "testtt"
562 c8_data_list_image = {
568 "id": "5e2757c1-f846-4727-915c-9a872553ed75",
576 c9_data_create_vm = {
578 "id": "3c9eebdbbfd345658269340b9ea6fb73",
582 "tenantId": "tenant1",
585 "volumeArray": "dfdf",
586 "availabilityZone": "fdvfdv",
587 "flavorId": "fdvfdv",
588 "metadata": "fdvfdv",
589 "securityGroups": "fdvfdv",
590 "serverGroup": "fdvfdv",
597 "id": "3c9eebdbbfd345658269340b9ea6fb73",
601 "tenantId": "tenant1",
608 "volume_storage_id": "test",
612 "tenant": "chinamobile",
613 "availability_zone": "test",
615 "volume_name": "test",
616 "custom_volume_type": "test",
617 "size_of_storage": "\"10 GB\"",
619 "image_file": "test",
628 "tenant": "chinamobile",
631 "networkName": "test",
632 "networkType": "test",
633 "physicalNetwork": "test",
634 "vlanTransparent": "test",
635 "segmentationId": "1",
637 "dhcpEnabled": "test",
642 "connectivity_type": {
643 "layer_protocol": "ipv4",
645 "dns_nameservers": "test",
646 "host_routes": "test",
648 "route_external": "test",
655 "networkId": "", # TODO
656 "subnetId": "", # TODO
660 "mac_address": "test",
665 "fixed_ip_address": "test"
670 "vnic_type": "direct",
672 "virtual_network_interface_requirements": [
674 "network_interface_requirements": {
675 "interfaceType": '{"schemaVersion": "0", "schemaLocation":"", "platformId": "generic", "mandatory": false, "configurationValue": "SR-IOV"}'
677 "support_mandatory": False,
678 "name": "SRIOV_Port",
679 "description": "sriov"
691 "tenant": "chinamobile",
692 "availability_zone": "test",
699 "vduName": "VDU_vbng_0",
711 "type": "tosca.nodes.nfv.Vdu.Compute",
714 "num_virtual_cpu": "16",
717 "virtual_mem_size": "8000 MB",
718 "vdu_memory_requirements": {
719 "memoryPageSize": "8 MB",
723 "virtual_storages": [{
724 "virtual_storage_id": "test",
725 "type_of_storage": "ephemeral",
726 "size_of_storage": "10 GB",
728 "type": "tosca.nodes.nfv.Vdu.Compute",
731 "artifact_name": "sw_image",
737 "volume_storage_id": "test",
744 "local_storages": [],
752 "description": "pe1_idofunderlayvpn"
756 "description": "pe2_idofunderlayvpn"
760 "description": "serviceTypeofunderlayvpn"
764 "description": "descriptionofunderlayvpn"
768 "description": "ac2_routeofunderlayvpn"
772 "description": "ac1_routeofunderlayvpn"
776 "description": "ac1_svlanofunderlayvpn"
780 "description": "ac2_ipofunderlayvpn"
784 "description": "ac1_ipofunderlayvpn"
788 "description": "ac2_portofunderlayvpn"
792 "description": "topologyofunderlayvpn"
796 "description": "technologyofunderlayvpn"
800 "description": "ac1_portofunderlayvpn"
804 "description": "ac2_svlanofunderlayvpn"
808 "description": "Nameofunderlayervpn"
813 "name": "underlayervpn",
814 "csarVersion": "1.0",
816 "csarProvider": "huawei",
819 "id": "ns_underlayervpn_1_0"
825 "csarId": "vOpenNAT",
827 "csarName": "vOpenNAT.csar",
828 "vnfdModel": json.dumps(vnfdModel),
829 "vnfdProvider": "Intel",
830 "vnfdId": "openNAT_1.0",
831 "downloadUrl": "http://10.96.33.39:8806/static/catalog/vOpenNAT/vOpenNAT.csar",
832 "vnfVersion": "v1.0",
833 "vnfdVersion": "v1.0",
834 "vnfPackageId": "vOpenNAT"
839 single_vnf_lcm_op = {
840 "id": "99442b18-a5c7-11e8-998c-bf1755941f16",
841 "operationState": "STARTING",
842 "stateEnteredTime": "2018-07-09",
843 "startTime": "2018-07-09",
844 "vnfInstanceId": "cd552c9c-ab6f-11e8-b354-236c32aa91a1",
846 "operation": "SCALE",
847 "isAutomaticInvocation": False,
848 "operationParams": {},
849 "isCancelPending": False,
852 "resourceChanges": None,
854 "changedExtConnectivity": None,
859 "vnfInstance": "demo"
864 vnflcmop_with_exclude_default = [{
865 "id": "99442b18-a5c7-11e8-998c-bf1755941f16",
866 "operationState": "STARTING",
867 "stateEnteredTime": "2018-07-09",
868 "startTime": "2018-07-09",
869 "vnfInstanceId": "cd552c9c-ab6f-11e8-b354-236c32aa91a1",
871 "operation": "SCALE",
872 "isAutomaticInvocation": False,
873 "isCancelPending": False,
879 "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"