blob: 9f9eba9b1eb29fcfdfbe92c6d414b7ea65bacfb3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
_MGMT_STR = "management"
_LEFT_STR = "left"
_RIGHT_STR = "right"
_SVC_VN_MGMT = "svc-vn-mgmt"
_SVC_VN_LEFT = "svc-vn-left"
_SVC_VN_RIGHT = "svc-vn-right"
_VN_MGMT_SUBNET_CIDR = '10.250.1.0/24'
_VN_LEFT_SUBNET_CIDR = '10.250.2.0/24'
_VN_RIGHT_SUBNET_CIDR = '10.250.3.0/24'
_VN_SNAT_PREFIX_NAME = 'snat-si-left'
_VN_SNAT_SUBNET_CIDR = '100.64.0.0/29'
_CHECK_SVC_VM_HEALTH_INTERVAL = 30
_VM_INSTANCE_TYPE = 'virtual-machine'
_NETNS_INSTANCE_TYPE = 'network-namespace'
_SNAT_SVC_TYPE = 'source-nat'
_LB_SVC_TYPE = 'loadbalancer'
_ACTIVE_LOCAL_PREFERENCE = 200
_STANDBY_LOCAL_PREFERENCE = 100
# Version from the vrouter agent can manage service instances
_VROUTER_NETNS_SUPPORTED_VERSION = '1.10'
def get_management_if_str():
return _MGMT_STR
def get_left_if_str():
return _LEFT_STR
def get_right_if_str():
return _RIGHT_STR
def get_if_str_list():
if_str_list = []
if_str_list.append(get_management_if_str())
if_str_list.append(get_left_if_str())
if_str_list.append(get_right_if_str())
return if_str_list
def get_management_vn_name():
return _SVC_VN_MGMT
def get_left_vn_name():
return _SVC_VN_LEFT
def get_right_vn_name():
return _SVC_VN_RIGHT
def get_shared_vn_list():
shared_vn_list = []
shared_vn_list.append(get_management_vn_name())
shared_vn_list.append(get_left_vn_name())
shared_vn_list.append(get_right_vn_name())
return shared_vn_list
def get_management_vn_subnet():
return _VN_MGMT_SUBNET_CIDR
def get_left_vn_subnet():
return _VN_LEFT_SUBNET_CIDR
def get_right_vn_subnet():
return _VN_RIGHT_SUBNET_CIDR
def get_snat_left_vn_prefix():
return _VN_SNAT_PREFIX_NAME
def get_snat_left_subnet():
return _VN_SNAT_SUBNET_CIDR
def get_vm_instance_type():
return _VM_INSTANCE_TYPE
def get_netns_instance_type():
return _NETNS_INSTANCE_TYPE
def get_snat_service_type():
return _SNAT_SVC_TYPE
def get_lb_service_type():
return _LB_SVC_TYPE
def get_vm_health_interval():
return _CHECK_SVC_VM_HEALTH_INTERVAL
def get_active_preference():
return _ACTIVE_LOCAL_PREFERENCE
def get_standby_preference():
return _STANDBY_LOCAL_PREFERENCE
|