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
64 "localizationLanguage": "en_US",
65 "additionalParams": {}
73 "name": "underlayervpn",
76 "csarProvider": "huawei",
79 "id": "ns_underlayervpn_1_0"
83 "id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
84 "type_name": "tosca.nodes.sdn.l3ac",
85 "template_name": "ac2",
103 "type_name": "tosca.interfaces.node.lifecycle.Standard"
109 "type_name": "tosca.capabilities.Node"
113 "type_name": "tosca.capabilities.sdn.ac"
118 "target_node_id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
119 "target_capability_name": "feature"
122 "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
123 "target_capability_name": "feature"
128 "id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
129 "type_name": "tosca.nodes.sdn.l3ac",
130 "template_name": "ac1",
133 "type_name": "string"
136 "type_name": "string"
139 "type_name": "string"
142 "type_name": "string"
148 "type_name": "tosca.interfaces.node.lifecycle.Standard"
154 "type_name": "tosca.capabilities.Node"
158 "type_name": "tosca.capabilities.sdn.ac"
163 "target_node_id": "pe1_e58ekps6m45g6w9egs9lue2j7",
164 "target_capability_name": "feature"
167 "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
168 "target_capability_name": "feature"
173 "id": "vpn_ie0xim076f7cje67fvrrq9tg1",
174 "type_name": "tosca.nodes.sdn.underlayVPN",
175 "template_name": "vpn",
178 "type_name": "string"
181 "type_name": "string"
184 "type_name": "string"
187 "type_name": "string"
193 "type_name": "tosca.interfaces.node.lifecycle.Standard"
199 "type_name": "tosca.capabilities.Node"
204 "target_node_id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
205 "target_capability_name": "feature"
208 "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
209 "target_capability_name": "feature"
214 "id": "pe1_e58ekps6m45g6w9egs9lue2j7",
215 "type_name": "tosca.nodes.sdn.l3pe",
216 "template_name": "pe1",
219 "type_name": "string"
225 "type_name": "tosca.interfaces.node.lifecycle.Standard"
231 "type_name": "tosca.capabilities.Node"
235 "type_name": "tosca.capabilities.sdn.pe"
240 "id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
241 "type_name": "tosca.nodes.sdn.l3pe",
242 "template_name": "pe2",
245 "type_name": "string"
251 "type_name": "tosca.interfaces.node.lifecycle.Standard"
257 "type_name": "tosca.capabilities.Node"
261 "type_name": "tosca.capabilities.sdn.pe"
267 "node_type_name": "tosca.nodes.sdn.ext.NS.ns_underlayervpn"
271 "type_name": "string",
272 "description": "ac2_ipofunderlayvpn"
275 "type_name": "string",
276 "description": "ac2_routeofunderlayvpn"
279 "type_name": "string",
280 "description": "serviceTypeofunderlayvpn"
283 "type_name": "string",
284 "description": "descriptionofunderlayvpn"
287 "type_name": "string",
288 "description": "pe2_idofunderlayvpn"
291 "type_name": "string",
292 "description": "ac1_routeofunderlayvpn"
295 "type_name": "integer",
296 "description": "ac1_svlanofunderlayvpn"
299 "type_name": "string",
300 "description": "Nameofunderlayervpn"
303 "type_name": "string",
304 "description": "ac1_ipofunderlayvpn"
307 "type_name": "string",
308 "description": "ac2_portofunderlayvpn"
311 "type_name": "string",
312 "description": "pe1_idofunderlayvpn"
315 "type_name": "string",
316 "description": "technologyofunderlayvpn"
319 "type_name": "string",
320 "description": "ac1_portofunderlayvpn"
323 "type_name": "integer",
324 "description": "ac2_svlanofunderlayvpn"
327 "type_name": "string",
328 "description": "topologyofunderlayvpn"
341 'domain_type': u'CN',
342 'version': u'v4.14.10',
343 'vmnumber_overquota_alarm': False,
346 'vnfd_version': u'V00000001',
347 'id': u'sss-vnf-template',
348 'name': u'sss-vnf-template'
353 "description": "vdu description",
355 "name": "vduinstname",
358 "support_scaling": True,
361 "tenant": "tenantname",
362 "availability_zone": "zone1",
365 "local_affinity_antiaffinity_rule": [
367 "affinity_antiaffinity": "anti-affinity",
371 "affinity_antiaffinity": "affinity",
375 "inject_data_list": [
377 "file_name": "abc.xml",
378 "file_data": "<a>xxx</a><b>ssss</b>"
381 "storage_policy": "HIGH",
383 "manual_scale_select_vim": False,
385 "enabledelay": 600000,
388 "is_predefined": False,
389 "allow_scale_updown": False,
390 "inject_network_address": True,
391 "inner_hugepage_num": 100,
392 "inner_hugepage_size": "2048",
395 "image_file": u'sss',
402 "volume_storage_id": "volume_storage1",
403 "location": "/usr/data",
404 "device": "/dev/hda1"
413 "mem_size": "1024MB",
414 "cpu_frequency": "1GHz",
415 "flavor_extra_specs": {
416 "hw: cpu_policy": "shared",
417 "hw: cpu_max_threads": 50,
418 "hw: cpu_sockets": 10,
419 "hw: cpu_max_sockets": 20,
420 "hw: cpu_max_cores": 8,
421 "hw: cpu_threads": 30,
422 "hw: numa_mem.0": 12288,
423 "hw: hugepage_num": 100,
424 "hw: high_performance": "dvs_high",
426 "hw: numa_cpus.0": "2,4,8",
427 "hw: numa_pci": True,
429 "pci_passthrough: alias": "ColetoCreek: 1",
430 "hw: mem_page_size": "large",
431 "hw: mem_paging_mechanism": "EPT"
443 "default_instances": 1
448 "implementation": "<implementationScript>",
450 "param1Name": "value1",
451 "paramNName": "valueN"
455 "implementation": "<implementationScript>",
457 "param1Name": "value1",
458 "paramNName": "valueN"
462 "implementation": "<implementationScript>",
464 "param1Name": "value1",
465 "paramNName": "valueN"
469 "implementation": "<implementationScript>",
471 "param1Name": "value1",
472 "paramNName": "valueN"
476 "implementation": "<implementationScript>",
478 "param1Name": "value1",
479 "paramNName": "valueN"
486 "artifact_name": "software_version_file",
487 "type": "tosca.artifacts.Deployment",
488 "file": "AppSoftwares/zte-cn-xgw-V5.16.11_NFV-version.zip",
497 "volume_storage_id": "volume_storage1",
502 "volume_name": "volumeStorage1",
503 "custom_volume_type": "type1",
505 "delete_on_termination_vm": True,
508 "tenant": "tenantname_1",
509 "availability_zone": "zone1"
511 "is_predefined": False,
524 'policy_id': u'policy_scale_sss-vnf-template',
526 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
535 'name': u'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
537 'disk_format': u'VMDK',
538 'file_url': u'./zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
539 'container_type': 'vm',
541 'hypervisor_type': 'kvm'
543 'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'
550 'disk_format': u'VMDK',
551 'file_url': u'./zte-cn-sss-main-image/NE/sss.vmdk',
552 'container_type': 'vm',
554 'hypervisor_type': 'kvm'
556 'image_file_id': u'sss'
564 "name": "umac_241_control",
565 "network_name": "umac_control",
566 "is_predefined": False,
568 "netmask": "255.255.255.0",
570 "network_type": "vlan",
571 "physical_network": "phynet01",
572 "segmentation_id": "30",
573 "vlan_transparent": False,
575 "cidr": "192.168.199.0/24",
577 "gateway_ip": "192.168.199.1",
578 "dhcp_enabled": False,
583 "start_ip": "192.168.199.2",
584 "end_ip": "192.168.199.254",
587 "destination": "10.43.26.0/24",
588 "nexthop": "10.41.23.1"
593 "tenant": "tenantname_1"
597 "route_id": "router01",
598 "route_external": False
607 "mac_address": "00:d9:00:82:11:e1",
608 "ip_address:": "192.168.1.21",
609 "ip_range_start": "192.168.1.20",
610 "ip_range_end": "192.168.1.29",
611 "floating_ip_address": {
612 "external_network": "extnet01",
613 "ip_address": "10.43.53.23"
615 "service_ip_address": "192.168.1.23",
618 "vnic_type": "normal",
619 "allowed_address_pairs": [
621 "ip": "192.168.1.13",
622 "mac": "00:f3:43:20:a2:a3"
627 "macbond": "00:d9:00:82:11:d1",
628 "sfc_encapsulation": "",
630 "gateway_ip": "192.168.199.1",
631 "netmask": "255.255.255.0",
632 "interface_name": "fe-01-02",
634 "function": "control"
645 c1_data_get_tenant_id = { # get_tenant_id
649 "name": "tenantname_1"
653 c2_data_create_volume = {
654 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
657 "vimId": "vim_volume_1",
658 "vimName": "vim_volume_1",
659 "tenantId": "vim_volume_1",
661 "availabilityZone": "availabilityZone",
662 "status": "availuable",
663 "createTime": "2015-12-02T06:39:40.000000",
667 c3_data_get_volume = { # get_volume
668 "status": "available",
672 "device": "/dev/vdc",
673 "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
674 "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
676 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
679 "createTime": "2015-12-02T06:39:40.000000",
681 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
684 c4_data_create_network = { # create_network
689 "id": "3c9eebdbbfd345658269340b9ea6fb73",
691 "tenantId": "tenant1",
692 "networkName": "ommnet",
694 "vlanTransparent": True,
695 "networkType": "vlan",
696 "segmentationId": 202,
697 "physicalNetwork": "ctrl",
698 "routerExternal": False
700 c5_data_create_subnet = {
705 "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
706 "tenantId": "tenant1",
707 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
708 "networkName": "networkName",
710 "cidr": "10.43.35.0/24",
713 "gatewayIp": "10.43.35.1",
714 "dnsNameservers": [],
717 "start": "192.168.199.2",
718 "end": "192.168.199.254"
723 c6_data_create_port = {
728 "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
729 "tenantId": "tenant1",
731 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
732 "networkName": "networkName",
733 "subnetId": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
734 "subnetName": "subnet1",
735 "macAddress": "212.12.61.23",
737 "vnicType": "normal",
740 c7_data_create_flavor ={
744 "id": "142019d3-bc6e-4319-9c1d-6722fc136afg",
745 "tenantId": "tenant1",
753 "extraSpecs": "testtt"
756 c8_data_list_image = {
762 "id": "5e2757c1-f846-4727-915c-9a872553ed75",
768 c9_data_create_vm = {
770 "id": "3c9eebdbbfd345658269340b9ea6fb73",
774 "tenantId": "tenant1",
777 "volumeArray": "dfdf",
778 "availabilityZone": "fdvfdv",
779 "flavorId": "fdvfdv",
780 "metadata": "fdvfdv",
781 "securityGroups": "fdvfdv",
782 "serverGroup": "fdvfdv",
787 "id": "3c9eebdbbfd345658269340b9ea6fb73",
791 "tenantId": "tenant1",