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.
16 from lcm.pub.utils.jobutil import enum
18 VNF_STATUS = enum(NULL='null', INSTANTIATING="instantiating", INACTIVE='inactive', ACTIVE="active",
19 FAILED="failed", TERMINATING="terminating", SCALING="scaling", OPERATING="operating",
20 UPDATING="updating", HEALING="healing")
23 "flavourId": "flavour_1",
24 "instantiationLevelId": "instantiationLevel_1",
35 "protocolType": "http"
38 "tenant": "tenant_vCPE",
40 "password": "vCPE_321"
42 "interfaceEndpoint": "http://10.43.21.105:80/"
51 "l2AddressData": "00:f3:43:20:a2:a3"
56 "iPAddressType": "IPv4",
57 "iPAddress": "192.168.104.2"
61 "numDynamicAddresses": 0
67 "resourceId": '55_network',
68 "resourceSubnetId": '55_subnet',
75 "localizationLanguage": "en_US",
85 "resourceId": '55_network',
86 "resourceSubnetId": '55_subnet',
102 'domain_type': u'CN',
103 'version': u'v4.14.10',
104 'vmnumber_overquota_alarm': False,
107 'vnfd_version': u'V00000001',
108 'id': u'sss-vnf-template',
109 'name': u'sss-vnf-template'
114 "description": "vdu description",
116 "name": "vduinstname",
119 "support_scaling": True,
122 "tenant": "tenantname",
123 "availability_zone": "zone1",
126 "local_affinity_antiaffinity_rule": [
128 "affinity_antiaffinity": "anti-affinity",
132 "affinity_antiaffinity": "affinity",
136 "inject_data_list": [
138 "file_name": "abc.xml",
139 "file_data": "<a>xxx</a><b>ssss</b>"
142 "storage_policy": "HIGH",
144 "manual_scale_select_vim": False,
146 "enabledelay": 600000,
149 "is_predefined": False,
150 "allow_scale_updown": False,
151 "inject_network_address": True,
152 "inner_hugepage_num": 100,
153 "inner_hugepage_size": "2048",
156 "image_file": u'sss',
163 "volume_storage_id": "volume_storage1",
164 "location": "/usr/data",
165 "device": "/dev/hda1"
175 "cpu_frequency": "1GHz",
176 "flavor_extra_specs": {
177 "hw: cpu_policy": "shared",
178 "hw: cpu_max_threads": 50,
179 "hw: cpu_sockets": 10,
180 "hw: cpu_max_sockets": 20,
181 "hw: cpu_max_cores": 8,
182 "hw: cpu_threads": 30,
183 "hw: numa_mem.0": 12288,
184 "hw: hugepage_num": 100,
185 "hw: high_performance": "dvs_high",
187 "hw: numa_cpus.0": "2,4,8",
188 "hw: numa_pci": True,
190 "pci_passthrough: alias": "ColetoCreek: 1",
191 "hw: mem_page_size": "large",
192 "hw: mem_paging_mechanism": "EPT"
204 "default_instances": 1
209 "implementation": "<implementationScript>",
211 "param1Name": "value1",
212 "paramNName": "valueN"
216 "implementation": "<implementationScript>",
218 "param1Name": "value1",
219 "paramNName": "valueN"
223 "implementation": "<implementationScript>",
225 "param1Name": "value1",
226 "paramNName": "valueN"
230 "implementation": "<implementationScript>",
232 "param1Name": "value1",
233 "paramNName": "valueN"
237 "implementation": "<implementationScript>",
239 "param1Name": "value1",
240 "paramNName": "valueN"
247 "artifact_name": "software_version_file",
248 "type": "tosca.artifacts.Deployment",
249 "file": "AppSoftwares/zte-cn-xgw-V5.16.11_NFV-version.zip",
258 "volume_storage_id": "volume_storage1",
263 "volume_name": "volumeStorage1",
264 "custom_volume_type": "type1",
266 "delete_on_termination_vm": True,
269 "tenant": "tenantname_1",
270 "availability_zone": "zone1"
272 "is_predefined": False,
285 'policy_id': u'policy_scale_sss-vnf-template',
287 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
296 'name': u'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
298 'disk_format': u'VMDK',
299 'file_url': u'./zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
300 'container_type': 'vm',
302 'hypervisor_type': 'kvm'
304 'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'
311 'disk_format': u'VMDK',
312 'file_url': u'./zte-cn-sss-main-image/NE/sss.vmdk',
313 'container_type': 'vm',
315 'hypervisor_type': 'kvm'
317 'image_file_id': u'sss'
325 "name": "umac_241_control",
326 "network_name": "umac_control",
327 "is_predefined": False,
329 "netmask": "255.255.255.0",
331 "network_type": "vlan",
332 "physical_network": "phynet01",
333 "segmentation_id": "30",
334 "vlan_transparent": False,
336 "cidr": "192.168.199.0/24",
338 "gateway_ip": "192.168.199.1",
339 "dhcp_enabled": False,
344 "start_ip": "192.168.199.2",
345 "end_ip": "192.168.199.254",
348 "destination": "10.43.26.0/24",
349 "nexthop": "10.41.23.1"
354 "tenant": "tenantname_1"
358 "route_id": "router01",
359 "route_external": False
368 "mac_address": "00:d9:00:82:11:e1",
369 "ip_address:": "192.168.1.21",
370 "ip_range_start": "192.168.1.20",
371 "ip_range_end": "192.168.1.29",
372 "floating_ip_address": {
373 "external_network": "extnet01",
374 "ip_address": "10.43.53.23"
376 "service_ip_address": "192.168.1.23",
379 "vnic_type": "normal",
380 "allowed_address_pairs": [
382 "ip": "192.168.1.13",
383 "mac": "00:f3:43:20:a2:a3"
388 "macbond": "00:d9:00:82:11:d1",
389 "sfc_encapsulation": "",
391 "gateway_ip": "192.168.199.1",
392 "netmask": "255.255.255.0",
393 "interface_name": "fe-01-02",
395 "function": "control"
407 c1_data_get_tenant_id = {
411 "name": "tenantname_1"
417 c2_data_create_volume = {
418 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
421 "vimId": "vim_volume_1",
422 "vimName": "vim_volume_1",
423 "tenantId": "vim_volume_1",
425 "availabilityZone": "availabilityZone",
426 "status": "availuable",
427 "createTime": "2015-12-02T06:39:40.000000",
433 c3_data_get_volume = {
434 "status": "available",
438 "device": "/dev/vdc",
439 "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
440 "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
442 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
445 "createTime": "2015-12-02T06:39:40.000000",
447 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
452 c4_data_create_network = {
457 "id": "3c9eebdbbfd345658269340b9ea6fb73",
459 "tenantId": "tenant1",
460 "networkName": "ommnet",
462 "vlanTransparent": True,
463 "networkType": "vlan",
464 "segmentationId": 202,
465 "physicalNetwork": "ctrl",
466 "routerExternal": False
470 c5_data_create_subnet = {
475 "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
476 "tenantId": "tenant1",
477 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
478 "networkName": "networkName",
480 "cidr": "10.43.35.0/24",
483 "gatewayIp": "10.43.35.1",
484 "dnsNameservers": [],
487 "start": "192.168.199.2",
488 "end": "192.168.199.254"
495 c6_data_create_port = {
500 "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
501 "tenantId": "tenant1",
503 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
504 "networkName": "networkName",
505 "subnetId": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
506 "subnetName": "subnet1",
507 "macAddress": "212.12.61.23",
509 "vnicType": "normal",
514 c7_data_create_flavor = {
518 "id": "142019d3-bc6e-4319-9c1d-6722fc136afg",
519 "tenantId": "tenant1",
527 "extraSpecs": "testtt"
531 c8_data_list_image = {
537 "id": "5e2757c1-f846-4727-915c-9a872553ed75",
545 c9_data_create_vm = {
547 "id": "3c9eebdbbfd345658269340b9ea6fb73",
551 "tenantId": "tenant1",
554 "volumeArray": "dfdf",
555 "availabilityZone": "fdvfdv",
556 "flavorId": "fdvfdv",
557 "metadata": "fdvfdv",
558 "securityGroups": "fdvfdv",
559 "serverGroup": "fdvfdv",
566 "id": "3c9eebdbbfd345658269340b9ea6fb73",
570 "tenantId": "tenant1",
575 "volume_storages": [],
579 "description": "pe1_idofunderlayvpn"
583 "description": "pe2_idofunderlayvpn"
587 "description": "serviceTypeofunderlayvpn"
591 "description": "descriptionofunderlayvpn"
595 "description": "ac2_routeofunderlayvpn"
599 "description": "ac1_routeofunderlayvpn"
603 "description": "ac1_svlanofunderlayvpn"
607 "description": "ac2_ipofunderlayvpn"
611 "description": "ac1_ipofunderlayvpn"
615 "description": "ac2_portofunderlayvpn"
619 "description": "topologyofunderlayvpn"
623 "description": "technologyofunderlayvpn"
627 "description": "ac1_portofunderlayvpn"
631 "description": "ac2_svlanofunderlayvpn"
635 "description": "Nameofunderlayervpn"
641 "local_storages": [],
650 "name": "underlayervpn",
651 "csarVersion": "1.0",
653 "csarProvider": "huawei",
656 "id": "ns_underlayervpn_1_0"
662 "csarId": "vOpenNAT",
664 "csarName": "vOpenNAT.csar",
665 "vnfdModel": json.dumps(vnfdModel),
666 "vnfdProvider": "Intel",
667 "vnfdId": "openNAT_1.0",
668 "downloadUrl": "http://10.96.33.39:8806/static/catalog/vOpenNAT/vOpenNAT.csar",
669 "vnfVersion": "v1.0",
670 "vnfdVersion": "v1.0",
671 "vnfPackageId": "vOpenNAT"
680 # "designer": "sdno",
681 # "name": "underlayervpn",
682 # "csarVersion": "1.0",
683 # "csarType": "SSAR",
684 # "csarProvider": "huawei",
687 # "id": "ns_underlayervpn_1_0"
691 # "id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
692 # "type_name": "tosca.nodes.sdn.l3ac",
693 # "template_name": "ac2",
696 # "type_name": "string"
699 # "type_name": "string"
702 # "type_name": "string"
705 # "type_name": "string"
710 # "name": "Standard",
711 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
717 # "type_name": "tosca.capabilities.Node"
721 # "type_name": "tosca.capabilities.sdn.ac"
726 # "target_node_id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
727 # "target_capability_name": "feature"
730 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
731 # "target_capability_name": "feature"
736 # "id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
737 # "type_name": "tosca.nodes.sdn.l3ac",
738 # "template_name": "ac1",
741 # "type_name": "string"
744 # "type_name": "string"
747 # "type_name": "string"
750 # "type_name": "string"
755 # "name": "Standard",
756 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
762 # "type_name": "tosca.capabilities.Node"
766 # "type_name": "tosca.capabilities.sdn.ac"
771 # "target_node_id": "pe1_e58ekps6m45g6w9egs9lue2j7",
772 # "target_capability_name": "feature"
775 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
776 # "target_capability_name": "feature"
781 # "id": "vpn_ie0xim076f7cje67fvrrq9tg1",
782 # "type_name": "tosca.nodes.sdn.underlayVPN",
783 # "template_name": "vpn",
786 # "type_name": "string"
789 # "type_name": "string"
792 # "type_name": "string"
795 # "type_name": "string"
800 # "name": "Standard",
801 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
807 # "type_name": "tosca.capabilities.Node"
812 # "target_node_id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
813 # "target_capability_name": "feature"
816 # "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
817 # "target_capability_name": "feature"
822 # "id": "pe1_e58ekps6m45g6w9egs9lue2j7",
823 # "type_name": "tosca.nodes.sdn.l3pe",
824 # "template_name": "pe1",
827 # "type_name": "string"
832 # "name": "Standard",
833 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
839 # "type_name": "tosca.capabilities.Node"
843 # "type_name": "tosca.capabilities.sdn.pe"
848 # "id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
849 # "type_name": "tosca.nodes.sdn.l3pe",
850 # "template_name": "pe2",
853 # "type_name": "string"
858 # "name": "Standard",
859 # "type_name": "tosca.interfaces.node.lifecycle.Standard"
865 # "type_name": "tosca.capabilities.Node"
869 # "type_name": "tosca.capabilities.sdn.pe"
875 # "node_type_name": "tosca.nodes.sdn.ext.NS.ns_underlayervpn"
879 # "type_name": "string",
880 # "description": "ac2_ipofunderlayvpn"
883 # "type_name": "string",
884 # "description": "ac2_routeofunderlayvpn"
887 # "type_name": "string",
888 # "description": "serviceTypeofunderlayvpn"
891 # "type_name": "string",
892 # "description": "descriptionofunderlayvpn"
895 # "type_name": "string",
896 # "description": "pe2_idofunderlayvpn"
899 # "type_name": "string",
900 # "description": "ac1_routeofunderlayvpn"
903 # "type_name": "integer",
904 # "description": "ac1_svlanofunderlayvpn"
907 # "type_name": "string",
908 # "description": "Nameofunderlayervpn"
911 # "type_name": "string",
912 # "description": "ac1_ipofunderlayvpn"
915 # "type_name": "string",
916 # "description": "ac2_portofunderlayvpn"
919 # "type_name": "string",
920 # "description": "pe1_idofunderlayvpn"
923 # "type_name": "string",
924 # "description": "technologyofunderlayvpn"
927 # "type_name": "string",
928 # "description": "ac1_portofunderlayvpn"
931 # "type_name": "integer",
932 # "description": "ac2_svlanofunderlayvpn"
935 # "type_name": "string",
936 # "description": "topologyofunderlayvpn"