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")
22 "flavourId": "flavour_1",
23 "instantiationLevelId": "instantiationLevel_1",
33 "protocolType": "http"
36 "tenant": "tenant_vCPE",
38 "password": "vCPE_321"
40 "interfaceEndpoint": "http://10.43.21.105:80/"
49 "l2AddressData": "00:f3:43:20:a2:a3"
54 "iPAddressType": "IPv4",
55 "iPAddress": "192.168.104.2"
59 "numDynamicAddresses": 0
65 "resourceId": '55_network',
66 "resourceSubnetId": '55_subnet',
73 "localizationLanguage": "en_US",
82 "resourceId": '55_network',
83 "resourceSubnetId": '55_subnet',
99 'version': u'v4.14.10',
100 'vmnumber_overquota_alarm': False,
103 'vnfd_version': u'V00000001',
104 'id': u'sss-vnf-template',
105 'name': u'sss-vnf-template'
110 "description": "vdu description",
112 "name": "vduinstname",
115 "support_scaling": True,
118 "tenant": "tenantname",
119 "availability_zone": "zone1",
122 "local_affinity_antiaffinity_rule": [
124 "affinity_antiaffinity": "anti-affinity",
128 "affinity_antiaffinity": "affinity",
132 "inject_data_list": [
134 "file_name": "abc.xml",
135 "file_data": "<a>xxx</a><b>ssss</b>"
138 "storage_policy": "HIGH",
140 "manual_scale_select_vim": False,
142 "enabledelay": 600000,
145 "is_predefined": False,
146 "allow_scale_updown": False,
147 "inject_network_address": True,
148 "inner_hugepage_num": 100,
149 "inner_hugepage_size": "2048",
152 "image_file": u'sss',
159 "volume_storage_id": "volume_storage1",
160 "location": "/usr/data",
161 "device": "/dev/hda1"
171 "cpu_frequency": "1GHz",
172 "flavor_extra_specs": {
173 "hw: cpu_policy": "shared",
174 "hw: cpu_max_threads": 50,
175 "hw: cpu_sockets": 10,
176 "hw: cpu_max_sockets": 20,
177 "hw: cpu_max_cores": 8,
178 "hw: cpu_threads": 30,
179 "hw: numa_mem.0": 12288,
180 "hw: hugepage_num": 100,
181 "hw: high_performance": "dvs_high",
183 "hw: numa_cpus.0": "2,4,8",
184 "hw: numa_pci": True,
186 "pci_passthrough: alias": "ColetoCreek: 1",
187 "hw: mem_page_size": "large",
188 "hw: mem_paging_mechanism": "EPT"
200 "default_instances": 1
205 "implementation": "<implementationScript>",
207 "param1Name": "value1",
208 "paramNName": "valueN"
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"
243 "artifact_name": "software_version_file",
244 "type": "tosca.artifacts.Deployment",
245 "file": "AppSoftwares/zte-cn-xgw-V5.16.11_NFV-version.zip",
254 "volume_storage_id": "volume_storage1",
259 "volume_name": "volumeStorage1",
260 "custom_volume_type": "type1",
262 "delete_on_termination_vm": True,
265 "tenant": "tenantname_1",
266 "availability_zone": "zone1"
268 "is_predefined": False,
281 'policy_id': u'policy_scale_sss-vnf-template',
283 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
292 'name': u'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
294 'disk_format': u'VMDK',
295 'file_url': u'./zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
296 'container_type': 'vm',
298 'hypervisor_type': 'kvm'
300 'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'
307 'disk_format': u'VMDK',
308 'file_url': u'./zte-cn-sss-main-image/NE/sss.vmdk',
309 'container_type': 'vm',
311 'hypervisor_type': 'kvm'
313 'image_file_id': u'sss'
321 "name": "umac_241_control",
322 "network_name": "umac_control",
323 "is_predefined": False,
325 "netmask": "255.255.255.0",
327 "network_type": "vlan",
328 "physical_network": "phynet01",
329 "segmentation_id": "30",
330 "vlan_transparent": False,
332 "cidr": "192.168.199.0/24",
334 "gateway_ip": "192.168.199.1",
335 "dhcp_enabled": False,
340 "start_ip": "192.168.199.2",
341 "end_ip": "192.168.199.254",
344 "destination": "10.43.26.0/24",
345 "nexthop": "10.41.23.1"
350 "tenant": "tenantname_1"
354 "route_id": "router01",
355 "route_external": False
364 "mac_address": "00:d9:00:82:11:e1",
365 "ip_address:": "192.168.1.21",
366 "ip_range_start": "192.168.1.20",
367 "ip_range_end": "192.168.1.29",
368 "floating_ip_address": {
369 "external_network": "extnet01",
370 "ip_address": "10.43.53.23"
372 "service_ip_address": "192.168.1.23",
375 "vnic_type": "normal",
376 "allowed_address_pairs": [
378 "ip": "192.168.1.13",
379 "mac": "00:f3:43:20:a2:a3"
384 "macbond": "00:d9:00:82:11:d1",
385 "sfc_encapsulation": "",
387 "gateway_ip": "192.168.199.1",
388 "netmask": "255.255.255.0",
389 "interface_name": "fe-01-02",
391 "function": "control"
403 c1_data_get_tenant_id = {
407 "name": "tenantname_1"
413 c2_data_create_volume = {
414 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
417 "vimId": "vim_volume_1",
418 "vimName": "vim_volume_1",
419 "tenantId": "vim_volume_1",
421 "availabilityZone": "availabilityZone",
422 "status": "availuable",
423 "createTime": "2015-12-02T06:39:40.000000",
429 c3_data_get_volume = {
430 "status": "available",
434 "device": "/dev/vdc",
435 "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
436 "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
438 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
441 "createTime": "2015-12-02T06:39:40.000000",
443 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
448 c4_data_create_network = {
453 "id": "3c9eebdbbfd345658269340b9ea6fb73",
455 "tenantId": "tenant1",
456 "networkName": "ommnet",
458 "vlanTransparent": True,
459 "networkType": "vlan",
460 "segmentationId": 202,
461 "physicalNetwork": "ctrl",
462 "routerExternal": False
466 c5_data_create_subnet = {
471 "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
472 "tenantId": "tenant1",
473 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
474 "networkName": "networkName",
476 "cidr": "10.43.35.0/24",
479 "gatewayIp": "10.43.35.1",
480 "dnsNameservers": [],
483 "start": "192.168.199.2",
484 "end": "192.168.199.254"
491 c6_data_create_port = {
496 "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
497 "tenantId": "tenant1",
499 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
500 "networkName": "networkName",
501 "subnetId": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
502 "subnetName": "subnet1",
503 "macAddress": "212.12.61.23",
505 "vnicType": "normal",
510 c7_data_create_flavor = {
514 "id": "142019d3-bc6e-4319-9c1d-6722fc136afg",
515 "tenantId": "tenant1",
523 "extraSpecs": "testtt"
527 c8_data_list_image = {
533 "id": "5e2757c1-f846-4727-915c-9a872553ed75",
541 c9_data_create_vm = {
543 "id": "3c9eebdbbfd345658269340b9ea6fb73",
547 "tenantId": "tenant1",
550 "volumeArray": "dfdf",
551 "availabilityZone": "fdvfdv",
552 "flavorId": "fdvfdv",
553 "metadata": "fdvfdv",
554 "securityGroups": "fdvfdv",
555 "serverGroup": "fdvfdv",
562 "id": "3c9eebdbbfd345658269340b9ea6fb73",
566 "tenantId": "tenant1",
571 "volume_storages": [],
575 "description": "pe1_idofunderlayvpn"
579 "description": "pe2_idofunderlayvpn"
583 "description": "serviceTypeofunderlayvpn"
587 "description": "descriptionofunderlayvpn"
591 "description": "ac2_routeofunderlayvpn"
595 "description": "ac1_routeofunderlayvpn"
599 "description": "ac1_svlanofunderlayvpn"
603 "description": "ac2_ipofunderlayvpn"
607 "description": "ac1_ipofunderlayvpn"
611 "description": "ac2_portofunderlayvpn"
615 "description": "topologyofunderlayvpn"
619 "description": "technologyofunderlayvpn"
623 "description": "ac1_portofunderlayvpn"
627 "description": "ac2_svlanofunderlayvpn"
631 "description": "Nameofunderlayervpn"
637 "local_storages": [],
646 "name": "underlayervpn",
647 "csarVersion": "1.0",
649 "csarProvider": "huawei",
652 "id": "ns_underlayervpn_1_0"
661 # "designer": "sdno",
662 # "name": "underlayervpn",
663 # "csarVersion": "1.0",
664 # "csarType": "SSAR",
665 # "csarProvider": "huawei",
668 # "id": "ns_underlayervpn_1_0"
672 # "id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
673 # "type_name": "tosca.nodes.sdn.l3ac",
674 # "template_name": "ac2",
677 # "type_name": "string"
680 # "type_name": "string"
683 # "type_name": "string"
686 # "type_name": "string"
691 # "name": "Standard",
692 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
698 # "type_name": "tosca.capabilities.Node"
702 # "type_name": "tosca.capabilities.sdn.ac"
707 # "target_node_id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
708 # "target_capability_name": "feature"
711 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
712 # "target_capability_name": "feature"
717 # "id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
718 # "type_name": "tosca.nodes.sdn.l3ac",
719 # "template_name": "ac1",
722 # "type_name": "string"
725 # "type_name": "string"
728 # "type_name": "string"
731 # "type_name": "string"
736 # "name": "Standard",
737 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
743 # "type_name": "tosca.capabilities.Node"
747 # "type_name": "tosca.capabilities.sdn.ac"
752 # "target_node_id": "pe1_e58ekps6m45g6w9egs9lue2j7",
753 # "target_capability_name": "feature"
756 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
757 # "target_capability_name": "feature"
762 # "id": "vpn_ie0xim076f7cje67fvrrq9tg1",
763 # "type_name": "tosca.nodes.sdn.underlayVPN",
764 # "template_name": "vpn",
767 # "type_name": "string"
770 # "type_name": "string"
773 # "type_name": "string"
776 # "type_name": "string"
781 # "name": "Standard",
782 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
788 # "type_name": "tosca.capabilities.Node"
793 # "target_node_id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
794 # "target_capability_name": "feature"
797 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
798 # "target_capability_name": "feature"
803 # "id": "pe1_e58ekps6m45g6w9egs9lue2j7",
804 # "type_name": "tosca.nodes.sdn.l3pe",
805 # "template_name": "pe1",
808 # "type_name": "string"
813 # "name": "Standard",
814 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
820 # "type_name": "tosca.capabilities.Node"
824 # "type_name": "tosca.capabilities.sdn.pe"
829 # "id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
830 # "type_name": "tosca.nodes.sdn.l3pe",
831 # "template_name": "pe2",
834 # "type_name": "string"
839 # "name": "Standard",
840 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
846 # "type_name": "tosca.capabilities.Node"
850 # "type_name": "tosca.capabilities.sdn.pe"
856 # "node_type_name": "tosca.nodes.sdn.ext.NS.ns_underlayervpn"
860 # "type_name": "string",
861 # "description": "ac2_ipofunderlayvpn"
864 # "type_name": "string",
865 # "description": "ac2_routeofunderlayvpn"
868 # "type_name": "string",
869 # "description": "serviceTypeofunderlayvpn"
872 # "type_name": "string",
873 # "description": "descriptionofunderlayvpn"
876 # "type_name": "string",
877 # "description": "pe2_idofunderlayvpn"
880 # "type_name": "string",
881 # "description": "ac1_routeofunderlayvpn"
884 # "type_name": "integer",
885 # "description": "ac1_svlanofunderlayvpn"
888 # "type_name": "string",
889 # "description": "Nameofunderlayervpn"
892 # "type_name": "string",
893 # "description": "ac1_ipofunderlayvpn"
896 # "type_name": "string",
897 # "description": "ac2_portofunderlayvpn"
900 # "type_name": "string",
901 # "description": "pe1_idofunderlayvpn"
904 # "type_name": "string",
905 # "description": "technologyofunderlayvpn"
908 # "type_name": "string",
909 # "description": "ac1_portofunderlayvpn"
912 # "type_name": "integer",
913 # "description": "ac2_svlanofunderlayvpn"
916 # "type_name": "string",
917 # "description": "topologyofunderlayvpn"