Modify const file of vnflcm
[vfc/gvnfm/vnflcm.git] / lcm / lcm / nf / vnfs / const.py
1 # Copyright 2017 ZTE Corporation.
2 #
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
6 #
7 #         http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14
15 from lcm.pub.utils.jobutil import enum
16
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")
20
21 vnfd_rawdata = {
22     "rawData": {
23         "instance": {
24             "metadata": {
25                 "designer": "sdno",
26                 "name": "underlayervpn",
27                 "csarVersion": "1.0",
28                 "csarType": "SSAR",
29                 "csarProvider": "huawei",
30                 "version": "1.0",
31                 "type": "SSAR",
32                 "id": "ns_underlayervpn_1_0"
33             },
34             "nodes": [
35                 {
36                     "id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
37                     "type_name": "tosca.nodes.sdn.l3ac",
38                     "template_name": "ac2",
39                     "properties": {
40                         "ip": {
41                             "type_name": "string"
42                         },
43                         "route": {
44                             "type_name": "string"
45                         },
46                         "port": {
47                             "type_name": "string"
48                         },
49                         "svlan": {
50                             "type_name": "string"
51                         }
52                     },
53                     "interfaces": [
54                         {
55                             "name": "Standard",
56                             "type_name": "tosca.interfaces.node.lifecycle.Standard"
57                         }
58                     ],
59                     "capabilities": [
60                         {
61                             "name": "feature",
62                             "type_name": "tosca.capabilities.Node"
63                         },
64                         {
65                             "name": "ac",
66                             "type_name": "tosca.capabilities.sdn.ac"
67                         }
68                     ],
69                     "relationships": [
70                         {
71                             "target_node_id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
72                             "target_capability_name": "feature"
73                         },
74                         {
75                             "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
76                             "target_capability_name": "feature"
77                         }
78                     ]
79                 },
80                 {
81                     "id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
82                     "type_name": "tosca.nodes.sdn.l3ac",
83                     "template_name": "ac1",
84                     "properties": {
85                         "ip": {
86                             "type_name": "string"
87                         },
88                         "route": {
89                             "type_name": "string"
90                         },
91                         "port": {
92                             "type_name": "string"
93                         },
94                         "svlan": {
95                             "type_name": "string"
96                         }
97                     },
98                     "interfaces": [
99                         {
100                             "name": "Standard",
101                             "type_name": "tosca.interfaces.node.lifecycle.Standard"
102                         }
103                     ],
104                     "capabilities": [
105                         {
106                             "name": "feature",
107                             "type_name": "tosca.capabilities.Node"
108                         },
109                         {
110                             "name": "ac",
111                             "type_name": "tosca.capabilities.sdn.ac"
112                         }
113                     ],
114                     "relationships": [
115                         {
116                             "target_node_id": "pe1_e58ekps6m45g6w9egs9lue2j7",
117                             "target_capability_name": "feature"
118                         },
119                         {
120                             "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
121                             "target_capability_name": "feature"
122                         }
123                     ]
124                 },
125                 {
126                     "id": "vpn_ie0xim076f7cje67fvrrq9tg1",
127                     "type_name": "tosca.nodes.sdn.underlayVPN",
128                     "template_name": "vpn",
129                     "properties": {
130                         "serviceType": {
131                             "type_name": "string"
132                         },
133                         "description": {
134                             "type_name": "string"
135                         },
136                         "name": {
137                             "type_name": "string"
138                         },
139                         "topology": {
140                             "type_name": "string"
141                         }
142                     },
143                     "interfaces": [
144                         {
145                             "name": "Standard",
146                             "type_name": "tosca.interfaces.node.lifecycle.Standard"
147                         }
148                     ],
149                     "capabilities": [
150                         {
151                             "name": "feature",
152                             "type_name": "tosca.capabilities.Node"
153                         }
154                     ],
155                     "relationships": [
156                         {
157                             "target_node_id": "ac1_jqows1ai0j0cmwk9jdvuknt97",
158                             "target_capability_name": "feature"
159                         },
160                         {
161                             "target_node_id": "ac2_fdhrbk3dvan8hl5wifm9lp1e9",
162                             "target_capability_name": "feature"
163                         }
164                     ]
165                 },
166                 {
167                     "id": "pe1_e58ekps6m45g6w9egs9lue2j7",
168                     "type_name": "tosca.nodes.sdn.l3pe",
169                     "template_name": "pe1",
170                     "properties": {
171                         "id": {
172                             "type_name": "string"
173                         }
174                     },
175                     "interfaces": [
176                         {
177                             "name": "Standard",
178                             "type_name": "tosca.interfaces.node.lifecycle.Standard"
179                         }
180                     ],
181                     "capabilities": [
182                         {
183                             "name": "feature",
184                             "type_name": "tosca.capabilities.Node"
185                         },
186                         {
187                             "name": "pe",
188                             "type_name": "tosca.capabilities.sdn.pe"
189                         }
190                     ]
191                 },
192                 {
193                     "id": "pe2_go3vo1ctxr1vlbl0ij8stbtj6",
194                     "type_name": "tosca.nodes.sdn.l3pe",
195                     "template_name": "pe2",
196                     "properties": {
197                         "id": {
198                             "type_name": "string"
199                         }
200                     },
201                     "interfaces": [
202                         {
203                             "name": "Standard",
204                             "type_name": "tosca.interfaces.node.lifecycle.Standard"
205                         }
206                     ],
207                     "capabilities": [
208                         {
209                             "name": "feature",
210                             "type_name": "tosca.capabilities.Node"
211                         },
212                         {
213                             "name": "pe",
214                             "type_name": "tosca.capabilities.sdn.pe"
215                         }
216                     ]
217                 }
218             ],
219             "substitution": {
220                 "node_type_name": "tosca.nodes.sdn.ext.NS.ns_underlayervpn"
221             },
222             "inputs": {
223                 "ac2_ip": {
224                     "type_name": "string",
225                     "description": "ac2_ipofunderlayvpn"
226                 },
227                 "ac2_route": {
228                     "type_name": "string",
229                     "description": "ac2_routeofunderlayvpn"
230                 },
231                 "serviceType": {
232                     "type_name": "string",
233                     "description": "serviceTypeofunderlayvpn"
234                 },
235                 "description": {
236                     "type_name": "string",
237                     "description": "descriptionofunderlayvpn"
238                 },
239                 "pe2_id": {
240                     "type_name": "string",
241                     "description": "pe2_idofunderlayvpn"
242                 },
243                 "ac1_route": {
244                     "type_name": "string",
245                     "description": "ac1_routeofunderlayvpn"
246                 },
247                 "ac1_svlan": {
248                     "type_name": "integer",
249                     "description": "ac1_svlanofunderlayvpn"
250                 },
251                 "name": {
252                     "type_name": "string",
253                     "description": "Nameofunderlayervpn"
254                 },
255                 "ac1_ip": {
256                     "type_name": "string",
257                     "description": "ac1_ipofunderlayvpn"
258                 },
259                 "ac2_port": {
260                     "type_name": "string",
261                     "description": "ac2_portofunderlayvpn"
262                 },
263                 "pe1_id": {
264                     "type_name": "string",
265                     "description": "pe1_idofunderlayvpn"
266                 },
267                 "technology": {
268                     "type_name": "string",
269                     "description": "technologyofunderlayvpn"
270                 },
271                 "ac1_port": {
272                     "type_name": "string",
273                     "description": "ac1_portofunderlayvpn"
274                 },
275                 "ac2_svlan": {
276                     "type_name": "integer",
277                     "description": "ac2_svlanofunderlayvpn"
278                 },
279                 "topology": {
280                     "type_name": "string",
281                     "description": "topologyofunderlayvpn"
282                 }
283             }
284         }
285     }
286 }
287
288
289 vnfd_model_dict = {
290     'metadata': {
291         'vendor': u'zte',
292         'is_shared': False,
293         'description': '',
294         'domain_type': u'CN',
295         'version': u'v4.14.10',
296         'vmnumber_overquota_alarm': False,
297         'cross_dc': False,
298         'vnf_type': u'SSS',
299         'vnfd_version': u'V00000001',
300         'id': u'sss-vnf-template',
301         'name': u'sss-vnf-template'
302     },
303     'vdus': [
304         {
305             'volumn_storages': [
306
307             ],
308             'nfv_compute': {
309                 'mem_size': '',
310                 'num_cpus': u'2'
311             },
312             'local_storages': [
313
314             ],
315             'vdu_id': u'vdu_omm.001',
316             'image_file': u'opencos_sss_omm_img_release_20150723-1-disk1',
317             'dependencies': [
318
319             ],
320             'vls': [
321
322             ],
323             'cps': [
324
325             ],
326             'properties': {
327                 'key_vdu': '',
328                 'support_scaling': False,
329                 'vdu_type': '',
330                 'name': '',
331                 'storage_policy': '',
332                 'location_info': {
333                     'vimId': '',
334                     'availability_zone': '',
335                     'region': '',
336                     'dc': '',
337                     'host': '',
338                     'tenant': ''
339                 },
340                 'inject_data_list': [
341
342                 ],
343                 'watchdog': {
344                     'action': '',
345                     'enabledelay': ''
346                 },
347                 'local_affinity_antiaffinity_rule': {
348
349                 },
350                 'template_id': u'omm.001',
351                 'manual_scale_select_vim': False
352             },
353             'description': u'singleommvm'
354         },
355         {
356             'volumn_storages': [
357
358             ],
359             'nfv_compute': {
360                 'mem_size': '',
361                 'num_cpus': u'14'
362             },
363             'local_storages': [
364
365             ],
366             'vdu_id': u'vdu_12',
367             'image_file': u'sss',
368             'dependencies': [
369
370             ],
371             'vls': [
372
373             ],
374             'cps': [
375
376             ],
377             'properties': {
378                 'key_vdu': '',
379                 'support_scaling': False,
380                 'vdu_type': '',
381                 'name': '',
382                 'storage_policy': '',
383                 'location_info': {
384                     'vimId': '',
385                     'availability_zone': '',
386                     'region': '',
387                     'dc': '',
388                     'host': '',
389                     'tenant': ''
390                 },
391                 'inject_data_list': [
392
393                 ],
394                 'watchdog': {
395                     'action': '',
396                     'enabledelay': ''
397                 },
398                 'local_affinity_antiaffinity_rule': {
399
400                 },
401                 'template_id': u'12',
402                 'manual_scale_select_vim': False
403             },
404             'description': u'ppvm'
405         }
406     ],
407     'volume_storages': [
408         {
409             "volume_storage_id": "volume_storage1",
410             "description": "",
411             "properties": {
412                 "size": "100 GB",
413                 "volume_id": "",
414                 "volume_name": "volumeStorage1",
415                 "custom_volume_type": "type1",
416                 "disk_type": "data",
417                 "delete_on_termination_vm": True,
418                 "location_info": {
419                     "vimid": "vimid_1",
420                     "tenant": "tenantname_1",
421                     "availability_zone": "zone1"
422                 },
423                 "is_predefined": False,
424                 "is_shared": False
425             },
426             "image_file": [
427                 "volume_image"
428             ]
429         }
430     ],
431     'policies': {
432         'scaling': {
433             'targets': {
434
435             },
436             'policy_id': u'policy_scale_sss-vnf-template',
437             'properties': {
438                 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
439             },
440             'description': ''
441         }
442     },
443     'image_files': [
444         {
445             'description': '',
446             'properties': {
447                 'name': u'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
448                 'checksum': '',
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',
452                 'version': '',
453                 'hypervisor_type': 'kvm'
454             },
455             'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'
456         },
457         {
458             'description': '',
459             'properties': {
460                 'name': u'sss.vmdk',
461                 'checksum': '',
462                 'disk_format': u'VMDK',
463                 'file_url': u'./zte-cn-sss-main-image/NE/sss.vmdk',
464                 'container_type': 'vm',
465                 'version': '',
466                 'hypervisor_type': 'kvm'
467             },
468             'image_file_id': u'sss'
469         }
470     ],
471     'vls': [
472         {
473             "vl_id": "vldId1",
474             "description": "",
475             "properties": {
476                 "name": "umac_241_control",
477                 "network_name": "umac_control",
478                 "is_predefined": False,
479                 "vendor": "zte",
480                 "netmask": "255.255.255.0",
481                 "mtu": 1500,
482                 "network_type": "vlan",
483                 "physical_network": "phynet01",
484                 "segmentation_id": "30",
485                 "vlan_transparent": False,
486                 "vds_name": "vds1",
487                 "cidr": "192.168.199.0/24",
488                 "ip_version": 4,
489                 "gateway_ip": "192.168.199.1",
490                 "dhcp_enabled": False,
491                 "dns_nameservers": [
492                     "192.168.0.4",
493                     "192.168.0.10"
494                 ],
495                 "start_ip": "192.168.199.2",
496                 "end_ip": "192.168.199.254",
497                 "host_routes": [
498                     {
499                         "destination": "10.43.26.0/24",
500                         "nexthop": "10.41.23.1"
501                     }
502                 ],
503                 "location_info": {
504                     "vimid": "vimid_1",
505                     "tenant": "tenantname_1"
506                 },
507                 "cloud_type": "IaaS"
508             },
509             "route_id": "router01",
510             "route_external": False
511         }
512     ],
513     'cps': [
514         {
515             "cp_id": "cpId",
516             "description": "",
517             "properties": {
518                 "name": "",
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"
526                 },
527                 "service_ip_address": "192.168.1.23",
528                 "order": 1,
529                 "bandwidth": 1000,
530                 "vnic_type": "normal",
531                 "allowed_address_pairs": [
532                     {
533                         "ip": "192.168.1.13",
534                         "mac": "00:f3:43:20:a2:a3"
535                     }
536                 ],
537                 "bond": "none",
538                 "bond_index": 1,
539                 "macbond": "00:d9:00:82:11:d1",
540                 "sfc_encapsulation": "",
541                 "direction": "",
542                 "gateway_ip": "192.168.199.1",
543                 "netmask": "255.255.255.0",
544                 "interface_name": "fe-01-02",
545                 "is_virtual": False,
546                 "function": "control"
547             },
548             "vl_id": "vldId1",
549             "vdu_id": u'vdu_omm.001'
550         }
551     ],
552     'local_storages': [
553
554     ],
555 }
556
557 c1_data_get_tenant_id = {  # get_tenant_id
558     "tenants": [
559         {
560             "id": "1",
561             "name": "tenantname_1"
562         }
563     ]
564 }
565 c2_data_create_volume = {
566     "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
567     "name": "volume1",
568     "returnCode": 1,
569     "vimId": "vim_volume_1",
570     "vimName": "vim_volume_1",
571     "tenantId": "vim_volume_1",
572     "volumeType": "123",
573     "availabilityZone": "availabilityZone",
574     "status": "availuable",
575     "createTime": "2015-12-02T06:39:40.000000",
576     "type": None,
577     "size": 40
578 }
579 c3_data_get_volume = {  # get_volume
580     "status": "available",
581     "name": "wangsong",
582     "attachments": [
583         {
584             "device": "/dev/vdc",
585             "serverId": "3030e666-528e-4954-88f5-cc21dab1262b",
586             "volumeId": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
587             "hostName": None,
588             "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31"
589         }
590     ],
591     "createTime": "2015-12-02T06:39:40.000000",
592     "type": None,
593     "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31",
594     "size": 40
595 }
596 c4_data_create_network = {  # create_network
597     "returnCode": 0,
598     "vimId": "11111",
599     "vimName": "11111",
600     "status": "ACTIVE",
601     "id": "3c9eebdbbfd345658269340b9ea6fb73",
602     "name": "net1",
603     "tenantId": "tenant1",
604     "networkName": "ommnet",
605     "shared": True,
606     "vlanTransparent": True,
607     "networkType": "vlan",
608     "segmentationId": 202,
609     "physicalNetwork": "ctrl",
610     "routerExternal": False
611 }
612 c5_data_create_subnet = {
613     "returnCode": 0,
614     "vimId": "11111",
615     "vimName": "11111",
616     "status": " ACTIVE",
617     "id": "d62019d3-bc6e-4319-9c1d-6722fc136a23",
618     "tenantId": "tenant1",
619     "networkId": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
620     "networkName": "networkName",
621     "name": "subnet1",
622     "cidr": "10.43.35.0/24",
623     "ipVersion": 4,
624     "enableDhcp": 1,
625     "gatewayIp": "10.43.35.1",
626     "dnsNameservers": [],
627     "allocationPools": [
628         {
629             "start": "192.168.199.2",
630             "end": "192.168.199.254"
631         }
632     ],
633     "hostRoutes": []
634 }
635 c6_data_create_port = {
636     "returnCode": 0,
637     "vimId": "11111",
638     "vimName": "11111",
639     "status": " ACTIVE",
640     "id": " 872019d3-bc6e-4319-9c1d-6722fc136afg",
641     "tenantId": "tenant1",
642     "name": "subnet1",
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",
648     "ip": "10.43.38.11",
649     "vnicType": "normal",
650     "securityGroups": ""
651 }