blob: 06aa38552c265bf005fadb703ca8a09fbedc14d3 [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'
17ADMIN_STATE_UP = 'admin_state_up'
18BYTES_IN = 'bytes_in'
19BYTES_OUT = 'bytes_out'
Michael Johnson63786632019-11-08 23:22:13 -080020CLIENT_AUTHENTICATION = 'client_authentication'
21CLIENT_AUTH_NONE = 'NONE'
22CLIENT_AUTH_OPTIONAL = 'OPTIONAL'
23CLIENT_AUTH_MANDATORY = 'MANDATORY'
24CLIENT_CA_TLS_CONTAINER_REF = 'client_ca_tls_container_ref'
25CLIENT_CRL_CONTAINER_REF = 'client_crl_container_ref'
Jude Cross986e3f52017-07-24 14:57:20 -070026CREATED_AT = 'created_at'
27DESCRIPTION = 'description'
Adam Harwella795ae62018-04-23 12:11:19 -070028FLAVOR_ID = 'flavor_id'
Jude Cross986e3f52017-07-24 14:57:20 -070029ID = 'id'
30LISTENERS = 'listeners'
31LOADBALANCER = 'loadbalancer'
32NAME = 'name'
33OPERATING_STATUS = 'operating_status'
34POOLS = 'pools'
35PROJECT_ID = 'project_id'
36PROVIDER = 'provider'
Michael Johnsonaff2e862019-01-11 16:38:00 -080037PROVIDER_NAME = 'provider_name'
Jude Cross986e3f52017-07-24 14:57:20 -070038PROVISIONING_STATUS = 'provisioning_status'
39REQUEST_ERRORS = 'request_errors'
40TOTAL_CONNECTIONS = 'total_connections'
41UPDATED_AT = 'updated_at'
42VIP_ADDRESS = 'vip_address'
43VIP_NETWORK_ID = 'vip_network_id'
44VIP_PORT_ID = 'vip_port_id'
45VIP_SUBNET_ID = 'vip_subnet_id'
46VIP_QOS_POLICY_ID = 'vip_qos_policy_id'
Jude Crossfbbd2b42017-08-09 15:21:04 -070047PROTOCOL = 'protocol'
48PROTOCOL_PORT = 'protocol_port'
49LOADBALANCER_ID = 'loadbalancer_id'
50CONNECTION_LIMIT = 'connection_limit'
51INSERT_HEADERS = 'insert_headers'
52X_FORWARDED_FOR = 'X-Forwarded-For'
53X_FORWARDED_PORT = 'X-Forwarded-Port'
54TIMEOUT_CLIENT_DATA = 'timeout_client_data'
55TIMEOUT_MEMBER_CONNECT = 'timeout_member_connect'
56TIMEOUT_MEMBER_DATA = 'timeout_member_data'
57TIMEOUT_TCP_INSPECT = 'timeout_tcp_inspect'
58DEFAULT_TLS_CONTAINER_REF = 'default_tls_container_ref'
59SNI_CONTAINER_REFS = 'sni_container_refs'
60DEFAULT_POOL_ID = 'default_pool_id'
61L7_POLICIES = 'l7_policies'
Jude Cross986e3f52017-07-24 14:57:20 -070062
Adam Harwell8ffce3e2018-05-01 21:18:44 -070063LB_ALGORITHM = 'lb_algorithm'
64LB_ALGORITHM_ROUND_ROBIN = 'ROUND_ROBIN'
65LB_ALGORITHM_LEAST_CONNECTIONS = 'LEAST_CONNECTIONS'
66LB_ALGORITHM_SOURCE_IP = 'SOURCE_IP'
67SESSION_PERSISTENCE = 'session_persistence'
68LISTENER_ID = 'listener_id'
69LOADBALANCERS = 'loadbalancers'
70
Adam Harwellde3e0542018-05-03 18:21:06 -070071POOL_ID = 'pool_id'
72ADDRESS = 'address'
73WEIGHT = 'weight'
74BACKUP = 'backup'
75SUBNET_ID = 'subnet_id'
76MONITOR_ADDRESS = 'monitor_address'
77MONITOR_PORT = 'monitor_port'
78
Adam Harwell60ed9d92018-05-10 13:23:13 -070079DELAY = 'delay'
80TIMEOUT = 'timeout'
81MAX_RETRIES = 'max_retries'
82MAX_RETRIES_DOWN = 'max_retries_down'
83HTTP_METHOD = 'http_method'
84URL_PATH = 'url_path'
85EXPECTED_CODES = 'expected_codes'
86
Michael Johnsonaff2e862019-01-11 16:38:00 -080087FLAVOR_DATA = 'flavor_data'
Michael Johnsona2d03072019-01-14 17:18:21 -080088ENABLED = 'enabled'
89FLAVOR_PROFILE_ID = 'flavor_profile_id'
Michael Johnsonaff2e862019-01-11 16:38:00 -080090
Adam Harwell60ed9d92018-05-10 13:23:13 -070091# Other constants
92ACTIVE = 'ACTIVE'
Carlos Goncalvesc2e12162019-02-14 23:57:44 +010093PENDING_UPDATE = 'PENDING_UPDATE'
Adam Harwell60ed9d92018-05-10 13:23:13 -070094ADMIN_STATE_UP_TRUE = 'true'
95ASC = 'asc'
96DELETED = 'DELETED'
97DESC = 'desc'
98FIELDS = 'fields'
99OFFLINE = 'OFFLINE'
100ONLINE = 'ONLINE'
101NO_MONITOR = 'NO_MONITOR'
102ERROR = 'ERROR'
103SORT = 'sort'
Michael Johnsonaff2e862019-01-11 16:38:00 -0800104SINGLE = 'SINGLE'
105ACTIVE_STANDBY = 'ACTIVE_STANDBY'
Carlos Goncalvesee09a1b2019-07-22 11:45:04 +0200106SUPPORTED_LB_TOPOLOGIES = (SINGLE, ACTIVE_STANDBY)
Adam Harwell60ed9d92018-05-10 13:23:13 -0700107
108# Protocols
109HTTP = 'HTTP'
110HTTPS = 'HTTPS'
111TCP = 'TCP'
Carlos Goncalves9777f112019-05-02 12:22:45 -0600112TERMINATED_HTTPS = 'TERMINATED_HTTPS'
Gregory Thiemonge26853ac2019-07-02 08:56:41 +0200113UDP = 'UDP'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700114
115# HTTP Methods
116GET = 'GET'
117POST = 'POST'
118PUT = 'PUT'
119DELETE = 'DELETE'
120
121# HM Types
122HEALTH_MONITOR_PING = 'PING'
123HEALTH_MONITOR_TCP = 'TCP'
124HEALTH_MONITOR_HTTP = 'HTTP'
125HEALTH_MONITOR_HTTPS = 'HTTPS'
126HEALTH_MONITOR_TLS_HELLO = 'TLS-HELLO'
127
128# Session Persistence
129TYPE = 'type'
130COOKIE_NAME = 'cookie_name'
131SESSION_PERSISTENCE_SOURCE_IP = 'SOURCE_IP'
132SESSION_PERSISTENCE_HTTP_COOKIE = 'HTTP_COOKIE'
133SESSION_PERSISTENCE_APP_COOKIE = 'APP_COOKIE'
134
Adam Harwell446f8be2018-05-24 16:51:03 -0700135# L7Policy options
136POSITION = 'position'
137REDIRECT_URL = 'redirect_url'
138REDIRECT_POOL_ID = 'redirect_pool_id'
139
140ACTION = 'action'
141REDIRECT_TO_POOL = 'REDIRECT_TO_POOL'
142REDIRECT_TO_URL = 'REDIRECT_TO_URL'
143REJECT = 'REJECT'
144
Adam Harwelle029af22018-05-24 17:13:28 -0700145# L7Rule options
146L7POLICY_ID = 'l7policy_id'
147VALUE = 'value'
148COMPARE_TYPE = 'compare_type'
149KEY = 'key'
150INVERT = 'invert'
151# Compare types
152EQUAL_TO = 'EQUAL_TO'
153STARTS_WITH = 'STARTS_WITH'
154ENDS_WITH = 'ENDS_WITH'
155CONTAINS = 'CONTAINS'
156REGEX = 'REGEX'
157# Types
158COOKIE = 'COOKIE'
159FILE_TYPE = 'FILE_TYPE'
160HEADER = 'HEADER'
161HOST_NAME = 'HOST_NAME'
162PATH = 'PATH'
163
Adam Harwell60ed9d92018-05-10 13:23:13 -0700164# RBAC options
165ADVANCED = 'advanced'
166OWNERADMIN = 'owner_or_admin'
167NONE = 'none'
168
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700169# Amphora fields
170COMPUTE_ID = 'compute_id'
171LB_NETWORK_IP = 'lb_network_ip'
172VRRP_IP = 'vrrp_ip'
173HA_IP = 'ha_ip'
174VRRP_PORT_ID = 'vrrp_port_id'
175HA_PORT_ID = 'ha_port_id'
176CERT_EXPIRATION = 'cert_expiration'
177CERT_BUSY = 'cert_busy'
178ROLE = 'role'
179STATUS = 'status'
180VRRP_INTERFACE = 'vrrp_interface'
181VRRP_ID = 'vrrp_id'
182VRRP_PRIORITY = 'vrrp_priority'
183CACHED_ZONE = 'cached_zone'
184IMAGE_ID = 'image_id'
185
186# Amphora roles
187ROLE_STANDALONE = 'STANDALONE'
188ROLE_MASTER = 'MASTER'
189ROLE_BACKUP = 'BACKUP'
190AMPHORA_ROLES = (ROLE_STANDALONE, ROLE_MASTER, ROLE_BACKUP)
191
192# Amphora statuses
193STATUS_BOOTING = 'BOOTING'
194STATUS_ALLOCATED = 'ALLOCATED'
195STATUS_READY = 'READY'
196STATUS_PENDING_CREATE = 'PENDING_CREATE'
197STATUS_PENDING_DELETE = 'PENDING_DELETE'
198STATUS_DELETED = 'DELETED'
199STATUS_ERROR = 'ERROR'
200AMPHORA_STATUSES = (
201 STATUS_BOOTING, STATUS_ALLOCATED, STATUS_READY, STATUS_PENDING_CREATE,
202 STATUS_PENDING_DELETE, STATUS_DELETED, STATUS_ERROR
203)
204
Ann Taraday7d0b5822019-10-17 15:28:30 +0400205# Amphora providers list
206AMPHORA_PROVIDERS = ['amphora', 'amphorav2', 'octavia']
207
Michael Johnsonaff2e862019-01-11 16:38:00 -0800208# Flavor capabilities
209LOADBALANCER_TOPOLOGY = 'loadbalancer_topology'
210
Jude Cross986e3f52017-07-24 14:57:20 -0700211# API valid fields
212SHOW_LOAD_BALANCER_RESPONSE_FIELDS = (
Adam Harwella795ae62018-04-23 12:11:19 -0700213 ADMIN_STATE_UP, CREATED_AT, DESCRIPTION, FLAVOR_ID, ID, LISTENERS, NAME,
Jude Cross986e3f52017-07-24 14:57:20 -0700214 OPERATING_STATUS, POOLS, PROJECT_ID, PROVIDER, PROVISIONING_STATUS,
215 UPDATED_AT, VIP_ADDRESS, VIP_NETWORK_ID, VIP_PORT_ID, VIP_SUBNET_ID,
216 VIP_QOS_POLICY_ID)
217
Michael Johnsondfd818a2018-08-21 20:54:54 -0700218SHOW_LISTENER_RESPONSE_FIELDS = [
Jude Crossfbbd2b42017-08-09 15:21:04 -0700219 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
220 ADMIN_STATE_UP, PROTOCOL, PROTOCOL_PORT, CONNECTION_LIMIT,
221 DEFAULT_TLS_CONTAINER_REF, SNI_CONTAINER_REFS, PROJECT_ID,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700222 DEFAULT_POOL_ID, L7_POLICIES, INSERT_HEADERS, CREATED_AT, UPDATED_AT
223]
Jude Crossfbbd2b42017-08-09 15:21:04 -0700224
Adam Harwell8ffce3e2018-05-01 21:18:44 -0700225SHOW_POOL_RESPONSE_FIELDS = (
226 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
227 ADMIN_STATE_UP, PROTOCOL, LB_ALGORITHM, SESSION_PERSISTENCE,
228 CREATED_AT, UPDATED_AT
229)
230
Michael Johnsondfd818a2018-08-21 20:54:54 -0700231SHOW_MEMBER_RESPONSE_FIELDS = [
Adam Harwellde3e0542018-05-03 18:21:06 -0700232 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700233 ADDRESS, PROTOCOL_PORT, WEIGHT, MONITOR_PORT, MONITOR_ADDRESS
234]
Adam Harwellde3e0542018-05-03 18:21:06 -0700235
Adam Harwell60ed9d92018-05-10 13:23:13 -0700236SHOW_HEALTHMONITOR_RESPONSE_FIELDS = (
237 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
238 TYPE, DELAY, TIMEOUT, MAX_RETRIES, MAX_RETRIES_DOWN, HTTP_METHOD,
239 URL_PATH, EXPECTED_CODES, CREATED_AT, UPDATED_AT
240)
Adam Harwell446f8be2018-05-24 16:51:03 -0700241
242SHOW_L7POLICY_RESPONSE_FIELDS = (
243 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
244 ADMIN_STATE_UP, LISTENER_ID, POSITION, ACTION, REDIRECT_URL,
245 REDIRECT_POOL_ID, CREATED_AT, UPDATED_AT
246)
Adam Harwelle029af22018-05-24 17:13:28 -0700247
248SHOW_L7RULE_RESPONSE_FIELDS = (
249 ID, ADMIN_STATE_UP, CREATED_AT, UPDATED_AT, TYPE, VALUE, COMPARE_TYPE,
250 KEY, INVERT
251)
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700252
Michael Johnsondfd818a2018-08-21 20:54:54 -0700253SHOW_AMPHORA_RESPONSE_FIELDS = [
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700254 ID, LOADBALANCER_ID, COMPUTE_ID, LB_NETWORK_IP, VRRP_IP, HA_IP,
255 VRRP_PORT_ID, HA_PORT_ID, CERT_EXPIRATION, CERT_BUSY, ROLE, STATUS,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700256 VRRP_INTERFACE, VRRP_ID, VRRP_PRIORITY, CACHED_ZONE
257]
Michael Johnsonaff2e862019-01-11 16:38:00 -0800258
259SHOW_FLAVOR_PROFILE_FIELDS = [ID, NAME, PROVIDER_NAME, FLAVOR_DATA]
Michael Johnsona2d03072019-01-14 17:18:21 -0800260
261SHOW_FLAVOR_FIELDS = [ID, NAME, DESCRIPTION, ENABLED, FLAVOR_PROFILE_ID]