blob: 7ddcb7a489ce8414113250eb8df8bf84da34afd5 [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'
20CREATED_AT = 'created_at'
21DESCRIPTION = 'description'
Adam Harwella795ae62018-04-23 12:11:19 -070022FLAVOR_ID = 'flavor_id'
Jude Cross986e3f52017-07-24 14:57:20 -070023ID = 'id'
24LISTENERS = 'listeners'
25LOADBALANCER = 'loadbalancer'
26NAME = 'name'
27OPERATING_STATUS = 'operating_status'
28POOLS = 'pools'
29PROJECT_ID = 'project_id'
30PROVIDER = 'provider'
Michael Johnsonaff2e862019-01-11 16:38:00 -080031PROVIDER_NAME = 'provider_name'
Jude Cross986e3f52017-07-24 14:57:20 -070032PROVISIONING_STATUS = 'provisioning_status'
33REQUEST_ERRORS = 'request_errors'
34TOTAL_CONNECTIONS = 'total_connections'
35UPDATED_AT = 'updated_at'
36VIP_ADDRESS = 'vip_address'
37VIP_NETWORK_ID = 'vip_network_id'
38VIP_PORT_ID = 'vip_port_id'
39VIP_SUBNET_ID = 'vip_subnet_id'
40VIP_QOS_POLICY_ID = 'vip_qos_policy_id'
Jude Crossfbbd2b42017-08-09 15:21:04 -070041PROTOCOL = 'protocol'
42PROTOCOL_PORT = 'protocol_port'
43LOADBALANCER_ID = 'loadbalancer_id'
44CONNECTION_LIMIT = 'connection_limit'
45INSERT_HEADERS = 'insert_headers'
46X_FORWARDED_FOR = 'X-Forwarded-For'
47X_FORWARDED_PORT = 'X-Forwarded-Port'
48TIMEOUT_CLIENT_DATA = 'timeout_client_data'
49TIMEOUT_MEMBER_CONNECT = 'timeout_member_connect'
50TIMEOUT_MEMBER_DATA = 'timeout_member_data'
51TIMEOUT_TCP_INSPECT = 'timeout_tcp_inspect'
52DEFAULT_TLS_CONTAINER_REF = 'default_tls_container_ref'
53SNI_CONTAINER_REFS = 'sni_container_refs'
54DEFAULT_POOL_ID = 'default_pool_id'
55L7_POLICIES = 'l7_policies'
Jude Cross986e3f52017-07-24 14:57:20 -070056
Adam Harwell8ffce3e2018-05-01 21:18:44 -070057LB_ALGORITHM = 'lb_algorithm'
58LB_ALGORITHM_ROUND_ROBIN = 'ROUND_ROBIN'
59LB_ALGORITHM_LEAST_CONNECTIONS = 'LEAST_CONNECTIONS'
60LB_ALGORITHM_SOURCE_IP = 'SOURCE_IP'
61SESSION_PERSISTENCE = 'session_persistence'
62LISTENER_ID = 'listener_id'
63LOADBALANCERS = 'loadbalancers'
64
Adam Harwellde3e0542018-05-03 18:21:06 -070065POOL_ID = 'pool_id'
66ADDRESS = 'address'
67WEIGHT = 'weight'
68BACKUP = 'backup'
69SUBNET_ID = 'subnet_id'
70MONITOR_ADDRESS = 'monitor_address'
71MONITOR_PORT = 'monitor_port'
72
Adam Harwell60ed9d92018-05-10 13:23:13 -070073DELAY = 'delay'
74TIMEOUT = 'timeout'
75MAX_RETRIES = 'max_retries'
76MAX_RETRIES_DOWN = 'max_retries_down'
77HTTP_METHOD = 'http_method'
78URL_PATH = 'url_path'
79EXPECTED_CODES = 'expected_codes'
80
Michael Johnsonaff2e862019-01-11 16:38:00 -080081FLAVOR_DATA = 'flavor_data'
Michael Johnsona2d03072019-01-14 17:18:21 -080082ENABLED = 'enabled'
83FLAVOR_PROFILE_ID = 'flavor_profile_id'
Michael Johnsonaff2e862019-01-11 16:38:00 -080084
Adam Harwell60ed9d92018-05-10 13:23:13 -070085# Other constants
86ACTIVE = 'ACTIVE'
Carlos Goncalvesc2e12162019-02-14 23:57:44 +010087PENDING_UPDATE = 'PENDING_UPDATE'
Adam Harwell60ed9d92018-05-10 13:23:13 -070088ADMIN_STATE_UP_TRUE = 'true'
89ASC = 'asc'
90DELETED = 'DELETED'
91DESC = 'desc'
92FIELDS = 'fields'
93OFFLINE = 'OFFLINE'
94ONLINE = 'ONLINE'
95NO_MONITOR = 'NO_MONITOR'
96ERROR = 'ERROR'
97SORT = 'sort'
Michael Johnsonaff2e862019-01-11 16:38:00 -080098SINGLE = 'SINGLE'
99ACTIVE_STANDBY = 'ACTIVE_STANDBY'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700100
101# Protocols
102HTTP = 'HTTP'
103HTTPS = 'HTTPS'
104TCP = 'TCP'
Carlos Goncalves9777f112019-05-02 12:22:45 -0600105TERMINATED_HTTPS = 'TERMINATED_HTTPS'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700106
107# HTTP Methods
108GET = 'GET'
109POST = 'POST'
110PUT = 'PUT'
111DELETE = 'DELETE'
112
113# HM Types
114HEALTH_MONITOR_PING = 'PING'
115HEALTH_MONITOR_TCP = 'TCP'
116HEALTH_MONITOR_HTTP = 'HTTP'
117HEALTH_MONITOR_HTTPS = 'HTTPS'
118HEALTH_MONITOR_TLS_HELLO = 'TLS-HELLO'
119
120# Session Persistence
121TYPE = 'type'
122COOKIE_NAME = 'cookie_name'
123SESSION_PERSISTENCE_SOURCE_IP = 'SOURCE_IP'
124SESSION_PERSISTENCE_HTTP_COOKIE = 'HTTP_COOKIE'
125SESSION_PERSISTENCE_APP_COOKIE = 'APP_COOKIE'
126
Adam Harwell446f8be2018-05-24 16:51:03 -0700127# L7Policy options
128POSITION = 'position'
129REDIRECT_URL = 'redirect_url'
130REDIRECT_POOL_ID = 'redirect_pool_id'
131
132ACTION = 'action'
133REDIRECT_TO_POOL = 'REDIRECT_TO_POOL'
134REDIRECT_TO_URL = 'REDIRECT_TO_URL'
135REJECT = 'REJECT'
136
Adam Harwelle029af22018-05-24 17:13:28 -0700137# L7Rule options
138L7POLICY_ID = 'l7policy_id'
139VALUE = 'value'
140COMPARE_TYPE = 'compare_type'
141KEY = 'key'
142INVERT = 'invert'
143# Compare types
144EQUAL_TO = 'EQUAL_TO'
145STARTS_WITH = 'STARTS_WITH'
146ENDS_WITH = 'ENDS_WITH'
147CONTAINS = 'CONTAINS'
148REGEX = 'REGEX'
149# Types
150COOKIE = 'COOKIE'
151FILE_TYPE = 'FILE_TYPE'
152HEADER = 'HEADER'
153HOST_NAME = 'HOST_NAME'
154PATH = 'PATH'
155
Adam Harwell60ed9d92018-05-10 13:23:13 -0700156# RBAC options
157ADVANCED = 'advanced'
158OWNERADMIN = 'owner_or_admin'
159NONE = 'none'
160
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700161# Amphora fields
162COMPUTE_ID = 'compute_id'
163LB_NETWORK_IP = 'lb_network_ip'
164VRRP_IP = 'vrrp_ip'
165HA_IP = 'ha_ip'
166VRRP_PORT_ID = 'vrrp_port_id'
167HA_PORT_ID = 'ha_port_id'
168CERT_EXPIRATION = 'cert_expiration'
169CERT_BUSY = 'cert_busy'
170ROLE = 'role'
171STATUS = 'status'
172VRRP_INTERFACE = 'vrrp_interface'
173VRRP_ID = 'vrrp_id'
174VRRP_PRIORITY = 'vrrp_priority'
175CACHED_ZONE = 'cached_zone'
176IMAGE_ID = 'image_id'
177
178# Amphora roles
179ROLE_STANDALONE = 'STANDALONE'
180ROLE_MASTER = 'MASTER'
181ROLE_BACKUP = 'BACKUP'
182AMPHORA_ROLES = (ROLE_STANDALONE, ROLE_MASTER, ROLE_BACKUP)
183
184# Amphora statuses
185STATUS_BOOTING = 'BOOTING'
186STATUS_ALLOCATED = 'ALLOCATED'
187STATUS_READY = 'READY'
188STATUS_PENDING_CREATE = 'PENDING_CREATE'
189STATUS_PENDING_DELETE = 'PENDING_DELETE'
190STATUS_DELETED = 'DELETED'
191STATUS_ERROR = 'ERROR'
192AMPHORA_STATUSES = (
193 STATUS_BOOTING, STATUS_ALLOCATED, STATUS_READY, STATUS_PENDING_CREATE,
194 STATUS_PENDING_DELETE, STATUS_DELETED, STATUS_ERROR
195)
196
Michael Johnsonaff2e862019-01-11 16:38:00 -0800197# Flavor capabilities
198LOADBALANCER_TOPOLOGY = 'loadbalancer_topology'
199
Jude Cross986e3f52017-07-24 14:57:20 -0700200# API valid fields
201SHOW_LOAD_BALANCER_RESPONSE_FIELDS = (
Adam Harwella795ae62018-04-23 12:11:19 -0700202 ADMIN_STATE_UP, CREATED_AT, DESCRIPTION, FLAVOR_ID, ID, LISTENERS, NAME,
Jude Cross986e3f52017-07-24 14:57:20 -0700203 OPERATING_STATUS, POOLS, PROJECT_ID, PROVIDER, PROVISIONING_STATUS,
204 UPDATED_AT, VIP_ADDRESS, VIP_NETWORK_ID, VIP_PORT_ID, VIP_SUBNET_ID,
205 VIP_QOS_POLICY_ID)
206
Michael Johnsondfd818a2018-08-21 20:54:54 -0700207SHOW_LISTENER_RESPONSE_FIELDS = [
Jude Crossfbbd2b42017-08-09 15:21:04 -0700208 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
209 ADMIN_STATE_UP, PROTOCOL, PROTOCOL_PORT, CONNECTION_LIMIT,
210 DEFAULT_TLS_CONTAINER_REF, SNI_CONTAINER_REFS, PROJECT_ID,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700211 DEFAULT_POOL_ID, L7_POLICIES, INSERT_HEADERS, CREATED_AT, UPDATED_AT
212]
Jude Crossfbbd2b42017-08-09 15:21:04 -0700213
Adam Harwell8ffce3e2018-05-01 21:18:44 -0700214SHOW_POOL_RESPONSE_FIELDS = (
215 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
216 ADMIN_STATE_UP, PROTOCOL, LB_ALGORITHM, SESSION_PERSISTENCE,
217 CREATED_AT, UPDATED_AT
218)
219
Michael Johnsondfd818a2018-08-21 20:54:54 -0700220SHOW_MEMBER_RESPONSE_FIELDS = [
Adam Harwellde3e0542018-05-03 18:21:06 -0700221 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700222 ADDRESS, PROTOCOL_PORT, WEIGHT, MONITOR_PORT, MONITOR_ADDRESS
223]
Adam Harwellde3e0542018-05-03 18:21:06 -0700224
Adam Harwell60ed9d92018-05-10 13:23:13 -0700225SHOW_HEALTHMONITOR_RESPONSE_FIELDS = (
226 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
227 TYPE, DELAY, TIMEOUT, MAX_RETRIES, MAX_RETRIES_DOWN, HTTP_METHOD,
228 URL_PATH, EXPECTED_CODES, CREATED_AT, UPDATED_AT
229)
Adam Harwell446f8be2018-05-24 16:51:03 -0700230
231SHOW_L7POLICY_RESPONSE_FIELDS = (
232 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
233 ADMIN_STATE_UP, LISTENER_ID, POSITION, ACTION, REDIRECT_URL,
234 REDIRECT_POOL_ID, CREATED_AT, UPDATED_AT
235)
Adam Harwelle029af22018-05-24 17:13:28 -0700236
237SHOW_L7RULE_RESPONSE_FIELDS = (
238 ID, ADMIN_STATE_UP, CREATED_AT, UPDATED_AT, TYPE, VALUE, COMPARE_TYPE,
239 KEY, INVERT
240)
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700241
Michael Johnsondfd818a2018-08-21 20:54:54 -0700242SHOW_AMPHORA_RESPONSE_FIELDS = [
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700243 ID, LOADBALANCER_ID, COMPUTE_ID, LB_NETWORK_IP, VRRP_IP, HA_IP,
244 VRRP_PORT_ID, HA_PORT_ID, CERT_EXPIRATION, CERT_BUSY, ROLE, STATUS,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700245 VRRP_INTERFACE, VRRP_ID, VRRP_PRIORITY, CACHED_ZONE
246]
Michael Johnsonaff2e862019-01-11 16:38:00 -0800247
248SHOW_FLAVOR_PROFILE_FIELDS = [ID, NAME, PROVIDER_NAME, FLAVOR_DATA]
Michael Johnsona2d03072019-01-14 17:18:21 -0800249
250SHOW_FLAVOR_FIELDS = [ID, NAME, DESCRIPTION, ENABLED, FLAVOR_PROFILE_ID]