1 # Copyright 2017 ZTE Corporation.
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 from lcm.pub.utils.jobutil import enum
18 VNF_STATUS = enum(NULL='null', INSTANTIATING="instantiating", INACTIVE='inactive', ACTIVE="active",
19 FAILED="failed", TERMINATING="terminating", SCALING="scaling", OPERATING="operating",
20 UPDATING="updating", HEALING="healing")
22 RESOURCE_MAP = {'Storage': 'volumn', 'Network': 'network', 'SubNetwork': 'subnet', 'Port': 'port',
23 'Flavour': 'flavor', 'Vm': 'vm'}
26 "flavourId": "flavour_1",
27 "instantiationLevelId": "instantiationLevel_1",
38 "protocolType": "http"
41 "tenant": "tenant_vCPE",
43 "password": "vCPE_321"
45 "interfaceEndpoint": "http://10.43.21.105:80/"
54 "l2AddressData": "00:f3:43:20:a2:a3"
59 "iPAddressType": "IPv4",
60 "iPAddress": "192.168.104.2"
64 "numDynamicAddresses": 0
70 "resourceId": '55_network',
71 "resourceSubnetId": '55_subnet',
78 "localizationLanguage": "en_US",
88 "resourceId": '55_network',
89 "resourceSubnetId": '55_subnet',
105 'domain_type': u'CN',
106 'version': u'v4.14.10',
107 'vmnumber_overquota_alarm': False,
110 'vnfd_version': u'V00000001',
111 'id': u'sss-vnf-template',
112 'name': u'sss-vnf-template'
117 "description": "vdu description",
119 "name": "vduinstname",
122 "support_scaling": True,
125 "tenant": "tenantname",
126 "availability_zone": "zone1",
129 "local_affinity_antiaffinity_rule": [
131 "affinity_antiaffinity": "anti-affinity",
135 "affinity_antiaffinity": "affinity",
139 "inject_data_list": [
141 "file_name": "abc.xml",
142 "file_data": "<a>xxx</a><b>ssss</b>"
145 "storage_policy": "HIGH",
147 "manual_scale_select_vim": False,
149 "enabledelay": 600000,
152 "is_predefined": False,
153 "allow_scale_updown": False,
154 "inject_network_address": True,
155 "inner_hugepage_num": 100,
156 "inner_hugepage_size": "2048",
159 "image_file": u'sss',
166 "volume_storage_id": "volume_storage1",
167 "location": "/usr/data",
168 "device": "/dev/hda1"
178 "cpu_frequency": "1GHz",
179 "flavor_extra_specs": {
180 "hw: cpu_policy": "shared",
181 "hw: cpu_max_threads": 50,
182 "hw: cpu_sockets": 10,
183 "hw: cpu_max_sockets": 20,
184 "hw: cpu_max_cores": 8,
185 "hw: cpu_threads": 30,
186 "hw: numa_mem.0": 12288,
187 "hw: hugepage_num": 100,
188 "hw: high_performance": "dvs_high",
190 "hw: numa_cpus.0": "2,4,8",
191 "hw: numa_pci": True,
193 "pci_passthrough: alias": "ColetoCreek: 1",
194 "hw: mem_page_size": "large",
195 "hw: mem_paging_mechanism": "EPT"
207 "default_instances": 1
212 "implementation": "<implementationScript>",
214 "param1Name": "value1",
215 "paramNName": "valueN"
219 "implementation": "<implementationScript>",
221 "param1Name": "value1",
222 "paramNName": "valueN"
226 "implementation": "<implementationScript>",
228 "param1Name": "value1",
229 "paramNName": "valueN"
233 "implementation": "<implementationScript>",
235 "param1Name": "value1",
236 "paramNName": "valueN"
240 "implementation": "<implementationScript>",
242 "param1Name": "value1",
243 "paramNName": "valueN"
250 "artifact_name": "software_version_file",
251 "type": "tosca.artifacts.Deployment",
252 "file": "AppSoftwares/zte-cn-xgw-V5.16.11_NFV-version.zip",
261 "volume_storage_id": "volume_storage1",
266 "volume_name": "volumeStorage1",
267 "custom_volume_type": "type1",
269 "delete_on_termination_vm": True,
272 "tenant": "tenantname_1",
273 "availability_zone": "zone1"
275 "is_predefined": False,
288 'policy_id': u'policy_scale_sss-vnf-template',
290 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
299 'name': u'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
301 'disk_format': u'VMDK',
302 'file_url': u'./zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
303 'container_type': 'vm',
305 'hypervisor_type': 'kvm'
307 'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'
314 'disk_format': u'VMDK',
315 'file_url': u'./zte-cn-sss-main-image/NE/sss.vmdk',
316 'container_type': 'vm',
318 'hypervisor_type': 'kvm'
320 'image_file_id': u'sss'
328 "name": "umac_241_control",
329 "network_name": "umac_control",
330 "is_predefined": False,
332 "netmask": "255.255.255.0",
334 "network_type": "vlan",
335 "physical_network": "phynet01",
336 "segmentation_id": "30",
337 "vlan_transparent": False,
339 "cidr": "192.168.199.0/24",
341 "gateway_ip": "192.168.199.1",
342 "dhcp_enabled": False,
347 "start_ip": "192.168.199.2",
348 "end_ip": "192.168.199.254",
351 "destination": "10.43.26.0/24",
352 "nexthop": "10.41.23.1"
357 "tenant": "tenantname_1"
361 "route_id": "router01",
362 "route_external": False
371 "mac_address": "00:d9:00:82:11:e1",
372 "ip_address:": "192.168.1.21",
373 "ip_range_start": "192.168.1.20",
374 "ip_range_end": "192.168.1.29",
375 "floating_ip_address": {
376 "external_network": "extnet01",
377 "ip_address": "10.43.53.23"
379 "service_ip_address": "192.168.1.23",
382 "vnic_type": "normal",
383 "allowed_address_pairs": [
385 "ip": "192.168.1.13",
386 "mac": "00:f3:43:20:a2:a3"
391 "macbond": "00:d9:00:82:11:d1",
392 "sfc_encapsulation": "",
394 "gateway_ip": "192.168.199.1",
395 "netmask": "255.255.255.0",
396 "interface_name": "fe-01-02",
398 "function": "control"
410 c1_data_get_tenant_id = {
414 "name": "tenantname_1"
420 c2_data_create_volume = {
421 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
424 "vimId": "vim_volume_1",
425 "vimName": "vim_volume_1",
426 "tenantId": "vim_volume_1",
428 "availabilityZone": "availabilityZone",
429 "status": "availuable",
430 "createTime": "2015-12-02T06:39:40.000000",
436 c3_data_get_volume = {
437 "status": "available",
441 "device": "/dev/vdc",
442 "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
443 "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
445 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
448 "createTime": "2015-12-02T06:39:40.000000",
450 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
455 c4_data_create_network = {
460 "id": "3c9eebdbbfd345658269340b9ea6fb73",
462 "tenantId": "tenant1",
463 "networkName": "ommnet",
465 "vlanTransparent": True,
466 "networkType": "vlan",
467 "segmentationId": 202,
468 "physicalNetwork": "ctrl",
469 "routerExternal": False
473 c5_data_create_subnet = {
478 "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
479 "tenantId": "tenant1",
480 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
481 "networkName": "networkName",
483 "cidr": "10.43.35.0/24",
486 "gatewayIp": "10.43.35.1",
487 "dnsNameservers": [],
490 "start": "192.168.199.2",
491 "end": "192.168.199.254"
498 c6_data_create_port = {
503 "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
504 "tenantId": "tenant1",
506 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
507 "networkName": "networkName",
508 "subnetId": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
509 "subnetName": "subnet1",
510 "macAddress": "212.12.61.23",
512 "vnicType": "normal",
517 c7_data_create_flavor = {
521 "id": "142019d3-bc6e-4319-9c1d-6722fc136afg",
522 "tenantId": "tenant1",
530 "extraSpecs": "testtt"
534 c8_data_list_image = {
540 "id": "5e2757c1-f846-4727-915c-9a872553ed75",
548 c9_data_create_vm = {
550 "id": "3c9eebdbbfd345658269340b9ea6fb73",
554 "tenantId": "tenant1",
557 "volumeArray": "dfdf",
558 "availabilityZone": "fdvfdv",
559 "flavorId": "fdvfdv",
560 "metadata": "fdvfdv",
561 "securityGroups": "fdvfdv",
562 "serverGroup": "fdvfdv",
569 "id": "3c9eebdbbfd345658269340b9ea6fb73",
573 "tenantId": "tenant1",
578 "volume_storages": [],
582 "description": "pe1_idofunderlayvpn"
586 "description": "pe2_idofunderlayvpn"
590 "description": "serviceTypeofunderlayvpn"
594 "description": "descriptionofunderlayvpn"
598 "description": "ac2_routeofunderlayvpn"
602 "description": "ac1_routeofunderlayvpn"
606 "description": "ac1_svlanofunderlayvpn"
610 "description": "ac2_ipofunderlayvpn"
614 "description": "ac1_ipofunderlayvpn"
618 "description": "ac2_portofunderlayvpn"
622 "description": "topologyofunderlayvpn"
626 "description": "technologyofunderlayvpn"
630 "description": "ac1_portofunderlayvpn"
634 "description": "ac2_svlanofunderlayvpn"
638 "description": "Nameofunderlayervpn"
644 "local_storages": [],
653 "name": "underlayervpn",
654 "csarVersion": "1.0",
656 "csarProvider": "huawei",
659 "id": "ns_underlayervpn_1_0"
665 "csarId": "vOpenNAT",
667 "csarName": "vOpenNAT.csar",
668 "vnfdModel": json.dumps(vnfdModel),
669 "vnfdProvider": "Intel",
670 "vnfdId": "openNAT_1.0",
671 "downloadUrl": "http://10.96.33.39:8806/static/catalog/vOpenNAT/vOpenNAT.csar",
672 "vnfVersion": "v1.0",
673 "vnfdVersion": "v1.0",
674 "vnfPackageId": "vOpenNAT"
683 # "designer": "sdno",
684 # "name": "underlayervpn",
685 # "csarVersion": "1.0",
686 # "csarType": "SSAR",
687 # "csarProvider": "huawei",
690 # "id": "ns_underlayervpn_1_0"
694 # "id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
695 # "type_name": "tosca.nodes.sdn.l3ac",
696 # "template_name": "ac2",
699 # "type_name": "string"
702 # "type_name": "string"
705 # "type_name": "string"
708 # "type_name": "string"
713 # "name": "Standard",
714 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
720 # "type_name": "tosca.capabilities.Node"
724 # "type_name": "tosca.capabilities.sdn.ac"
729 # "target_node_id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
730 # "target_capability_name": "feature"
733 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
734 # "target_capability_name": "feature"
739 # "id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
740 # "type_name": "tosca.nodes.sdn.l3ac",
741 # "template_name": "ac1",
744 # "type_name": "string"
747 # "type_name": "string"
750 # "type_name": "string"
753 # "type_name": "string"
758 # "name": "Standard",
759 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
765 # "type_name": "tosca.capabilities.Node"
769 # "type_name": "tosca.capabilities.sdn.ac"
774 # "target_node_id": "pe1_e58ekps6m45g6w9egs9lue2j7",
775 # "target_capability_name": "feature"
778 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
779 # "target_capability_name": "feature"
784 # "id": "vpn_ie0xim076f7cje67fvrrq9tg1",
785 # "type_name": "tosca.nodes.sdn.underlayVPN",
786 # "template_name": "vpn",
789 # "type_name": "string"
792 # "type_name": "string"
795 # "type_name": "string"
798 # "type_name": "string"
803 # "name": "Standard",
804 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
810 # "type_name": "tosca.capabilities.Node"
815 # "target_node_id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
816 # "target_capability_name": "feature"
819 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
820 # "target_capability_name": "feature"
825 # "id": "pe1_e58ekps6m45g6w9egs9lue2j7",
826 # "type_name": "tosca.nodes.sdn.l3pe",
827 # "template_name": "pe1",
830 # "type_name": "string"
835 # "name": "Standard",
836 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
842 # "type_name": "tosca.capabilities.Node"
846 # "type_name": "tosca.capabilities.sdn.pe"
851 # "id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
852 # "type_name": "tosca.nodes.sdn.l3pe",
853 # "template_name": "pe2",
856 # "type_name": "string"
861 # "name": "Standard",
862 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
868 # "type_name": "tosca.capabilities.Node"
872 # "type_name": "tosca.capabilities.sdn.pe"
878 # "node_type_name": "tosca.nodes.sdn.ext.NS.ns_underlayervpn"
882 # "type_name": "string",
883 # "description": "ac2_ipofunderlayvpn"
886 # "type_name": "string",
887 # "description": "ac2_routeofunderlayvpn"
890 # "type_name": "string",
891 # "description": "serviceTypeofunderlayvpn"
894 # "type_name": "string",
895 # "description": "descriptionofunderlayvpn"
898 # "type_name": "string",
899 # "description": "pe2_idofunderlayvpn"
902 # "type_name": "string",
903 # "description": "ac1_routeofunderlayvpn"
906 # "type_name": "integer",
907 # "description": "ac1_svlanofunderlayvpn"
910 # "type_name": "string",
911 # "description": "Nameofunderlayervpn"
914 # "type_name": "string",
915 # "description": "ac1_ipofunderlayvpn"
918 # "type_name": "string",
919 # "description": "ac2_portofunderlayvpn"
922 # "type_name": "string",
923 # "description": "pe1_idofunderlayvpn"
926 # "type_name": "string",
927 # "description": "technologyofunderlayvpn"
930 # "type_name": "string",
931 # "description": "ac1_portofunderlayvpn"
934 # "type_name": "integer",
935 # "description": "ac2_svlanofunderlayvpn"
938 # "type_name": "string",
939 # "description": "topologyofunderlayvpn"