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'
315 'vdu_id': u'vdu_omm.001',
316 'image_file': u'opencos_sss_omm_img_release_20150723-1-disk1',
328 'support_scaling': False,
331 'storage_policy': '',
334 'availability_zone': '',
340 'inject_data_list': [
347 'local_affinity_antiaffinity_rule': {
350 'template_id': u'omm.001',
351 'manual_scale_select_vim': False
353 'description': u'singleommvm'
367 'image_file': u'sss',
379 'support_scaling': False,
382 'storage_policy': '',
385 'availability_zone': '',
391 'inject_data_list': [
398 'local_affinity_antiaffinity_rule': {
401 'template_id': u'12',
402 'manual_scale_select_vim': False
404 'description': u'ppvm'
409 "volume_storage_id": "volume_storage1",
414 "volume_name": "volumeStorage1",
415 "custom_volume_type": "type1",
417 "delete_on_termination_vm": True,
420 "tenant": "tenantname_1",
421 "availability_zone": "zone1"
423 "is_predefined": False,
436 'policy_id': u'policy_scale_sss-vnf-template',
438 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
447 'name': u'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
449 'disk_format': u'VMDK',
450 'file_url': u'./zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
451 'container_type': 'vm',
453 'hypervisor_type': 'kvm'
455 'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'
462 'disk_format': u'VMDK',
463 'file_url': u'./zte-cn-sss-main-image/NE/sss.vmdk',
464 'container_type': 'vm',
466 'hypervisor_type': 'kvm'
468 'image_file_id': u'sss'
476 "name": "umac_241_control",
477 "network_name": "umac_control",
478 "is_predefined": False,
480 "netmask": "255.255.255.0",
482 "network_type": "vlan",
483 "physical_network": "phynet01",
484 "segmentation_id": "30",
485 "vlan_transparent": False,
487 "cidr": "192.168.199.0/24",
489 "gateway_ip": "192.168.199.1",
490 "dhcp_enabled": False,
495 "start_ip": "192.168.199.2",
496 "end_ip": "192.168.199.254",
499 "destination": "10.43.26.0/24",
500 "nexthop": "10.41.23.1"
505 "tenant": "tenantname_1"
509 "route_id": "router01",
510 "route_external": False
519 "mac_address": "00:d9:00:82:11:e1",
520 "ip_address:": "192.168.1.21",
521 "ip_range_start": "192.168.1.20",
522 "ip_range_end": "192.168.1.29",
523 "floating_ip_address": {
524 "external_network": "extnet01",
525 "ip_address": "10.43.53.23"
527 "service_ip_address": "192.168.1.23",
530 "vnic_type": "normal",
531 "allowed_address_pairs": [
533 "ip": "192.168.1.13",
534 "mac": "00:f3:43:20:a2:a3"
539 "macbond": "00:d9:00:82:11:d1",
540 "sfc_encapsulation": "",
542 "gateway_ip": "192.168.199.1",
543 "netmask": "255.255.255.0",
544 "interface_name": "fe-01-02",
546 "function": "control"
549 "vdu_id": u'vdu_omm.001'
557 c1_data_get_tenant_id = { # get_tenant_id
561 "name": "tenantname_1"
565 c2_data_create_volume = {
566 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
569 "vimId": "vim_volume_1",
570 "vimName": "vim_volume_1",
571 "tenantId": "vim_volume_1",
573 "availabilityZone": "availabilityZone",
574 "status": "availuable",
575 "createTime": "2015-12-02T06:39:40.000000",
579 c3_data_get_volume = { # get_volume
580 "status": "available",
584 "device": "/dev/vdc",
585 "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
586 "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
588 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
591 "createTime": "2015-12-02T06:39:40.000000",
593 "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
596 c4_data_create_network = { # create_network
601 "id": "3c9eebdbbfd345658269340b9ea6fb73",
603 "tenantId": "tenant1",
604 "networkName": "ommnet",
606 "vlanTransparent": True,
607 "networkType": "vlan",
608 "segmentationId": 202,
609 "physicalNetwork": "ctrl",
610 "routerExternal": False
612 c5_data_create_subnet = {
617 "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
618 "tenantId": "tenant1",
619 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
620 "networkName": "networkName",
622 "cidr": "10.43.35.0/24",
625 "gatewayIp": "10.43.35.1",
626 "dnsNameservers": [],
629 "start": "192.168.199.2",
630 "end": "192.168.199.254"
635 c6_data_create_port = {
640 "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
641 "tenantId": "tenant1",
643 "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
644 "networkName": "networkName",
645 "subnetId": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
646 "subnetName": "subnet1",
647 "macAddress": "212.12.61.23",
649 "vnicType": "normal",