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',
101 "name": "underlayervpn",
102 "csarVersion": "1.0",
104 "csarProvider": "huawei",
107 "id": "ns_underlayervpn_1_0"
111 "id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
112 "type_name": "tosca.nodes.sdn.l3ac",
113 "template_name": "ac2",
116 "type_name": "string"
119 "type_name": "string"
122 "type_name": "string"
125 "type_name": "string"
131 "type_name": "tosca.interfaces.node.lifecycle.Standard"
137 "type_name": "tosca.capabilities.Node"
141 "type_name": "tosca.capabilities.sdn.ac"
146 "target_node_id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
147 "target_capability_name": "feature"
150 "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
151 "target_capability_name": "feature"
156 "id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
157 "type_name": "tosca.nodes.sdn.l3ac",
158 "template_name": "ac1",
161 "type_name": "string"
164 "type_name": "string"
167 "type_name": "string"
170 "type_name": "string"
176 "type_name": "tosca.interfaces.node.lifecycle.Standard"
182 "type_name": "tosca.capabilities.Node"
186 "type_name": "tosca.capabilities.sdn.ac"
191 "target_node_id": "pe1_e58ekps6m45g6w9egs9lue2j7",
192 "target_capability_name": "feature"
195 "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
196 "target_capability_name": "feature"
201 "id": "vpn_ie0xim076f7cje67fvrrq9tg1",
202 "type_name": "tosca.nodes.sdn.underlayVPN",
203 "template_name": "vpn",
206 "type_name": "string"
209 "type_name": "string"
212 "type_name": "string"
215 "type_name": "string"
221 "type_name": "tosca.interfaces.node.lifecycle.Standard"
227 "type_name": "tosca.capabilities.Node"
232 "target_node_id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
233 "target_capability_name": "feature"
236 "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
237 "target_capability_name": "feature"
242 "id": "pe1_e58ekps6m45g6w9egs9lue2j7",
243 "type_name": "tosca.nodes.sdn.l3pe",
244 "template_name": "pe1",
247 "type_name": "string"
253 "type_name": "tosca.interfaces.node.lifecycle.Standard"
259 "type_name": "tosca.capabilities.Node"
263 "type_name": "tosca.capabilities.sdn.pe"
268 "id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
269 "type_name": "tosca.nodes.sdn.l3pe",
270 "template_name": "pe2",
273 "type_name": "string"
279 "type_name": "tosca.interfaces.node.lifecycle.Standard"
285 "type_name": "tosca.capabilities.Node"
289 "type_name": "tosca.capabilities.sdn.pe"
295 "node_type_name": "tosca.nodes.sdn.ext.NS.ns_underlayervpn"
299 "type_name": "string",
300 "description": "ac2_ipofunderlayvpn"
303 "type_name": "string",
304 "description": "ac2_routeofunderlayvpn"
307 "type_name": "string",
308 "description": "serviceTypeofunderlayvpn"
311 "type_name": "string",
312 "description": "descriptionofunderlayvpn"
315 "type_name": "string",
316 "description": "pe2_idofunderlayvpn"
319 "type_name": "string",
320 "description": "ac1_routeofunderlayvpn"
323 "type_name": "integer",
324 "description": "ac1_svlanofunderlayvpn"
327 "type_name": "string",
328 "description": "Nameofunderlayervpn"
331 "type_name": "string",
332 "description": "ac1_ipofunderlayvpn"
335 "type_name": "string",
336 "description": "ac2_portofunderlayvpn"
339 "type_name": "string",
340 "description": "pe1_idofunderlayvpn"
343 "type_name": "string",
344 "description": "technologyofunderlayvpn"
347 "type_name": "string",
348 "description": "ac1_portofunderlayvpn"
351 "type_name": "integer",
352 "description": "ac2_svlanofunderlayvpn"
355 "type_name": "string",
356 "description": "topologyofunderlayvpn"
369 'domain_type': u'CN',
370 'version': u'v4.14.10',
371 'vmnumber_overquota_alarm': False,
374 'vnfd_version': u'V00000001',
375 'id': u'sss-vnf-template',
376 'name': u'sss-vnf-template'
381 "description": "vdu description",
383 "name": "vduinstname",
386 "support_scaling": True,
389 "tenant": "tenantname",
390 "availability_zone": "zone1",
393 "local_affinity_antiaffinity_rule": [
395 "affinity_antiaffinity": "anti-affinity",
399 "affinity_antiaffinity": "affinity",
403 "inject_data_list": [
405 "file_name": "abc.xml",
406 "file_data": "<a>xxx</a><b>ssss</b>"
409 "storage_policy": "HIGH",
411 "manual_scale_select_vim": False,
413 "enabledelay": 600000,
416 "is_predefined": False,
417 "allow_scale_updown": False,
418 "inject_network_address": True,
419 "inner_hugepage_num": 100,
420 "inner_hugepage_size": "2048",
423 "image_file": u'sss',
430 "volume_storage_id": "volume_storage1",
431 "location": "/usr/data",
432 "device": "/dev/hda1"
442 "cpu_frequency": "1GHz",
443 "flavor_extra_specs": {
444 "hw: cpu_policy": "shared",
445 "hw: cpu_max_threads": 50,
446 "hw: cpu_sockets": 10,
447 "hw: cpu_max_sockets": 20,
448 "hw: cpu_max_cores": 8,
449 "hw: cpu_threads": 30,
450 "hw: numa_mem.0": 12288,
451 "hw: hugepage_num": 100,
452 "hw: high_performance": "dvs_high",
454 "hw: numa_cpus.0": "2,4,8",
455 "hw: numa_pci": True,
457 "pci_passthrough: alias": "ColetoCreek: 1",
458 "hw: mem_page_size": "large",
459 "hw: mem_paging_mechanism": "EPT"
471 "default_instances": 1
476 "implementation": "<implementationScript>",
478 "param1Name": "value1",
479 "paramNName": "valueN"
483 "implementation": "<implementationScript>",
485 "param1Name": "value1",
486 "paramNName": "valueN"
490 "implementation": "<implementationScript>",
492 "param1Name": "value1",
493 "paramNName": "valueN"
497 "implementation": "<implementationScript>",
499 "param1Name": "value1",
500 "paramNName": "valueN"
504 "implementation": "<implementationScript>",
506 "param1Name": "value1",
507 "paramNName": "valueN"
514 "artifact_name": "software_version_file",
515 "type": "tosca.artifacts.Deployment",
516 "file": "AppSoftwares/zte-cn-xgw-V5.16.11_NFV-version.zip",
525 "volume_storage_id": "volume_storage1",
530 "volume_name": "volumeStorage1",
531 "custom_volume_type": "type1",
533 "delete_on_termination_vm": True,
536 "tenant": "tenantname_1",
537 "availability_zone": "zone1"
539 "is_predefined": False,
552 'policy_id': u'policy_scale_sss-vnf-template',
554 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
563 'name': u'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
565 'disk_format': u'VMDK',
566 'file_url': u'./zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
567 'container_type': 'vm',
569 'hypervisor_type': 'kvm'
571 'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'
578 'disk_format': u'VMDK',
579 'file_url': u'./zte-cn-sss-main-image/NE/sss.vmdk',
580 'container_type': 'vm',
582 'hypervisor_type': 'kvm'
584 'image_file_id': u'sss'
592 "name": "umac_241_control",
593 "network_name": "umac_control",
594 "is_predefined": False,
596 "netmask": "255.255.255.0",
598 "network_type": "vlan",
599 "physical_network": "phynet01",
600 "segmentation_id": "30",
601 "vlan_transparent": False,
603 "cidr": "192.168.199.0/24",
605 "gateway_ip": "192.168.199.1",
606 "dhcp_enabled": False,
611 "start_ip": "192.168.199.2",
612 "end_ip": "192.168.199.254",
615 "destination": "10.43.26.0/24",
616 "nexthop": "10.41.23.1"
621 "tenant": "tenantname_1"
625 "route_id": "router01",
626 "route_external": False
635 "mac_address": "00:d9:00:82:11:e1",
636 "ip_address:": "192.168.1.21",
637 "ip_range_start": "192.168.1.20",
638 "ip_range_end": "192.168.1.29",
639 "floating_ip_address": {
640 "external_network": "extnet01",
641 "ip_address": "10.43.53.23"
643 "service_ip_address": "192.168.1.23",
646 "vnic_type": "normal",
647 "allowed_address_pairs": [
649 "ip": "192.168.1.13",
650 "mac": "00:f3:43:20:a2:a3"
655 "macbond": "00:d9:00:82:11:d1",
656 "sfc_encapsulation": "",
658 "gateway_ip": "192.168.199.1",
659 "netmask": "255.255.255.0",
660 "interface_name": "fe-01-02",
662 "function": "control"
674 c1_data_get_tenant_id = {
678 "name": "tenantname_1"
684 c2_data_create_volume = {
685 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
688 "vimId": "vim_volume_1",
689 "vimName": "vim_volume_1",
690 "tenantId": "vim_volume_1",
692 "availabilityZone": "availabilityZone",
693 "status": "availuable",
694 "createTime": "2015-12-02T06:39:40.000000",
700 c3_data_get_volume = {
701 "status": "available",
705 "device": "/dev/vdc",
706 "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
707 "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
709 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
712 "createTime": "2015-12-02T06:39:40.000000",
714 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
719 c4_data_create_network = {
724 "id": "3c9eebdbbfd345658269340b9ea6fb73",
726 "tenantId": "tenant1",
727 "networkName": "ommnet",
729 "vlanTransparent": True,
730 "networkType": "vlan",
731 "segmentationId": 202,
732 "physicalNetwork": "ctrl",
733 "routerExternal": False
737 c5_data_create_subnet = {
742 "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
743 "tenantId": "tenant1",
744 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
745 "networkName": "networkName",
747 "cidr": "10.43.35.0/24",
750 "gatewayIp": "10.43.35.1",
751 "dnsNameservers": [],
754 "start": "192.168.199.2",
755 "end": "192.168.199.254"
762 c6_data_create_port = {
767 "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
768 "tenantId": "tenant1",
770 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
771 "networkName": "networkName",
772 "subnetId": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
773 "subnetName": "subnet1",
774 "macAddress": "212.12.61.23",
776 "vnicType": "normal",
781 c7_data_create_flavor = {
785 "id": "142019d3-bc6e-4319-9c1d-6722fc136afg",
786 "tenantId": "tenant1",
794 "extraSpecs": "testtt"
798 c8_data_list_image = {
804 "id": "5e2757c1-f846-4727-915c-9a872553ed75",
812 c9_data_create_vm = {
814 "id": "3c9eebdbbfd345658269340b9ea6fb73",
818 "tenantId": "tenant1",
821 "volumeArray": "dfdf",
822 "availabilityZone": "fdvfdv",
823 "flavorId": "fdvfdv",
824 "metadata": "fdvfdv",
825 "securityGroups": "fdvfdv",
826 "serverGroup": "fdvfdv",
833 "id": "3c9eebdbbfd345658269340b9ea6fb73",
837 "tenantId": "tenant1",