blob: 48a83aca96e337be77935d86ecf65b33e8eff611 [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 Johnson74b6f2f2020-10-29 15:11:39 -070024CA_TLS_CONTAINER_REF = 'ca_tls_container_ref'
Michael Johnson63786632019-11-08 23:22:13 -080025CLIENT_AUTHENTICATION = 'client_authentication'
26CLIENT_AUTH_NONE = 'NONE'
27CLIENT_AUTH_OPTIONAL = 'OPTIONAL'
28CLIENT_AUTH_MANDATORY = 'MANDATORY'
29CLIENT_CA_TLS_CONTAINER_REF = 'client_ca_tls_container_ref'
30CLIENT_CRL_CONTAINER_REF = 'client_crl_container_ref'
Jude Cross986e3f52017-07-24 14:57:20 -070031CREATED_AT = 'created_at'
Michael Johnson74b6f2f2020-10-29 15:11:39 -070032CRL_CONTAINER_REF = 'crl_container_ref'
Jude Cross986e3f52017-07-24 14:57:20 -070033DESCRIPTION = 'description'
Adam Harwellc2aa20c2019-11-20 11:15:07 -080034FLAVOR_DATA = 'flavor_data'
Adam Harwella795ae62018-04-23 12:11:19 -070035FLAVOR_ID = 'flavor_id'
Adam Harwellc2aa20c2019-11-20 11:15:07 -080036FLAVOR_PROFILE_ID = 'flavor_profile_id'
Jude Cross986e3f52017-07-24 14:57:20 -070037ID = 'id'
38LISTENERS = 'listeners'
39LOADBALANCER = 'loadbalancer'
40NAME = 'name'
41OPERATING_STATUS = 'operating_status'
42POOLS = 'pools'
43PROJECT_ID = 'project_id'
44PROVIDER = 'provider'
Michael Johnsonaff2e862019-01-11 16:38:00 -080045PROVIDER_NAME = 'provider_name'
Jude Cross986e3f52017-07-24 14:57:20 -070046PROVISIONING_STATUS = 'provisioning_status'
47REQUEST_ERRORS = 'request_errors'
Michael Johnson031ecca2020-10-29 16:45:32 -070048TLS_CONTAINER_REF = 'tls_container_ref'
Jude Cross986e3f52017-07-24 14:57:20 -070049TOTAL_CONNECTIONS = 'total_connections'
50UPDATED_AT = 'updated_at'
51VIP_ADDRESS = 'vip_address'
52VIP_NETWORK_ID = 'vip_network_id'
53VIP_PORT_ID = 'vip_port_id'
54VIP_SUBNET_ID = 'vip_subnet_id'
55VIP_QOS_POLICY_ID = 'vip_qos_policy_id'
Jude Crossfbbd2b42017-08-09 15:21:04 -070056PROTOCOL = 'protocol'
57PROTOCOL_PORT = 'protocol_port'
58LOADBALANCER_ID = 'loadbalancer_id'
59CONNECTION_LIMIT = 'connection_limit'
60INSERT_HEADERS = 'insert_headers'
61X_FORWARDED_FOR = 'X-Forwarded-For'
62X_FORWARDED_PORT = 'X-Forwarded-Port'
Michael Johnson6a9236a2020-08-04 23:54:54 +000063X_FORWARDED_PROTO = 'X-Forwarded-Proto'
oschwart540bb3b2020-06-16 18:23:53 +030064TAGS = 'tags'
Jude Crossfbbd2b42017-08-09 15:21:04 -070065TIMEOUT_CLIENT_DATA = 'timeout_client_data'
66TIMEOUT_MEMBER_CONNECT = 'timeout_member_connect'
67TIMEOUT_MEMBER_DATA = 'timeout_member_data'
68TIMEOUT_TCP_INSPECT = 'timeout_tcp_inspect'
Michael Johnson74b6f2f2020-10-29 15:11:39 -070069TLS_ENABLED = 'tls_enabled'
Jude Crossfbbd2b42017-08-09 15:21:04 -070070DEFAULT_TLS_CONTAINER_REF = 'default_tls_container_ref'
71SNI_CONTAINER_REFS = 'sni_container_refs'
72DEFAULT_POOL_ID = 'default_pool_id'
73L7_POLICIES = 'l7_policies'
Carlos Goncalvesf7718ef2020-08-18 14:21:36 +000074ALPN_PROTOCOLS = 'alpn_protocols'
Tom Weiningerc03e9c32024-04-23 14:07:04 +020075HSTS_MAX_AGE = 'hsts_max_age'
76HSTS_INCLUDE_SUBDOMAINS = 'hsts_include_subdomains'
77HSTS_PRELOAD = 'hsts_preload'
Jude Cross986e3f52017-07-24 14:57:20 -070078
Adam Harwell8ffce3e2018-05-01 21:18:44 -070079LB_ALGORITHM = 'lb_algorithm'
80LB_ALGORITHM_ROUND_ROBIN = 'ROUND_ROBIN'
81LB_ALGORITHM_LEAST_CONNECTIONS = 'LEAST_CONNECTIONS'
82LB_ALGORITHM_SOURCE_IP = 'SOURCE_IP'
Maciej Józefczykb6df5f82019-12-10 10:12:30 +000083LB_ALGORITHM_SOURCE_IP_PORT = 'SOURCE_IP_PORT'
84SUPPORTED_LB_ALGORITHMS_AMPHORA = [
85 LB_ALGORITHM_ROUND_ROBIN,
86 LB_ALGORITHM_LEAST_CONNECTIONS,
87 LB_ALGORITHM_SOURCE_IP]
88SUPPORTED_LB_ALGORITHMS = {
89 'default': SUPPORTED_LB_ALGORITHMS_AMPHORA,
90 'octavia': SUPPORTED_LB_ALGORITHMS_AMPHORA,
91 'amphorav2': SUPPORTED_LB_ALGORITHMS_AMPHORA,
92 'amphora': SUPPORTED_LB_ALGORITHMS_AMPHORA,
93 'ovn': [LB_ALGORITHM_SOURCE_IP_PORT]}
Adam Harwell8ffce3e2018-05-01 21:18:44 -070094SESSION_PERSISTENCE = 'session_persistence'
95LISTENER_ID = 'listener_id'
96LOADBALANCERS = 'loadbalancers'
97
Adam Harwellde3e0542018-05-03 18:21:06 -070098POOL_ID = 'pool_id'
99ADDRESS = 'address'
100WEIGHT = 'weight'
101BACKUP = 'backup'
102SUBNET_ID = 'subnet_id'
103MONITOR_ADDRESS = 'monitor_address'
104MONITOR_PORT = 'monitor_port'
105
Adam Harwell60ed9d92018-05-10 13:23:13 -0700106DELAY = 'delay'
107TIMEOUT = 'timeout'
108MAX_RETRIES = 'max_retries'
109MAX_RETRIES_DOWN = 'max_retries_down'
110HTTP_METHOD = 'http_method'
111URL_PATH = 'url_path'
112EXPECTED_CODES = 'expected_codes'
113
Michael Johnsona2d03072019-01-14 17:18:21 -0800114ENABLED = 'enabled'
Michael Johnsonaff2e862019-01-11 16:38:00 -0800115
Adam Harwell60ed9d92018-05-10 13:23:13 -0700116# Other constants
117ACTIVE = 'ACTIVE'
Lukáš Piwowarski1e90ece2023-10-06 16:51:23 +0200118PAUSED = 'PAUSED'
Carlos Goncalvesc2e12162019-02-14 23:57:44 +0100119PENDING_UPDATE = 'PENDING_UPDATE'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700120ADMIN_STATE_UP_TRUE = 'true'
121ASC = 'asc'
122DELETED = 'DELETED'
123DESC = 'desc'
124FIELDS = 'fields'
125OFFLINE = 'OFFLINE'
126ONLINE = 'ONLINE'
127NO_MONITOR = 'NO_MONITOR'
128ERROR = 'ERROR'
129SORT = 'sort'
Michael Johnsonaff2e862019-01-11 16:38:00 -0800130SINGLE = 'SINGLE'
131ACTIVE_STANDBY = 'ACTIVE_STANDBY'
Carlos Goncalvesee09a1b2019-07-22 11:45:04 +0200132SUPPORTED_LB_TOPOLOGIES = (SINGLE, ACTIVE_STANDBY)
Lukáš Piwowarski1e90ece2023-10-06 16:51:23 +0200133BACKUP_TRUE = 'true'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700134
135# Protocols
136HTTP = 'HTTP'
137HTTPS = 'HTTPS'
Michael Johnson89bdbcd2020-03-19 15:59:19 -0700138PROXY = 'PROXY'
Michael Johnson8646e5a2021-10-02 19:58:34 +0000139PROMETHEUS = 'PROMETHEUS'
Gregory Thiemongeece5ab42020-10-29 08:46:05 +0100140SCTP = 'SCTP'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700141TCP = 'TCP'
Carlos Goncalves9777f112019-05-02 12:22:45 -0600142TERMINATED_HTTPS = 'TERMINATED_HTTPS'
Gregory Thiemonge26853ac2019-07-02 08:56:41 +0200143UDP = 'UDP'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700144
145# HTTP Methods
146GET = 'GET'
147POST = 'POST'
148PUT = 'PUT'
149DELETE = 'DELETE'
Arkady Shtemplera186f062020-09-30 18:20:03 +0300150HEAD = 'HEAD'
151OPTIONS = 'OPTIONS'
152PATCH = 'PATCH'
153CONNECT = 'CONNECT'
154TRACE = 'TRACE'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700155
156# HM Types
157HEALTH_MONITOR_PING = 'PING'
158HEALTH_MONITOR_TCP = 'TCP'
159HEALTH_MONITOR_HTTP = 'HTTP'
160HEALTH_MONITOR_HTTPS = 'HTTPS'
Gregory Thiemongeece5ab42020-10-29 08:46:05 +0100161HEALTH_MONITOR_SCTP = 'SCTP'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700162HEALTH_MONITOR_TLS_HELLO = 'TLS-HELLO'
Gregory Thiemonge29d17902019-04-30 15:06:17 +0200163HEALTH_MONITOR_UDP_CONNECT = 'UDP-CONNECT'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700164
165# Session Persistence
166TYPE = 'type'
167COOKIE_NAME = 'cookie_name'
168SESSION_PERSISTENCE_SOURCE_IP = 'SOURCE_IP'
169SESSION_PERSISTENCE_HTTP_COOKIE = 'HTTP_COOKIE'
170SESSION_PERSISTENCE_APP_COOKIE = 'APP_COOKIE'
171
Adam Harwell446f8be2018-05-24 16:51:03 -0700172# L7Policy options
173POSITION = 'position'
174REDIRECT_URL = 'redirect_url'
175REDIRECT_POOL_ID = 'redirect_pool_id'
176
177ACTION = 'action'
178REDIRECT_TO_POOL = 'REDIRECT_TO_POOL'
179REDIRECT_TO_URL = 'REDIRECT_TO_URL'
180REJECT = 'REJECT'
181
Adam Harwelle029af22018-05-24 17:13:28 -0700182# L7Rule options
183L7POLICY_ID = 'l7policy_id'
184VALUE = 'value'
185COMPARE_TYPE = 'compare_type'
186KEY = 'key'
187INVERT = 'invert'
188# Compare types
189EQUAL_TO = 'EQUAL_TO'
190STARTS_WITH = 'STARTS_WITH'
191ENDS_WITH = 'ENDS_WITH'
192CONTAINS = 'CONTAINS'
193REGEX = 'REGEX'
194# Types
195COOKIE = 'COOKIE'
196FILE_TYPE = 'FILE_TYPE'
197HEADER = 'HEADER'
198HOST_NAME = 'HOST_NAME'
199PATH = 'PATH'
200
Adam Harwell60ed9d92018-05-10 13:23:13 -0700201# RBAC options
202ADVANCED = 'advanced'
Michael Johnson6006de72021-02-21 01:42:39 +0000203KEYSTONE_DEFAULT_ROLES = 'keystone_default_roles'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700204OWNERADMIN = 'owner_or_admin'
205NONE = 'none'
206
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700207# Amphora fields
208COMPUTE_ID = 'compute_id'
209LB_NETWORK_IP = 'lb_network_ip'
210VRRP_IP = 'vrrp_ip'
211HA_IP = 'ha_ip'
212VRRP_PORT_ID = 'vrrp_port_id'
213HA_PORT_ID = 'ha_port_id'
214CERT_EXPIRATION = 'cert_expiration'
215CERT_BUSY = 'cert_busy'
216ROLE = 'role'
217STATUS = 'status'
218VRRP_INTERFACE = 'vrrp_interface'
219VRRP_ID = 'vrrp_id'
220VRRP_PRIORITY = 'vrrp_priority'
221CACHED_ZONE = 'cached_zone'
222IMAGE_ID = 'image_id'
223
224# Amphora roles
225ROLE_STANDALONE = 'STANDALONE'
226ROLE_MASTER = 'MASTER'
227ROLE_BACKUP = 'BACKUP'
228AMPHORA_ROLES = (ROLE_STANDALONE, ROLE_MASTER, ROLE_BACKUP)
229
230# Amphora statuses
231STATUS_BOOTING = 'BOOTING'
232STATUS_ALLOCATED = 'ALLOCATED'
233STATUS_READY = 'READY'
234STATUS_PENDING_CREATE = 'PENDING_CREATE'
235STATUS_PENDING_DELETE = 'PENDING_DELETE'
236STATUS_DELETED = 'DELETED'
237STATUS_ERROR = 'ERROR'
238AMPHORA_STATUSES = (
239 STATUS_BOOTING, STATUS_ALLOCATED, STATUS_READY, STATUS_PENDING_CREATE,
240 STATUS_PENDING_DELETE, STATUS_DELETED, STATUS_ERROR
241)
242
Ann Taraday7d0b5822019-10-17 15:28:30 +0400243# Amphora providers list
244AMPHORA_PROVIDERS = ['amphora', 'amphorav2', 'octavia']
245
Michael Johnsonaff2e862019-01-11 16:38:00 -0800246# Flavor capabilities
247LOADBALANCER_TOPOLOGY = 'loadbalancer_topology'
248
Adam Harwellc2aa20c2019-11-20 11:15:07 -0800249# Availability zone capabilities
250COMPUTE_ZONE = 'compute_zone'
251MANAGEMENT_NETWORK = 'management_network'
252
Jude Cross986e3f52017-07-24 14:57:20 -0700253# API valid fields
254SHOW_LOAD_BALANCER_RESPONSE_FIELDS = (
Adam Harwella795ae62018-04-23 12:11:19 -0700255 ADMIN_STATE_UP, CREATED_AT, DESCRIPTION, FLAVOR_ID, ID, LISTENERS, NAME,
Jude Cross986e3f52017-07-24 14:57:20 -0700256 OPERATING_STATUS, POOLS, PROJECT_ID, PROVIDER, PROVISIONING_STATUS,
257 UPDATED_AT, VIP_ADDRESS, VIP_NETWORK_ID, VIP_PORT_ID, VIP_SUBNET_ID,
258 VIP_QOS_POLICY_ID)
259
Michael Johnsondfd818a2018-08-21 20:54:54 -0700260SHOW_LISTENER_RESPONSE_FIELDS = [
Jude Crossfbbd2b42017-08-09 15:21:04 -0700261 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
262 ADMIN_STATE_UP, PROTOCOL, PROTOCOL_PORT, CONNECTION_LIMIT,
263 DEFAULT_TLS_CONTAINER_REF, SNI_CONTAINER_REFS, PROJECT_ID,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700264 DEFAULT_POOL_ID, L7_POLICIES, INSERT_HEADERS, CREATED_AT, UPDATED_AT
265]
Jude Crossfbbd2b42017-08-09 15:21:04 -0700266
Adam Harwell8ffce3e2018-05-01 21:18:44 -0700267SHOW_POOL_RESPONSE_FIELDS = (
268 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
269 ADMIN_STATE_UP, PROTOCOL, LB_ALGORITHM, SESSION_PERSISTENCE,
270 CREATED_AT, UPDATED_AT
271)
272
Michael Johnsondfd818a2018-08-21 20:54:54 -0700273SHOW_MEMBER_RESPONSE_FIELDS = [
Adam Harwellde3e0542018-05-03 18:21:06 -0700274 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700275 ADDRESS, PROTOCOL_PORT, WEIGHT, MONITOR_PORT, MONITOR_ADDRESS
276]
Adam Harwellde3e0542018-05-03 18:21:06 -0700277
Adam Harwell60ed9d92018-05-10 13:23:13 -0700278SHOW_HEALTHMONITOR_RESPONSE_FIELDS = (
279 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
280 TYPE, DELAY, TIMEOUT, MAX_RETRIES, MAX_RETRIES_DOWN, HTTP_METHOD,
281 URL_PATH, EXPECTED_CODES, CREATED_AT, UPDATED_AT
282)
Adam Harwell446f8be2018-05-24 16:51:03 -0700283
284SHOW_L7POLICY_RESPONSE_FIELDS = (
285 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
286 ADMIN_STATE_UP, LISTENER_ID, POSITION, ACTION, REDIRECT_URL,
287 REDIRECT_POOL_ID, CREATED_AT, UPDATED_AT
288)
Adam Harwelle029af22018-05-24 17:13:28 -0700289
290SHOW_L7RULE_RESPONSE_FIELDS = (
291 ID, ADMIN_STATE_UP, CREATED_AT, UPDATED_AT, TYPE, VALUE, COMPARE_TYPE,
292 KEY, INVERT
293)
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700294
Michael Johnsondfd818a2018-08-21 20:54:54 -0700295SHOW_AMPHORA_RESPONSE_FIELDS = [
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700296 ID, LOADBALANCER_ID, COMPUTE_ID, LB_NETWORK_IP, VRRP_IP, HA_IP,
297 VRRP_PORT_ID, HA_PORT_ID, CERT_EXPIRATION, CERT_BUSY, ROLE, STATUS,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700298 VRRP_INTERFACE, VRRP_ID, VRRP_PRIORITY, CACHED_ZONE
299]
Michael Johnsonaff2e862019-01-11 16:38:00 -0800300
301SHOW_FLAVOR_PROFILE_FIELDS = [ID, NAME, PROVIDER_NAME, FLAVOR_DATA]
Michael Johnsona2d03072019-01-14 17:18:21 -0800302
303SHOW_FLAVOR_FIELDS = [ID, NAME, DESCRIPTION, ENABLED, FLAVOR_PROFILE_ID]
Adam Harwellc2aa20c2019-11-20 11:15:07 -0800304
305SHOW_AVAILABILITY_ZONE_PROFILE_FIELDS = [
306 ID, NAME, PROVIDER_NAME, AVAILABILITY_ZONE_DATA]
307
308SHOW_AVAILABILITY_ZONE_FIELDS = [
309 NAME, DESCRIPTION, ENABLED, AVAILABILITY_ZONE_PROFILE_ID]
Michael Johnsonbaf12e02020-10-27 16:10:28 -0700310
311# Paths inside the test webservers
312CERT_PEM = 'cert.pem'
313KEY_PEM = 'key.pem'
314CLIENT_CA_PEM = 'client_ca.pem'
315DEV_SHM_PATH = '/dev/shm/'
316TEST_SERVER_BINARY = DEV_SHM_PATH + 'test_server.bin'
317TEST_SERVER_CERT = DEV_SHM_PATH + CERT_PEM
318TEST_SERVER_KEY = DEV_SHM_PATH + KEY_PEM
319TEST_SERVER_CLIENT_CA = DEV_SHM_PATH + CLIENT_CA_PEM