blob: 0e2428308668de66a420d082514fd26da77804da [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'
Adam Harwellc2aa20c2019-11-20 11:15:07 -080017AVAILABILITY_ZONE = 'availability_zone'
18AVAILABILITY_ZONE_DATA = 'availability_zone_data'
19AVAILABILITY_ZONE_PROFILE_ID = 'availability_zone_profile_id'
Jude Cross986e3f52017-07-24 14:57:20 -070020ADMIN_STATE_UP = 'admin_state_up'
21BYTES_IN = 'bytes_in'
22BYTES_OUT = 'bytes_out'
Michael Johnson63786632019-11-08 23:22:13 -080023CLIENT_AUTHENTICATION = 'client_authentication'
24CLIENT_AUTH_NONE = 'NONE'
25CLIENT_AUTH_OPTIONAL = 'OPTIONAL'
26CLIENT_AUTH_MANDATORY = 'MANDATORY'
27CLIENT_CA_TLS_CONTAINER_REF = 'client_ca_tls_container_ref'
28CLIENT_CRL_CONTAINER_REF = 'client_crl_container_ref'
Jude Cross986e3f52017-07-24 14:57:20 -070029CREATED_AT = 'created_at'
30DESCRIPTION = 'description'
Adam Harwellc2aa20c2019-11-20 11:15:07 -080031FLAVOR_DATA = 'flavor_data'
Adam Harwella795ae62018-04-23 12:11:19 -070032FLAVOR_ID = 'flavor_id'
Adam Harwellc2aa20c2019-11-20 11:15:07 -080033FLAVOR_PROFILE_ID = 'flavor_profile_id'
Jude Cross986e3f52017-07-24 14:57:20 -070034ID = 'id'
35LISTENERS = 'listeners'
36LOADBALANCER = 'loadbalancer'
37NAME = 'name'
38OPERATING_STATUS = 'operating_status'
39POOLS = 'pools'
40PROJECT_ID = 'project_id'
41PROVIDER = 'provider'
Michael Johnsonaff2e862019-01-11 16:38:00 -080042PROVIDER_NAME = 'provider_name'
Jude Cross986e3f52017-07-24 14:57:20 -070043PROVISIONING_STATUS = 'provisioning_status'
44REQUEST_ERRORS = 'request_errors'
45TOTAL_CONNECTIONS = 'total_connections'
46UPDATED_AT = 'updated_at'
47VIP_ADDRESS = 'vip_address'
48VIP_NETWORK_ID = 'vip_network_id'
49VIP_PORT_ID = 'vip_port_id'
50VIP_SUBNET_ID = 'vip_subnet_id'
51VIP_QOS_POLICY_ID = 'vip_qos_policy_id'
Jude Crossfbbd2b42017-08-09 15:21:04 -070052PROTOCOL = 'protocol'
53PROTOCOL_PORT = 'protocol_port'
54LOADBALANCER_ID = 'loadbalancer_id'
55CONNECTION_LIMIT = 'connection_limit'
56INSERT_HEADERS = 'insert_headers'
57X_FORWARDED_FOR = 'X-Forwarded-For'
58X_FORWARDED_PORT = 'X-Forwarded-Port'
oschwart540bb3b2020-06-16 18:23:53 +030059TAGS = 'tags'
Jude Crossfbbd2b42017-08-09 15:21:04 -070060TIMEOUT_CLIENT_DATA = 'timeout_client_data'
61TIMEOUT_MEMBER_CONNECT = 'timeout_member_connect'
62TIMEOUT_MEMBER_DATA = 'timeout_member_data'
63TIMEOUT_TCP_INSPECT = 'timeout_tcp_inspect'
64DEFAULT_TLS_CONTAINER_REF = 'default_tls_container_ref'
65SNI_CONTAINER_REFS = 'sni_container_refs'
66DEFAULT_POOL_ID = 'default_pool_id'
67L7_POLICIES = 'l7_policies'
Jude Cross986e3f52017-07-24 14:57:20 -070068
Adam Harwell8ffce3e2018-05-01 21:18:44 -070069LB_ALGORITHM = 'lb_algorithm'
70LB_ALGORITHM_ROUND_ROBIN = 'ROUND_ROBIN'
71LB_ALGORITHM_LEAST_CONNECTIONS = 'LEAST_CONNECTIONS'
72LB_ALGORITHM_SOURCE_IP = 'SOURCE_IP'
Maciej Józefczykb6df5f82019-12-10 10:12:30 +000073LB_ALGORITHM_SOURCE_IP_PORT = 'SOURCE_IP_PORT'
74SUPPORTED_LB_ALGORITHMS_AMPHORA = [
75 LB_ALGORITHM_ROUND_ROBIN,
76 LB_ALGORITHM_LEAST_CONNECTIONS,
77 LB_ALGORITHM_SOURCE_IP]
78SUPPORTED_LB_ALGORITHMS = {
79 'default': SUPPORTED_LB_ALGORITHMS_AMPHORA,
80 'octavia': SUPPORTED_LB_ALGORITHMS_AMPHORA,
81 'amphorav2': SUPPORTED_LB_ALGORITHMS_AMPHORA,
82 'amphora': SUPPORTED_LB_ALGORITHMS_AMPHORA,
83 'ovn': [LB_ALGORITHM_SOURCE_IP_PORT]}
Adam Harwell8ffce3e2018-05-01 21:18:44 -070084SESSION_PERSISTENCE = 'session_persistence'
85LISTENER_ID = 'listener_id'
86LOADBALANCERS = 'loadbalancers'
87
Adam Harwellde3e0542018-05-03 18:21:06 -070088POOL_ID = 'pool_id'
89ADDRESS = 'address'
90WEIGHT = 'weight'
91BACKUP = 'backup'
92SUBNET_ID = 'subnet_id'
93MONITOR_ADDRESS = 'monitor_address'
94MONITOR_PORT = 'monitor_port'
95
Adam Harwell60ed9d92018-05-10 13:23:13 -070096DELAY = 'delay'
97TIMEOUT = 'timeout'
98MAX_RETRIES = 'max_retries'
99MAX_RETRIES_DOWN = 'max_retries_down'
100HTTP_METHOD = 'http_method'
101URL_PATH = 'url_path'
102EXPECTED_CODES = 'expected_codes'
103
Michael Johnsona2d03072019-01-14 17:18:21 -0800104ENABLED = 'enabled'
Michael Johnsonaff2e862019-01-11 16:38:00 -0800105
Adam Harwell60ed9d92018-05-10 13:23:13 -0700106# Other constants
107ACTIVE = 'ACTIVE'
Carlos Goncalvesc2e12162019-02-14 23:57:44 +0100108PENDING_UPDATE = 'PENDING_UPDATE'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700109ADMIN_STATE_UP_TRUE = 'true'
110ASC = 'asc'
111DELETED = 'DELETED'
112DESC = 'desc'
113FIELDS = 'fields'
114OFFLINE = 'OFFLINE'
115ONLINE = 'ONLINE'
116NO_MONITOR = 'NO_MONITOR'
117ERROR = 'ERROR'
118SORT = 'sort'
Michael Johnsonaff2e862019-01-11 16:38:00 -0800119SINGLE = 'SINGLE'
120ACTIVE_STANDBY = 'ACTIVE_STANDBY'
Carlos Goncalvesee09a1b2019-07-22 11:45:04 +0200121SUPPORTED_LB_TOPOLOGIES = (SINGLE, ACTIVE_STANDBY)
Adam Harwell60ed9d92018-05-10 13:23:13 -0700122
123# Protocols
124HTTP = 'HTTP'
125HTTPS = 'HTTPS'
126TCP = 'TCP'
Carlos Goncalves9777f112019-05-02 12:22:45 -0600127TERMINATED_HTTPS = 'TERMINATED_HTTPS'
Gregory Thiemonge26853ac2019-07-02 08:56:41 +0200128UDP = 'UDP'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700129
130# HTTP Methods
131GET = 'GET'
132POST = 'POST'
133PUT = 'PUT'
134DELETE = 'DELETE'
135
136# HM Types
137HEALTH_MONITOR_PING = 'PING'
138HEALTH_MONITOR_TCP = 'TCP'
139HEALTH_MONITOR_HTTP = 'HTTP'
140HEALTH_MONITOR_HTTPS = 'HTTPS'
141HEALTH_MONITOR_TLS_HELLO = 'TLS-HELLO'
Gregory Thiemonge29d17902019-04-30 15:06:17 +0200142HEALTH_MONITOR_UDP_CONNECT = 'UDP-CONNECT'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700143
144# Session Persistence
145TYPE = 'type'
146COOKIE_NAME = 'cookie_name'
147SESSION_PERSISTENCE_SOURCE_IP = 'SOURCE_IP'
148SESSION_PERSISTENCE_HTTP_COOKIE = 'HTTP_COOKIE'
149SESSION_PERSISTENCE_APP_COOKIE = 'APP_COOKIE'
150
Adam Harwell446f8be2018-05-24 16:51:03 -0700151# L7Policy options
152POSITION = 'position'
153REDIRECT_URL = 'redirect_url'
154REDIRECT_POOL_ID = 'redirect_pool_id'
155
156ACTION = 'action'
157REDIRECT_TO_POOL = 'REDIRECT_TO_POOL'
158REDIRECT_TO_URL = 'REDIRECT_TO_URL'
159REJECT = 'REJECT'
160
Adam Harwelle029af22018-05-24 17:13:28 -0700161# L7Rule options
162L7POLICY_ID = 'l7policy_id'
163VALUE = 'value'
164COMPARE_TYPE = 'compare_type'
165KEY = 'key'
166INVERT = 'invert'
167# Compare types
168EQUAL_TO = 'EQUAL_TO'
169STARTS_WITH = 'STARTS_WITH'
170ENDS_WITH = 'ENDS_WITH'
171CONTAINS = 'CONTAINS'
172REGEX = 'REGEX'
173# Types
174COOKIE = 'COOKIE'
175FILE_TYPE = 'FILE_TYPE'
176HEADER = 'HEADER'
177HOST_NAME = 'HOST_NAME'
178PATH = 'PATH'
179
Adam Harwell60ed9d92018-05-10 13:23:13 -0700180# RBAC options
181ADVANCED = 'advanced'
182OWNERADMIN = 'owner_or_admin'
183NONE = 'none'
184
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700185# Amphora fields
186COMPUTE_ID = 'compute_id'
187LB_NETWORK_IP = 'lb_network_ip'
188VRRP_IP = 'vrrp_ip'
189HA_IP = 'ha_ip'
190VRRP_PORT_ID = 'vrrp_port_id'
191HA_PORT_ID = 'ha_port_id'
192CERT_EXPIRATION = 'cert_expiration'
193CERT_BUSY = 'cert_busy'
194ROLE = 'role'
195STATUS = 'status'
196VRRP_INTERFACE = 'vrrp_interface'
197VRRP_ID = 'vrrp_id'
198VRRP_PRIORITY = 'vrrp_priority'
199CACHED_ZONE = 'cached_zone'
200IMAGE_ID = 'image_id'
201
202# Amphora roles
203ROLE_STANDALONE = 'STANDALONE'
204ROLE_MASTER = 'MASTER'
205ROLE_BACKUP = 'BACKUP'
206AMPHORA_ROLES = (ROLE_STANDALONE, ROLE_MASTER, ROLE_BACKUP)
207
208# Amphora statuses
209STATUS_BOOTING = 'BOOTING'
210STATUS_ALLOCATED = 'ALLOCATED'
211STATUS_READY = 'READY'
212STATUS_PENDING_CREATE = 'PENDING_CREATE'
213STATUS_PENDING_DELETE = 'PENDING_DELETE'
214STATUS_DELETED = 'DELETED'
215STATUS_ERROR = 'ERROR'
216AMPHORA_STATUSES = (
217 STATUS_BOOTING, STATUS_ALLOCATED, STATUS_READY, STATUS_PENDING_CREATE,
218 STATUS_PENDING_DELETE, STATUS_DELETED, STATUS_ERROR
219)
220
Ann Taraday7d0b5822019-10-17 15:28:30 +0400221# Amphora providers list
222AMPHORA_PROVIDERS = ['amphora', 'amphorav2', 'octavia']
223
Michael Johnsonaff2e862019-01-11 16:38:00 -0800224# Flavor capabilities
225LOADBALANCER_TOPOLOGY = 'loadbalancer_topology'
226
Adam Harwellc2aa20c2019-11-20 11:15:07 -0800227# Availability zone capabilities
228COMPUTE_ZONE = 'compute_zone'
229MANAGEMENT_NETWORK = 'management_network'
230
Jude Cross986e3f52017-07-24 14:57:20 -0700231# API valid fields
232SHOW_LOAD_BALANCER_RESPONSE_FIELDS = (
Adam Harwella795ae62018-04-23 12:11:19 -0700233 ADMIN_STATE_UP, CREATED_AT, DESCRIPTION, FLAVOR_ID, ID, LISTENERS, NAME,
Jude Cross986e3f52017-07-24 14:57:20 -0700234 OPERATING_STATUS, POOLS, PROJECT_ID, PROVIDER, PROVISIONING_STATUS,
235 UPDATED_AT, VIP_ADDRESS, VIP_NETWORK_ID, VIP_PORT_ID, VIP_SUBNET_ID,
236 VIP_QOS_POLICY_ID)
237
Michael Johnsondfd818a2018-08-21 20:54:54 -0700238SHOW_LISTENER_RESPONSE_FIELDS = [
Jude Crossfbbd2b42017-08-09 15:21:04 -0700239 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
240 ADMIN_STATE_UP, PROTOCOL, PROTOCOL_PORT, CONNECTION_LIMIT,
241 DEFAULT_TLS_CONTAINER_REF, SNI_CONTAINER_REFS, PROJECT_ID,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700242 DEFAULT_POOL_ID, L7_POLICIES, INSERT_HEADERS, CREATED_AT, UPDATED_AT
243]
Jude Crossfbbd2b42017-08-09 15:21:04 -0700244
Adam Harwell8ffce3e2018-05-01 21:18:44 -0700245SHOW_POOL_RESPONSE_FIELDS = (
246 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
247 ADMIN_STATE_UP, PROTOCOL, LB_ALGORITHM, SESSION_PERSISTENCE,
248 CREATED_AT, UPDATED_AT
249)
250
Michael Johnsondfd818a2018-08-21 20:54:54 -0700251SHOW_MEMBER_RESPONSE_FIELDS = [
Adam Harwellde3e0542018-05-03 18:21:06 -0700252 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700253 ADDRESS, PROTOCOL_PORT, WEIGHT, MONITOR_PORT, MONITOR_ADDRESS
254]
Adam Harwellde3e0542018-05-03 18:21:06 -0700255
Adam Harwell60ed9d92018-05-10 13:23:13 -0700256SHOW_HEALTHMONITOR_RESPONSE_FIELDS = (
257 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
258 TYPE, DELAY, TIMEOUT, MAX_RETRIES, MAX_RETRIES_DOWN, HTTP_METHOD,
259 URL_PATH, EXPECTED_CODES, CREATED_AT, UPDATED_AT
260)
Adam Harwell446f8be2018-05-24 16:51:03 -0700261
262SHOW_L7POLICY_RESPONSE_FIELDS = (
263 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
264 ADMIN_STATE_UP, LISTENER_ID, POSITION, ACTION, REDIRECT_URL,
265 REDIRECT_POOL_ID, CREATED_AT, UPDATED_AT
266)
Adam Harwelle029af22018-05-24 17:13:28 -0700267
268SHOW_L7RULE_RESPONSE_FIELDS = (
269 ID, ADMIN_STATE_UP, CREATED_AT, UPDATED_AT, TYPE, VALUE, COMPARE_TYPE,
270 KEY, INVERT
271)
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700272
Michael Johnsondfd818a2018-08-21 20:54:54 -0700273SHOW_AMPHORA_RESPONSE_FIELDS = [
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700274 ID, LOADBALANCER_ID, COMPUTE_ID, LB_NETWORK_IP, VRRP_IP, HA_IP,
275 VRRP_PORT_ID, HA_PORT_ID, CERT_EXPIRATION, CERT_BUSY, ROLE, STATUS,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700276 VRRP_INTERFACE, VRRP_ID, VRRP_PRIORITY, CACHED_ZONE
277]
Michael Johnsonaff2e862019-01-11 16:38:00 -0800278
279SHOW_FLAVOR_PROFILE_FIELDS = [ID, NAME, PROVIDER_NAME, FLAVOR_DATA]
Michael Johnsona2d03072019-01-14 17:18:21 -0800280
281SHOW_FLAVOR_FIELDS = [ID, NAME, DESCRIPTION, ENABLED, FLAVOR_PROFILE_ID]
Adam Harwellc2aa20c2019-11-20 11:15:07 -0800282
283SHOW_AVAILABILITY_ZONE_PROFILE_FIELDS = [
284 ID, NAME, PROVIDER_NAME, AVAILABILITY_ZONE_DATA]
285
286SHOW_AVAILABILITY_ZONE_FIELDS = [
287 NAME, DESCRIPTION, ENABLED, AVAILABILITY_ZONE_PROFILE_ID]