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")
26 "name": "underlayervpn",
29 "csarProvider": "huawei",
32 "id": "ns_underlayervpn_1_0"
36 "id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
37 "type_name": "tosca.nodes.sdn.l3ac",
38 "template_name": "ac2",
56 "type_name": "tosca.interfaces.node.lifecycle.Standard"
62 "type_name": "tosca.capabilities.Node"
66 "type_name": "tosca.capabilities.sdn.ac"
71 "target_node_id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
72 "target_capability_name": "feature"
75 "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
76 "target_capability_name": "feature"
81 "id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
82 "type_name": "tosca.nodes.sdn.l3ac",
83 "template_name": "ac1",
101 "type_name": "tosca.interfaces.node.lifecycle.Standard"
107 "type_name": "tosca.capabilities.Node"
111 "type_name": "tosca.capabilities.sdn.ac"
116 "target_node_id": "pe1_e58ekps6m45g6w9egs9lue2j7",
117 "target_capability_name": "feature"
120 "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
121 "target_capability_name": "feature"
126 "id": "vpn_ie0xim076f7cje67fvrrq9tg1",
127 "type_name": "tosca.nodes.sdn.underlayVPN",
128 "template_name": "vpn",
131 "type_name": "string"
134 "type_name": "string"
137 "type_name": "string"
140 "type_name": "string"
146 "type_name": "tosca.interfaces.node.lifecycle.Standard"
152 "type_name": "tosca.capabilities.Node"
157 "target_node_id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
158 "target_capability_name": "feature"
161 "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
162 "target_capability_name": "feature"
167 "id": "pe1_e58ekps6m45g6w9egs9lue2j7",
168 "type_name": "tosca.nodes.sdn.l3pe",
169 "template_name": "pe1",
172 "type_name": "string"
178 "type_name": "tosca.interfaces.node.lifecycle.Standard"
184 "type_name": "tosca.capabilities.Node"
188 "type_name": "tosca.capabilities.sdn.pe"
193 "id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
194 "type_name": "tosca.nodes.sdn.l3pe",
195 "template_name": "pe2",
198 "type_name": "string"
204 "type_name": "tosca.interfaces.node.lifecycle.Standard"
210 "type_name": "tosca.capabilities.Node"
214 "type_name": "tosca.capabilities.sdn.pe"
220 "node_type_name": "tosca.nodes.sdn.ext.NS.ns_underlayervpn"
224 "type_name": "string",
225 "description": "ac2_ipofunderlayvpn"
228 "type_name": "string",
229 "description": "ac2_routeofunderlayvpn"
232 "type_name": "string",
233 "description": "serviceTypeofunderlayvpn"
236 "type_name": "string",
237 "description": "descriptionofunderlayvpn"
240 "type_name": "string",
241 "description": "pe2_idofunderlayvpn"
244 "type_name": "string",
245 "description": "ac1_routeofunderlayvpn"
248 "type_name": "integer",
249 "description": "ac1_svlanofunderlayvpn"
252 "type_name": "string",
253 "description": "Nameofunderlayervpn"
256 "type_name": "string",
257 "description": "ac1_ipofunderlayvpn"
260 "type_name": "string",
261 "description": "ac2_portofunderlayvpn"
264 "type_name": "string",
265 "description": "pe1_idofunderlayvpn"
268 "type_name": "string",
269 "description": "technologyofunderlayvpn"
272 "type_name": "string",
273 "description": "ac1_portofunderlayvpn"
276 "type_name": "integer",
277 "description": "ac2_svlanofunderlayvpn"
280 "type_name": "string",
281 "description": "topologyofunderlayvpn"
294 'domain_type': u'CN',
295 'version': u'v4.14.10',
296 'vmnumber_overquota_alarm': False,
299 'vnfd_version': u'V00000001',
300 'id': u'sss-vnf-template',
301 'name': u'sss-vnf-template'
306 "description": "vdu description",
308 "name": "vduinstname",
311 "support_scaling": True,
314 "tenant": "tenantname",
315 "availability_zone": "zone1",
318 "local_affinity_antiaffinity_rule": [
320 "affinity_antiaffinity": "anti-affinity",
324 "affinity_antiaffinity": "affinity",
328 "inject_data_list": [
330 "file_name": "abc.xml",
331 "file_data": "<a>xxx</a><b>ssss</b>"
334 "storage_policy": "HIGH",
336 "manual_scale_select_vim": False,
338 "enabledelay": 600000,
341 "is_predefined": False,
342 "allow_scale_updown": False,
343 "inject_network_address": True,
344 "inner_hugepage_num": 100,
345 "inner_hugepage_size": "2048",
348 "image_file": u'sss',
355 "volume_storage_id": "volume_storage1",
356 "location": "/usr/data",
357 "device": "/dev/hda1"
366 "mem_size": "1024MB",
367 "cpu_frequency": "1GHz",
368 "flavor_extra_specs": {
369 "hw: cpu_policy": "shared",
370 "hw: cpu_max_threads": 50,
371 "hw: cpu_sockets": 10,
372 "hw: cpu_max_sockets": 20,
373 "hw: cpu_max_cores": 8,
374 "hw: cpu_threads": 30,
375 "hw: numa_mem.0": 12288,
376 "hw: hugepage_num": 100,
377 "hw: high_performance": "dvs_high",
379 "hw: numa_cpus.0": "2,4,8",
380 "hw: numa_pci": True,
382 "pci_passthrough: alias": "ColetoCreek: 1",
383 "hw: mem_page_size": "large",
384 "hw: mem_paging_mechanism": "EPT"
396 "default_instances": 1
401 "implementation": "<implementationScript>",
403 "param1Name": "value1",
404 "paramNName": "valueN"
408 "implementation": "<implementationScript>",
410 "param1Name": "value1",
411 "paramNName": "valueN"
415 "implementation": "<implementationScript>",
417 "param1Name": "value1",
418 "paramNName": "valueN"
422 "implementation": "<implementationScript>",
424 "param1Name": "value1",
425 "paramNName": "valueN"
429 "implementation": "<implementationScript>",
431 "param1Name": "value1",
432 "paramNName": "valueN"
439 "artifact_name": "software_version_file",
440 "type": "tosca.artifacts.Deployment",
441 "file": "AppSoftwares/zte-cn-xgw-V5.16.11_NFV-version.zip",
450 "volume_storage_id": "volume_storage1",
455 "volume_name": "volumeStorage1",
456 "custom_volume_type": "type1",
458 "delete_on_termination_vm": True,
461 "tenant": "tenantname_1",
462 "availability_zone": "zone1"
464 "is_predefined": False,
477 'policy_id': u'policy_scale_sss-vnf-template',
479 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
488 'name': u'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
490 'disk_format': u'VMDK',
491 'file_url': u'./zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
492 'container_type': 'vm',
494 'hypervisor_type': 'kvm'
496 'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'
503 'disk_format': u'VMDK',
504 'file_url': u'./zte-cn-sss-main-image/NE/sss.vmdk',
505 'container_type': 'vm',
507 'hypervisor_type': 'kvm'
509 'image_file_id': u'sss'
517 "name": "umac_241_control",
518 "network_name": "umac_control",
519 "is_predefined": False,
521 "netmask": "255.255.255.0",
523 "network_type": "vlan",
524 "physical_network": "phynet01",
525 "segmentation_id": "30",
526 "vlan_transparent": False,
528 "cidr": "192.168.199.0/24",
530 "gateway_ip": "192.168.199.1",
531 "dhcp_enabled": False,
536 "start_ip": "192.168.199.2",
537 "end_ip": "192.168.199.254",
540 "destination": "10.43.26.0/24",
541 "nexthop": "10.41.23.1"
546 "tenant": "tenantname_1"
550 "route_id": "router01",
551 "route_external": False
560 "mac_address": "00:d9:00:82:11:e1",
561 "ip_address:": "192.168.1.21",
562 "ip_range_start": "192.168.1.20",
563 "ip_range_end": "192.168.1.29",
564 "floating_ip_address": {
565 "external_network": "extnet01",
566 "ip_address": "10.43.53.23"
568 "service_ip_address": "192.168.1.23",
571 "vnic_type": "normal",
572 "allowed_address_pairs": [
574 "ip": "192.168.1.13",
575 "mac": "00:f3:43:20:a2:a3"
580 "macbond": "00:d9:00:82:11:d1",
581 "sfc_encapsulation": "",
583 "gateway_ip": "192.168.199.1",
584 "netmask": "255.255.255.0",
585 "interface_name": "fe-01-02",
587 "function": "control"
598 c1_data_get_tenant_id = { # get_tenant_id
602 "name": "tenantname_1"
606 c2_data_create_volume = {
607 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
610 "vimId": "vim_volume_1",
611 "vimName": "vim_volume_1",
612 "tenantId": "vim_volume_1",
614 "availabilityZone": "availabilityZone",
615 "status": "availuable",
616 "createTime": "2015-12-02T06:39:40.000000",
620 c3_data_get_volume = { # get_volume
621 "status": "available",
625 "device": "/dev/vdc",
626 "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
627 "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
629 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
632 "createTime": "2015-12-02T06:39:40.000000",
634 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
637 c4_data_create_network = { # create_network
642 "id": "3c9eebdbbfd345658269340b9ea6fb73",
644 "tenantId": "tenant1",
645 "networkName": "ommnet",
647 "vlanTransparent": True,
648 "networkType": "vlan",
649 "segmentationId": 202,
650 "physicalNetwork": "ctrl",
651 "routerExternal": False
653 c5_data_create_subnet = {
658 "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
659 "tenantId": "tenant1",
660 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
661 "networkName": "networkName",
663 "cidr": "10.43.35.0/24",
666 "gatewayIp": "10.43.35.1",
667 "dnsNameservers": [],
670 "start": "192.168.199.2",
671 "end": "192.168.199.254"
676 c6_data_create_port = {
681 "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
682 "tenantId": "tenant1",
684 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
685 "networkName": "networkName",
686 "subnetId": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
687 "subnetName": "subnet1",
688 "macAddress": "212.12.61.23",
690 "vnicType": "normal",
693 c7_data_create_flavor ={
697 "id": "142019d3-bc6e-4319-9c1d-6722fc136afg",
698 "tenantId": "tenant1",
706 "extraSpecs": "testtt"
709 c8_data_list_image = {
715 "id": "5e2757c1-f846-4727-915c-9a872553ed75",
721 c9_data_create_vm = {
723 "id": "3c9eebdbbfd345658269340b9ea6fb73",
727 "tenantId": "tenant1",
730 "volumeArray": "dfdf",
731 "availabilityZone": "fdvfdv",
732 "flavorId": "fdvfdv",
733 "metadata": "fdvfdv",
734 "securityGroups": "fdvfdv",
735 "serverGroup": "fdvfdv",
740 "id": "3c9eebdbbfd345658269340b9ea6fb73",
744 "tenantId": "tenant1",