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.
15 from lcm.pub.utils.jobutil import enum
17 VNF_STATUS = enum(NULL='null', INSTANTIATING="instantiating", INACTIVE='inactive', ACTIVE="active",
18 FAILED="failed", TERMINATING="terminating", SCALING="scaling", OPERATING="operating",
19 UPDATING="updating", HEALING="healing")
23 "flavourId": "flavour_1",
24 "instantiationLevelId": "instantiationLevel_1",
34 "protocolType": "http"
37 "tenant": "tenant_vCPE",
39 "password": "vCPE_321"
41 "interfaceEndpoint": "http://10.43.21.105:80/"
50 "l2AddressData": "00:f3:43:20:a2:a3"
55 "iPAddressType": "IPv4",
56 "iPAddress": "192.168.104.2"
60 "numDynamicAddresses": 0
66 "resourceId": '55_network',
67 "resourceSubnetId": '55_subnet',
74 "localizationLanguage": "en_US",
83 "resourceId": '55_network',
84 "resourceSubnetId": '55_subnet',
100 'domain_type': u'CN',
101 'version': u'v4.14.10',
102 'vmnumber_overquota_alarm': False,
105 'vnfd_version': u'V00000001',
106 'id': u'sss-vnf-template',
107 'name': u'sss-vnf-template'
112 "description": "vdu description",
114 "name": "vduinstname",
117 "support_scaling": True,
120 "tenant": "tenantname",
121 "availability_zone": "zone1",
124 "local_affinity_antiaffinity_rule": [
126 "affinity_antiaffinity": "anti-affinity",
130 "affinity_antiaffinity": "affinity",
134 "inject_data_list": [
136 "file_name": "abc.xml",
137 "file_data": "<a>xxx</a><b>ssss</b>"
140 "storage_policy": "HIGH",
142 "manual_scale_select_vim": False,
144 "enabledelay": 600000,
147 "is_predefined": False,
148 "allow_scale_updown": False,
149 "inject_network_address": True,
150 "inner_hugepage_num": 100,
151 "inner_hugepage_size": "2048",
154 "image_file": u'sss',
161 "volume_storage_id": "volume_storage1",
162 "location": "/usr/data",
163 "device": "/dev/hda1"
173 "cpu_frequency": "1GHz",
174 "flavor_extra_specs": {
175 "hw: cpu_policy": "shared",
176 "hw: cpu_max_threads": 50,
177 "hw: cpu_sockets": 10,
178 "hw: cpu_max_sockets": 20,
179 "hw: cpu_max_cores": 8,
180 "hw: cpu_threads": 30,
181 "hw: numa_mem.0": 12288,
182 "hw: hugepage_num": 100,
183 "hw: high_performance": "dvs_high",
185 "hw: numa_cpus.0": "2,4,8",
186 "hw: numa_pci": True,
188 "pci_passthrough: alias": "ColetoCreek: 1",
189 "hw: mem_page_size": "large",
190 "hw: mem_paging_mechanism": "EPT"
202 "default_instances": 1
207 "implementation": "<implementationScript>",
209 "param1Name": "value1",
210 "paramNName": "valueN"
214 "implementation": "<implementationScript>",
216 "param1Name": "value1",
217 "paramNName": "valueN"
221 "implementation": "<implementationScript>",
223 "param1Name": "value1",
224 "paramNName": "valueN"
228 "implementation": "<implementationScript>",
230 "param1Name": "value1",
231 "paramNName": "valueN"
235 "implementation": "<implementationScript>",
237 "param1Name": "value1",
238 "paramNName": "valueN"
245 "artifact_name": "software_version_file",
246 "type": "tosca.artifacts.Deployment",
247 "file": "AppSoftwares/zte-cn-xgw-V5.16.11_NFV-version.zip",
256 "volume_storage_id": "volume_storage1",
261 "volume_name": "volumeStorage1",
262 "custom_volume_type": "type1",
264 "delete_on_termination_vm": True,
267 "tenant": "tenantname_1",
268 "availability_zone": "zone1"
270 "is_predefined": False,
283 'policy_id': u'policy_scale_sss-vnf-template',
285 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
294 'name': u'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
296 'disk_format': u'VMDK',
297 'file_url': u'./zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
298 'container_type': 'vm',
300 'hypervisor_type': 'kvm'
302 'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'
309 'disk_format': u'VMDK',
310 'file_url': u'./zte-cn-sss-main-image/NE/sss.vmdk',
311 'container_type': 'vm',
313 'hypervisor_type': 'kvm'
315 'image_file_id': u'sss'
323 "name": "umac_241_control",
324 "network_name": "umac_control",
325 "is_predefined": False,
327 "netmask": "255.255.255.0",
329 "network_type": "vlan",
330 "physical_network": "phynet01",
331 "segmentation_id": "30",
332 "vlan_transparent": False,
334 "cidr": "192.168.199.0/24",
336 "gateway_ip": "192.168.199.1",
337 "dhcp_enabled": False,
342 "start_ip": "192.168.199.2",
343 "end_ip": "192.168.199.254",
346 "destination": "10.43.26.0/24",
347 "nexthop": "10.41.23.1"
352 "tenant": "tenantname_1"
356 "route_id": "router01",
357 "route_external": False
366 "mac_address": "00:d9:00:82:11:e1",
367 "ip_address:": "192.168.1.21",
368 "ip_range_start": "192.168.1.20",
369 "ip_range_end": "192.168.1.29",
370 "floating_ip_address": {
371 "external_network": "extnet01",
372 "ip_address": "10.43.53.23"
374 "service_ip_address": "192.168.1.23",
377 "vnic_type": "normal",
378 "allowed_address_pairs": [
380 "ip": "192.168.1.13",
381 "mac": "00:f3:43:20:a2:a3"
386 "macbond": "00:d9:00:82:11:d1",
387 "sfc_encapsulation": "",
389 "gateway_ip": "192.168.199.1",
390 "netmask": "255.255.255.0",
391 "interface_name": "fe-01-02",
393 "function": "control"
405 c1_data_get_tenant_id = {
409 "name": "tenantname_1"
415 c2_data_create_volume = {
416 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
419 "vimId": "vim_volume_1",
420 "vimName": "vim_volume_1",
421 "tenantId": "vim_volume_1",
423 "availabilityZone": "availabilityZone",
424 "status": "availuable",
425 "createTime": "2015-12-02T06:39:40.000000",
431 c3_data_get_volume = {
432 "status": "available",
436 "device": "/dev/vdc",
437 "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
438 "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
440 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
443 "createTime": "2015-12-02T06:39:40.000000",
445 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
450 c4_data_create_network = {
455 "id": "3c9eebdbbfd345658269340b9ea6fb73",
457 "tenantId": "tenant1",
458 "networkName": "ommnet",
460 "vlanTransparent": True,
461 "networkType": "vlan",
462 "segmentationId": 202,
463 "physicalNetwork": "ctrl",
464 "routerExternal": False
468 c5_data_create_subnet = {
473 "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
474 "tenantId": "tenant1",
475 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
476 "networkName": "networkName",
478 "cidr": "10.43.35.0/24",
481 "gatewayIp": "10.43.35.1",
482 "dnsNameservers": [],
485 "start": "192.168.199.2",
486 "end": "192.168.199.254"
493 c6_data_create_port = {
498 "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
499 "tenantId": "tenant1",
501 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
502 "networkName": "networkName",
503 "subnetId": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
504 "subnetName": "subnet1",
505 "macAddress": "212.12.61.23",
507 "vnicType": "normal",
512 c7_data_create_flavor = {
516 "id": "142019d3-bc6e-4319-9c1d-6722fc136afg",
517 "tenantId": "tenant1",
525 "extraSpecs": "testtt"
529 c8_data_list_image = {
535 "id": "5e2757c1-f846-4727-915c-9a872553ed75",
543 c9_data_create_vm = {
545 "id": "3c9eebdbbfd345658269340b9ea6fb73",
549 "tenantId": "tenant1",
552 "volumeArray": "dfdf",
553 "availabilityZone": "fdvfdv",
554 "flavorId": "fdvfdv",
555 "metadata": "fdvfdv",
556 "securityGroups": "fdvfdv",
557 "serverGroup": "fdvfdv",
564 "id": "3c9eebdbbfd345658269340b9ea6fb73",
568 "tenantId": "tenant1",
573 "volume_storages": [],
577 "description": "pe1_idofunderlayvpn"
581 "description": "pe2_idofunderlayvpn"
585 "description": "serviceTypeofunderlayvpn"
589 "description": "descriptionofunderlayvpn"
593 "description": "ac2_routeofunderlayvpn"
597 "description": "ac1_routeofunderlayvpn"
601 "description": "ac1_svlanofunderlayvpn"
605 "description": "ac2_ipofunderlayvpn"
609 "description": "ac1_ipofunderlayvpn"
613 "description": "ac2_portofunderlayvpn"
617 "description": "topologyofunderlayvpn"
621 "description": "technologyofunderlayvpn"
625 "description": "ac1_portofunderlayvpn"
629 "description": "ac2_svlanofunderlayvpn"
633 "description": "Nameofunderlayervpn"
639 "local_storages": [],
648 "name": "underlayervpn",
649 "csarVersion": "1.0",
651 "csarProvider": "huawei",
654 "id": "ns_underlayervpn_1_0"
663 # "designer": "sdno",
664 # "name": "underlayervpn",
665 # "csarVersion": "1.0",
666 # "csarType": "SSAR",
667 # "csarProvider": "huawei",
670 # "id": "ns_underlayervpn_1_0"
674 # "id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
675 # "type_name": "tosca.nodes.sdn.l3ac",
676 # "template_name": "ac2",
679 # "type_name": "string"
682 # "type_name": "string"
685 # "type_name": "string"
688 # "type_name": "string"
693 # "name": "Standard",
694 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
700 # "type_name": "tosca.capabilities.Node"
704 # "type_name": "tosca.capabilities.sdn.ac"
709 # "target_node_id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
710 # "target_capability_name": "feature"
713 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
714 # "target_capability_name": "feature"
719 # "id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
720 # "type_name": "tosca.nodes.sdn.l3ac",
721 # "template_name": "ac1",
724 # "type_name": "string"
727 # "type_name": "string"
730 # "type_name": "string"
733 # "type_name": "string"
738 # "name": "Standard",
739 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
745 # "type_name": "tosca.capabilities.Node"
749 # "type_name": "tosca.capabilities.sdn.ac"
754 # "target_node_id": "pe1_e58ekps6m45g6w9egs9lue2j7",
755 # "target_capability_name": "feature"
758 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
759 # "target_capability_name": "feature"
764 # "id": "vpn_ie0xim076f7cje67fvrrq9tg1",
765 # "type_name": "tosca.nodes.sdn.underlayVPN",
766 # "template_name": "vpn",
769 # "type_name": "string"
772 # "type_name": "string"
775 # "type_name": "string"
778 # "type_name": "string"
783 # "name": "Standard",
784 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
790 # "type_name": "tosca.capabilities.Node"
795 # "target_node_id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
796 # "target_capability_name": "feature"
799 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
800 # "target_capability_name": "feature"
805 # "id": "pe1_e58ekps6m45g6w9egs9lue2j7",
806 # "type_name": "tosca.nodes.sdn.l3pe",
807 # "template_name": "pe1",
810 # "type_name": "string"
815 # "name": "Standard",
816 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
822 # "type_name": "tosca.capabilities.Node"
826 # "type_name": "tosca.capabilities.sdn.pe"
831 # "id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
832 # "type_name": "tosca.nodes.sdn.l3pe",
833 # "template_name": "pe2",
836 # "type_name": "string"
841 # "name": "Standard",
842 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
848 # "type_name": "tosca.capabilities.Node"
852 # "type_name": "tosca.capabilities.sdn.pe"
858 # "node_type_name": "tosca.nodes.sdn.ext.NS.ns_underlayervpn"
862 # "type_name": "string",
863 # "description": "ac2_ipofunderlayvpn"
866 # "type_name": "string",
867 # "description": "ac2_routeofunderlayvpn"
870 # "type_name": "string",
871 # "description": "serviceTypeofunderlayvpn"
874 # "type_name": "string",
875 # "description": "descriptionofunderlayvpn"
878 # "type_name": "string",
879 # "description": "pe2_idofunderlayvpn"
882 # "type_name": "string",
883 # "description": "ac1_routeofunderlayvpn"
886 # "type_name": "integer",
887 # "description": "ac1_svlanofunderlayvpn"
890 # "type_name": "string",
891 # "description": "Nameofunderlayervpn"
894 # "type_name": "string",
895 # "description": "ac1_ipofunderlayvpn"
898 # "type_name": "string",
899 # "description": "ac2_portofunderlayvpn"
902 # "type_name": "string",
903 # "description": "pe1_idofunderlayvpn"
906 # "type_name": "string",
907 # "description": "technologyofunderlayvpn"
910 # "type_name": "string",
911 # "description": "ac1_portofunderlayvpn"
914 # "type_name": "integer",
915 # "description": "ac2_svlanofunderlayvpn"
918 # "type_name": "string",
919 # "description": "topologyofunderlayvpn"