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",
27 # "vlInstanceId": "1",
34 # "protocolType": "http"
37 # "tenant": "tenant_vCPE",
39 # "password": "vCPE_321"
41 # "interfaceEndpoint": "http://10.43.21.105:80/"
43 # "resourceId": "1246",
49 # "addressType": "MAC",
50 # "l2AddressData": "00:f3:43:20:a2:a3"
53 # "addressType": "IP",
55 # "iPAddressType": "IPv4",
56 # "iPAddress": "192.168.104.2"
60 # "numDynamicAddresses": 0
66 "resourceId": '55_network',
67 "resourceSubnetId": '55_subnet',
74 "localizationLanguage": "en_US",
75 "additionalParams": {"inputs": {"key1":"test1","key2":"test2"},
78 "resourceId": '55_network',
79 "resourceSubnetId": '55_subnet',
94 "name": "underlayervpn",
97 "csarProvider": "huawei",
100 "id": "ns_underlayervpn_1_0"
104 "id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
105 "type_name": "tosca.nodes.sdn.l3ac",
106 "template_name": "ac2",
109 "type_name": "string"
112 "type_name": "string"
115 "type_name": "string"
118 "type_name": "string"
124 "type_name": "tosca.interfaces.node.lifecycle.Standard"
130 "type_name": "tosca.capabilities.Node"
134 "type_name": "tosca.capabilities.sdn.ac"
139 "target_node_id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
140 "target_capability_name": "feature"
143 "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
144 "target_capability_name": "feature"
149 "id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
150 "type_name": "tosca.nodes.sdn.l3ac",
151 "template_name": "ac1",
154 "type_name": "string"
157 "type_name": "string"
160 "type_name": "string"
163 "type_name": "string"
169 "type_name": "tosca.interfaces.node.lifecycle.Standard"
175 "type_name": "tosca.capabilities.Node"
179 "type_name": "tosca.capabilities.sdn.ac"
184 "target_node_id": "pe1_e58ekps6m45g6w9egs9lue2j7",
185 "target_capability_name": "feature"
188 "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
189 "target_capability_name": "feature"
194 "id": "vpn_ie0xim076f7cje67fvrrq9tg1",
195 "type_name": "tosca.nodes.sdn.underlayVPN",
196 "template_name": "vpn",
199 "type_name": "string"
202 "type_name": "string"
205 "type_name": "string"
208 "type_name": "string"
214 "type_name": "tosca.interfaces.node.lifecycle.Standard"
220 "type_name": "tosca.capabilities.Node"
225 "target_node_id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
226 "target_capability_name": "feature"
229 "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
230 "target_capability_name": "feature"
235 "id": "pe1_e58ekps6m45g6w9egs9lue2j7",
236 "type_name": "tosca.nodes.sdn.l3pe",
237 "template_name": "pe1",
240 "type_name": "string"
246 "type_name": "tosca.interfaces.node.lifecycle.Standard"
252 "type_name": "tosca.capabilities.Node"
256 "type_name": "tosca.capabilities.sdn.pe"
261 "id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
262 "type_name": "tosca.nodes.sdn.l3pe",
263 "template_name": "pe2",
266 "type_name": "string"
272 "type_name": "tosca.interfaces.node.lifecycle.Standard"
278 "type_name": "tosca.capabilities.Node"
282 "type_name": "tosca.capabilities.sdn.pe"
288 "node_type_name": "tosca.nodes.sdn.ext.NS.ns_underlayervpn"
292 "type_name": "string",
293 "description": "ac2_ipofunderlayvpn"
296 "type_name": "string",
297 "description": "ac2_routeofunderlayvpn"
300 "type_name": "string",
301 "description": "serviceTypeofunderlayvpn"
304 "type_name": "string",
305 "description": "descriptionofunderlayvpn"
308 "type_name": "string",
309 "description": "pe2_idofunderlayvpn"
312 "type_name": "string",
313 "description": "ac1_routeofunderlayvpn"
316 "type_name": "integer",
317 "description": "ac1_svlanofunderlayvpn"
320 "type_name": "string",
321 "description": "Nameofunderlayervpn"
324 "type_name": "string",
325 "description": "ac1_ipofunderlayvpn"
328 "type_name": "string",
329 "description": "ac2_portofunderlayvpn"
332 "type_name": "string",
333 "description": "pe1_idofunderlayvpn"
336 "type_name": "string",
337 "description": "technologyofunderlayvpn"
340 "type_name": "string",
341 "description": "ac1_portofunderlayvpn"
344 "type_name": "integer",
345 "description": "ac2_svlanofunderlayvpn"
348 "type_name": "string",
349 "description": "topologyofunderlayvpn"
362 'domain_type': u'CN',
363 'version': u'v4.14.10',
364 'vmnumber_overquota_alarm': False,
367 'vnfd_version': u'V00000001',
368 'id': u'sss-vnf-template',
369 'name': u'sss-vnf-template'
374 "description": "vdu description",
376 "name": "vduinstname",
379 "support_scaling": True,
382 "tenant": "tenantname",
383 "availability_zone": "zone1",
386 "local_affinity_antiaffinity_rule": [
388 "affinity_antiaffinity": "anti-affinity",
392 "affinity_antiaffinity": "affinity",
396 "inject_data_list": [
398 "file_name": "abc.xml",
399 "file_data": "<a>xxx</a><b>ssss</b>"
402 "storage_policy": "HIGH",
404 "manual_scale_select_vim": False,
406 "enabledelay": 600000,
409 "is_predefined": False,
410 "allow_scale_updown": False,
411 "inject_network_address": True,
412 "inner_hugepage_num": 100,
413 "inner_hugepage_size": "2048",
416 "image_file": u'sss',
423 "volume_storage_id": "volume_storage1",
424 "location": "/usr/data",
425 "device": "/dev/hda1"
435 "cpu_frequency": "1GHz",
436 "flavor_extra_specs": {
437 "hw: cpu_policy": "shared",
438 "hw: cpu_max_threads": 50,
439 "hw: cpu_sockets": 10,
440 "hw: cpu_max_sockets": 20,
441 "hw: cpu_max_cores": 8,
442 "hw: cpu_threads": 30,
443 "hw: numa_mem.0": 12288,
444 "hw: hugepage_num": 100,
445 "hw: high_performance": "dvs_high",
447 "hw: numa_cpus.0": "2,4,8",
448 "hw: numa_pci": True,
450 "pci_passthrough: alias": "ColetoCreek: 1",
451 "hw: mem_page_size": "large",
452 "hw: mem_paging_mechanism": "EPT"
464 "default_instances": 1
469 "implementation": "<implementationScript>",
471 "param1Name": "value1",
472 "paramNName": "valueN"
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"
507 "artifact_name": "software_version_file",
508 "type": "tosca.artifacts.Deployment",
509 "file": "AppSoftwares/zte-cn-xgw-V5.16.11_NFV-version.zip",
518 "volume_storage_id": "volume_storage1",
523 "volume_name": "volumeStorage1",
524 "custom_volume_type": "type1",
526 "delete_on_termination_vm": True,
529 "tenant": "tenantname_1",
530 "availability_zone": "zone1"
532 "is_predefined": False,
545 'policy_id': u'policy_scale_sss-vnf-template',
547 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
556 'name': u'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
558 'disk_format': u'VMDK',
559 'file_url': u'./zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
560 'container_type': 'vm',
562 'hypervisor_type': 'kvm'
564 'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'
571 'disk_format': u'VMDK',
572 'file_url': u'./zte-cn-sss-main-image/NE/sss.vmdk',
573 'container_type': 'vm',
575 'hypervisor_type': 'kvm'
577 'image_file_id': u'sss'
585 "name": "umac_241_control",
586 "network_name": "umac_control",
587 "is_predefined": False,
589 "netmask": "255.255.255.0",
591 "network_type": "vlan",
592 "physical_network": "phynet01",
593 "segmentation_id": "30",
594 "vlan_transparent": False,
596 "cidr": "192.168.199.0/24",
598 "gateway_ip": "192.168.199.1",
599 "dhcp_enabled": False,
604 "start_ip": "192.168.199.2",
605 "end_ip": "192.168.199.254",
608 "destination": "10.43.26.0/24",
609 "nexthop": "10.41.23.1"
614 "tenant": "tenantname_1"
618 "route_id": "router01",
619 "route_external": False
628 "mac_address": "00:d9:00:82:11:e1",
629 "ip_address:": "192.168.1.21",
630 "ip_range_start": "192.168.1.20",
631 "ip_range_end": "192.168.1.29",
632 "floating_ip_address": {
633 "external_network": "extnet01",
634 "ip_address": "10.43.53.23"
636 "service_ip_address": "192.168.1.23",
639 "vnic_type": "normal",
640 "allowed_address_pairs": [
642 "ip": "192.168.1.13",
643 "mac": "00:f3:43:20:a2:a3"
648 "macbond": "00:d9:00:82:11:d1",
649 "sfc_encapsulation": "",
651 "gateway_ip": "192.168.199.1",
652 "netmask": "255.255.255.0",
653 "interface_name": "fe-01-02",
655 "function": "control"
667 c1_data_get_tenant_id = {
671 "name": "tenantname_1"
677 c2_data_create_volume = {
678 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
681 "vimId": "vim_volume_1",
682 "vimName": "vim_volume_1",
683 "tenantId": "vim_volume_1",
685 "availabilityZone": "availabilityZone",
686 "status": "availuable",
687 "createTime": "2015-12-02T06:39:40.000000",
693 c3_data_get_volume = {
694 "status": "available",
698 "device": "/dev/vdc",
699 "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
700 "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
702 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
705 "createTime": "2015-12-02T06:39:40.000000",
707 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
712 c4_data_create_network = {
717 "id": "3c9eebdbbfd345658269340b9ea6fb73",
719 "tenantId": "tenant1",
720 "networkName": "ommnet",
722 "vlanTransparent": True,
723 "networkType": "vlan",
724 "segmentationId": 202,
725 "physicalNetwork": "ctrl",
726 "routerExternal": False
730 c5_data_create_subnet = {
735 "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
736 "tenantId": "tenant1",
737 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
738 "networkName": "networkName",
740 "cidr": "10.43.35.0/24",
743 "gatewayIp": "10.43.35.1",
744 "dnsNameservers": [],
747 "start": "192.168.199.2",
748 "end": "192.168.199.254"
755 c6_data_create_port = {
760 "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
761 "tenantId": "tenant1",
763 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
764 "networkName": "networkName",
765 "subnetId": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
766 "subnetName": "subnet1",
767 "macAddress": "212.12.61.23",
769 "vnicType": "normal",
774 c7_data_create_flavor ={
778 "id": "142019d3-bc6e-4319-9c1d-6722fc136afg",
779 "tenantId": "tenant1",
787 "extraSpecs": "testtt"
791 c8_data_list_image = {
797 "id": "5e2757c1-f846-4727-915c-9a872553ed75",
805 c9_data_create_vm = {
807 "id": "3c9eebdbbfd345658269340b9ea6fb73",
811 "tenantId": "tenant1",
814 "volumeArray": "dfdf",
815 "availabilityZone": "fdvfdv",
816 "flavorId": "fdvfdv",
817 "metadata": "fdvfdv",
818 "securityGroups": "fdvfdv",
819 "serverGroup": "fdvfdv",
826 "id": "3c9eebdbbfd345658269340b9ea6fb73",
830 "tenantId": "tenant1",