blob: aea476e8f12fa053fa68e2a6947cef0916bea57e [file] [log] [blame]
Jude Cross986e3f52017-07-24 14:57:20 -07001# Copyright 2018 Rackspace US Inc. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# 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, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15# API field names
16ACTIVE_CONNECTIONS = 'active_connections'
Carlos Goncalvesbb238552020-01-15 10:10:55 +000017ALLOWED_CIDRS = 'allowed_cidrs'
Adam Harwellc2aa20c2019-11-20 11:15:07 -080018AVAILABILITY_ZONE = 'availability_zone'
19AVAILABILITY_ZONE_DATA = 'availability_zone_data'
20AVAILABILITY_ZONE_PROFILE_ID = 'availability_zone_profile_id'
Jude Cross986e3f52017-07-24 14:57:20 -070021ADMIN_STATE_UP = 'admin_state_up'
22BYTES_IN = 'bytes_in'
23BYTES_OUT = 'bytes_out'
Michael Johnson63786632019-11-08 23:22:13 -080024CLIENT_AUTHENTICATION = 'client_authentication'
25CLIENT_AUTH_NONE = 'NONE'
26CLIENT_AUTH_OPTIONAL = 'OPTIONAL'
27CLIENT_AUTH_MANDATORY = 'MANDATORY'
28CLIENT_CA_TLS_CONTAINER_REF = 'client_ca_tls_container_ref'
29CLIENT_CRL_CONTAINER_REF = 'client_crl_container_ref'
Jude Cross986e3f52017-07-24 14:57:20 -070030CREATED_AT = 'created_at'
31DESCRIPTION = 'description'
Adam Harwellc2aa20c2019-11-20 11:15:07 -080032FLAVOR_DATA = 'flavor_data'
Adam Harwella795ae62018-04-23 12:11:19 -070033FLAVOR_ID = 'flavor_id'
Adam Harwellc2aa20c2019-11-20 11:15:07 -080034FLAVOR_PROFILE_ID = 'flavor_profile_id'
Jude Cross986e3f52017-07-24 14:57:20 -070035ID = 'id'
36LISTENERS = 'listeners'
37LOADBALANCER = 'loadbalancer'
38NAME = 'name'
39OPERATING_STATUS = 'operating_status'
40POOLS = 'pools'
41PROJECT_ID = 'project_id'
42PROVIDER = 'provider'
Michael Johnsonaff2e862019-01-11 16:38:00 -080043PROVIDER_NAME = 'provider_name'
Jude Cross986e3f52017-07-24 14:57:20 -070044PROVISIONING_STATUS = 'provisioning_status'
45REQUEST_ERRORS = 'request_errors'
46TOTAL_CONNECTIONS = 'total_connections'
47UPDATED_AT = 'updated_at'
48VIP_ADDRESS = 'vip_address'
49VIP_NETWORK_ID = 'vip_network_id'
50VIP_PORT_ID = 'vip_port_id'
51VIP_SUBNET_ID = 'vip_subnet_id'
52VIP_QOS_POLICY_ID = 'vip_qos_policy_id'
Jude Crossfbbd2b42017-08-09 15:21:04 -070053PROTOCOL = 'protocol'
54PROTOCOL_PORT = 'protocol_port'
55LOADBALANCER_ID = 'loadbalancer_id'
56CONNECTION_LIMIT = 'connection_limit'
57INSERT_HEADERS = 'insert_headers'
58X_FORWARDED_FOR = 'X-Forwarded-For'
59X_FORWARDED_PORT = 'X-Forwarded-Port'
Michael Johnson6a9236a2020-08-04 23:54:54 +000060X_FORWARDED_PROTO = 'X-Forwarded-Proto'
oschwart540bb3b2020-06-16 18:23:53 +030061TAGS = 'tags'
Jude Crossfbbd2b42017-08-09 15:21:04 -070062TIMEOUT_CLIENT_DATA = 'timeout_client_data'
63TIMEOUT_MEMBER_CONNECT = 'timeout_member_connect'
64TIMEOUT_MEMBER_DATA = 'timeout_member_data'
65TIMEOUT_TCP_INSPECT = 'timeout_tcp_inspect'
66DEFAULT_TLS_CONTAINER_REF = 'default_tls_container_ref'
67SNI_CONTAINER_REFS = 'sni_container_refs'
68DEFAULT_POOL_ID = 'default_pool_id'
69L7_POLICIES = 'l7_policies'
Carlos Goncalvesf7718ef2020-08-18 14:21:36 +000070ALPN_PROTOCOLS = 'alpn_protocols'
Jude Cross986e3f52017-07-24 14:57:20 -070071
Adam Harwell8ffce3e2018-05-01 21:18:44 -070072LB_ALGORITHM = 'lb_algorithm'
73LB_ALGORITHM_ROUND_ROBIN = 'ROUND_ROBIN'
74LB_ALGORITHM_LEAST_CONNECTIONS = 'LEAST_CONNECTIONS'
75LB_ALGORITHM_SOURCE_IP = 'SOURCE_IP'
Maciej Józefczykb6df5f82019-12-10 10:12:30 +000076LB_ALGORITHM_SOURCE_IP_PORT = 'SOURCE_IP_PORT'
77SUPPORTED_LB_ALGORITHMS_AMPHORA = [
78 LB_ALGORITHM_ROUND_ROBIN,
79 LB_ALGORITHM_LEAST_CONNECTIONS,
80 LB_ALGORITHM_SOURCE_IP]
81SUPPORTED_LB_ALGORITHMS = {
82 'default': SUPPORTED_LB_ALGORITHMS_AMPHORA,
83 'octavia': SUPPORTED_LB_ALGORITHMS_AMPHORA,
84 'amphorav2': SUPPORTED_LB_ALGORITHMS_AMPHORA,
85 'amphora': SUPPORTED_LB_ALGORITHMS_AMPHORA,
86 'ovn': [LB_ALGORITHM_SOURCE_IP_PORT]}
Adam Harwell8ffce3e2018-05-01 21:18:44 -070087SESSION_PERSISTENCE = 'session_persistence'
88LISTENER_ID = 'listener_id'
89LOADBALANCERS = 'loadbalancers'
90
Adam Harwellde3e0542018-05-03 18:21:06 -070091POOL_ID = 'pool_id'
92ADDRESS = 'address'
93WEIGHT = 'weight'
94BACKUP = 'backup'
95SUBNET_ID = 'subnet_id'
96MONITOR_ADDRESS = 'monitor_address'
97MONITOR_PORT = 'monitor_port'
98
Adam Harwell60ed9d92018-05-10 13:23:13 -070099DELAY = 'delay'
100TIMEOUT = 'timeout'
101MAX_RETRIES = 'max_retries'
102MAX_RETRIES_DOWN = 'max_retries_down'
103HTTP_METHOD = 'http_method'
104URL_PATH = 'url_path'
105EXPECTED_CODES = 'expected_codes'
106
Michael Johnsona2d03072019-01-14 17:18:21 -0800107ENABLED = 'enabled'
Michael Johnsonaff2e862019-01-11 16:38:00 -0800108
Adam Harwell60ed9d92018-05-10 13:23:13 -0700109# Other constants
110ACTIVE = 'ACTIVE'
Carlos Goncalvesc2e12162019-02-14 23:57:44 +0100111PENDING_UPDATE = 'PENDING_UPDATE'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700112ADMIN_STATE_UP_TRUE = 'true'
113ASC = 'asc'
114DELETED = 'DELETED'
115DESC = 'desc'
116FIELDS = 'fields'
117OFFLINE = 'OFFLINE'
118ONLINE = 'ONLINE'
119NO_MONITOR = 'NO_MONITOR'
120ERROR = 'ERROR'
121SORT = 'sort'
Michael Johnsonaff2e862019-01-11 16:38:00 -0800122SINGLE = 'SINGLE'
123ACTIVE_STANDBY = 'ACTIVE_STANDBY'
Carlos Goncalvesee09a1b2019-07-22 11:45:04 +0200124SUPPORTED_LB_TOPOLOGIES = (SINGLE, ACTIVE_STANDBY)
Adam Harwell60ed9d92018-05-10 13:23:13 -0700125
126# Protocols
127HTTP = 'HTTP'
128HTTPS = 'HTTPS'
Michael Johnson89bdbcd2020-03-19 15:59:19 -0700129PROXY = 'PROXY'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700130TCP = 'TCP'
Carlos Goncalves9777f112019-05-02 12:22:45 -0600131TERMINATED_HTTPS = 'TERMINATED_HTTPS'
Gregory Thiemonge26853ac2019-07-02 08:56:41 +0200132UDP = 'UDP'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700133
134# HTTP Methods
135GET = 'GET'
136POST = 'POST'
137PUT = 'PUT'
138DELETE = 'DELETE'
139
140# HM Types
141HEALTH_MONITOR_PING = 'PING'
142HEALTH_MONITOR_TCP = 'TCP'
143HEALTH_MONITOR_HTTP = 'HTTP'
144HEALTH_MONITOR_HTTPS = 'HTTPS'
145HEALTH_MONITOR_TLS_HELLO = 'TLS-HELLO'
Gregory Thiemonge29d17902019-04-30 15:06:17 +0200146HEALTH_MONITOR_UDP_CONNECT = 'UDP-CONNECT'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700147
148# Session Persistence
149TYPE = 'type'
150COOKIE_NAME = 'cookie_name'
151SESSION_PERSISTENCE_SOURCE_IP = 'SOURCE_IP'
152SESSION_PERSISTENCE_HTTP_COOKIE = 'HTTP_COOKIE'
153SESSION_PERSISTENCE_APP_COOKIE = 'APP_COOKIE'
154
Adam Harwell446f8be2018-05-24 16:51:03 -0700155# L7Policy options
156POSITION = 'position'
157REDIRECT_URL = 'redirect_url'
158REDIRECT_POOL_ID = 'redirect_pool_id'
159
160ACTION = 'action'
161REDIRECT_TO_POOL = 'REDIRECT_TO_POOL'
162REDIRECT_TO_URL = 'REDIRECT_TO_URL'
163REJECT = 'REJECT'
164
Adam Harwelle029af22018-05-24 17:13:28 -0700165# L7Rule options
166L7POLICY_ID = 'l7policy_id'
167VALUE = 'value'
168COMPARE_TYPE = 'compare_type'
169KEY = 'key'
170INVERT = 'invert'
171# Compare types
172EQUAL_TO = 'EQUAL_TO'
173STARTS_WITH = 'STARTS_WITH'
174ENDS_WITH = 'ENDS_WITH'
175CONTAINS = 'CONTAINS'
176REGEX = 'REGEX'
177# Types
178COOKIE = 'COOKIE'
179FILE_TYPE = 'FILE_TYPE'
180HEADER = 'HEADER'
181HOST_NAME = 'HOST_NAME'
182PATH = 'PATH'
183
Adam Harwell60ed9d92018-05-10 13:23:13 -0700184# RBAC options
185ADVANCED = 'advanced'
Michael Johnson6006de72021-02-21 01:42:39 +0000186KEYSTONE_DEFAULT_ROLES = 'keystone_default_roles'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700187OWNERADMIN = 'owner_or_admin'
188NONE = 'none'
189
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700190# Amphora fields
191COMPUTE_ID = 'compute_id'
192LB_NETWORK_IP = 'lb_network_ip'
193VRRP_IP = 'vrrp_ip'
194HA_IP = 'ha_ip'
195VRRP_PORT_ID = 'vrrp_port_id'
196HA_PORT_ID = 'ha_port_id'
197CERT_EXPIRATION = 'cert_expiration'
198CERT_BUSY = 'cert_busy'
199ROLE = 'role'
200STATUS = 'status'
201VRRP_INTERFACE = 'vrrp_interface'
202VRRP_ID = 'vrrp_id'
203VRRP_PRIORITY = 'vrrp_priority'
204CACHED_ZONE = 'cached_zone'
205IMAGE_ID = 'image_id'
206
207# Amphora roles
208ROLE_STANDALONE = 'STANDALONE'
209ROLE_MASTER = 'MASTER'
210ROLE_BACKUP = 'BACKUP'
211AMPHORA_ROLES = (ROLE_STANDALONE, ROLE_MASTER, ROLE_BACKUP)
212
213# Amphora statuses
214STATUS_BOOTING = 'BOOTING'
215STATUS_ALLOCATED = 'ALLOCATED'
216STATUS_READY = 'READY'
217STATUS_PENDING_CREATE = 'PENDING_CREATE'
218STATUS_PENDING_DELETE = 'PENDING_DELETE'
219STATUS_DELETED = 'DELETED'
220STATUS_ERROR = 'ERROR'
221AMPHORA_STATUSES = (
222 STATUS_BOOTING, STATUS_ALLOCATED, STATUS_READY, STATUS_PENDING_CREATE,
223 STATUS_PENDING_DELETE, STATUS_DELETED, STATUS_ERROR
224)
225
Ann Taraday7d0b5822019-10-17 15:28:30 +0400226# Amphora providers list
227AMPHORA_PROVIDERS = ['amphora', 'amphorav2', 'octavia']
228
Michael Johnsonaff2e862019-01-11 16:38:00 -0800229# Flavor capabilities
230LOADBALANCER_TOPOLOGY = 'loadbalancer_topology'
231
Adam Harwellc2aa20c2019-11-20 11:15:07 -0800232# Availability zone capabilities
233COMPUTE_ZONE = 'compute_zone'
234MANAGEMENT_NETWORK = 'management_network'
235
Jude Cross986e3f52017-07-24 14:57:20 -0700236# API valid fields
237SHOW_LOAD_BALANCER_RESPONSE_FIELDS = (
Adam Harwella795ae62018-04-23 12:11:19 -0700238 ADMIN_STATE_UP, CREATED_AT, DESCRIPTION, FLAVOR_ID, ID, LISTENERS, NAME,
Jude Cross986e3f52017-07-24 14:57:20 -0700239 OPERATING_STATUS, POOLS, PROJECT_ID, PROVIDER, PROVISIONING_STATUS,
240 UPDATED_AT, VIP_ADDRESS, VIP_NETWORK_ID, VIP_PORT_ID, VIP_SUBNET_ID,
241 VIP_QOS_POLICY_ID)
242
Michael Johnsondfd818a2018-08-21 20:54:54 -0700243SHOW_LISTENER_RESPONSE_FIELDS = [
Jude Crossfbbd2b42017-08-09 15:21:04 -0700244 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
245 ADMIN_STATE_UP, PROTOCOL, PROTOCOL_PORT, CONNECTION_LIMIT,
246 DEFAULT_TLS_CONTAINER_REF, SNI_CONTAINER_REFS, PROJECT_ID,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700247 DEFAULT_POOL_ID, L7_POLICIES, INSERT_HEADERS, CREATED_AT, UPDATED_AT
248]
Jude Crossfbbd2b42017-08-09 15:21:04 -0700249
Adam Harwell8ffce3e2018-05-01 21:18:44 -0700250SHOW_POOL_RESPONSE_FIELDS = (
251 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
252 ADMIN_STATE_UP, PROTOCOL, LB_ALGORITHM, SESSION_PERSISTENCE,
253 CREATED_AT, UPDATED_AT
254)
255
Michael Johnsondfd818a2018-08-21 20:54:54 -0700256SHOW_MEMBER_RESPONSE_FIELDS = [
Adam Harwellde3e0542018-05-03 18:21:06 -0700257 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700258 ADDRESS, PROTOCOL_PORT, WEIGHT, MONITOR_PORT, MONITOR_ADDRESS
259]
Adam Harwellde3e0542018-05-03 18:21:06 -0700260
Adam Harwell60ed9d92018-05-10 13:23:13 -0700261SHOW_HEALTHMONITOR_RESPONSE_FIELDS = (
262 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
263 TYPE, DELAY, TIMEOUT, MAX_RETRIES, MAX_RETRIES_DOWN, HTTP_METHOD,
264 URL_PATH, EXPECTED_CODES, CREATED_AT, UPDATED_AT
265)
Adam Harwell446f8be2018-05-24 16:51:03 -0700266
267SHOW_L7POLICY_RESPONSE_FIELDS = (
268 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
269 ADMIN_STATE_UP, LISTENER_ID, POSITION, ACTION, REDIRECT_URL,
270 REDIRECT_POOL_ID, CREATED_AT, UPDATED_AT
271)
Adam Harwelle029af22018-05-24 17:13:28 -0700272
273SHOW_L7RULE_RESPONSE_FIELDS = (
274 ID, ADMIN_STATE_UP, CREATED_AT, UPDATED_AT, TYPE, VALUE, COMPARE_TYPE,
275 KEY, INVERT
276)
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700277
Michael Johnsondfd818a2018-08-21 20:54:54 -0700278SHOW_AMPHORA_RESPONSE_FIELDS = [
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700279 ID, LOADBALANCER_ID, COMPUTE_ID, LB_NETWORK_IP, VRRP_IP, HA_IP,
280 VRRP_PORT_ID, HA_PORT_ID, CERT_EXPIRATION, CERT_BUSY, ROLE, STATUS,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700281 VRRP_INTERFACE, VRRP_ID, VRRP_PRIORITY, CACHED_ZONE
282]
Michael Johnsonaff2e862019-01-11 16:38:00 -0800283
284SHOW_FLAVOR_PROFILE_FIELDS = [ID, NAME, PROVIDER_NAME, FLAVOR_DATA]
Michael Johnsona2d03072019-01-14 17:18:21 -0800285
286SHOW_FLAVOR_FIELDS = [ID, NAME, DESCRIPTION, ENABLED, FLAVOR_PROFILE_ID]
Adam Harwellc2aa20c2019-11-20 11:15:07 -0800287
288SHOW_AVAILABILITY_ZONE_PROFILE_FIELDS = [
289 ID, NAME, PROVIDER_NAME, AVAILABILITY_ZONE_DATA]
290
291SHOW_AVAILABILITY_ZONE_FIELDS = [
292 NAME, DESCRIPTION, ENABLED, AVAILABILITY_ZONE_PROFILE_ID]
Michael Johnsonbaf12e02020-10-27 16:10:28 -0700293
294# Paths inside the test webservers
295CERT_PEM = 'cert.pem'
296KEY_PEM = 'key.pem'
297CLIENT_CA_PEM = 'client_ca.pem'
298DEV_SHM_PATH = '/dev/shm/'
299TEST_SERVER_BINARY = DEV_SHM_PATH + 'test_server.bin'
300TEST_SERVER_CERT = DEV_SHM_PATH + CERT_PEM
301TEST_SERVER_KEY = DEV_SHM_PATH + KEY_PEM
302TEST_SERVER_CLIENT_CA = DEV_SHM_PATH + CLIENT_CA_PEM