blob: 5503b7fc3d9b286fa3b8f45a3cdcaf856d3343df [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'
87ADMIN_STATE_UP_TRUE = 'true'
88ASC = 'asc'
89DELETED = 'DELETED'
90DESC = 'desc'
91FIELDS = 'fields'
92OFFLINE = 'OFFLINE'
93ONLINE = 'ONLINE'
94NO_MONITOR = 'NO_MONITOR'
95ERROR = 'ERROR'
96SORT = 'sort'
Michael Johnsonaff2e862019-01-11 16:38:00 -080097SINGLE = 'SINGLE'
98ACTIVE_STANDBY = 'ACTIVE_STANDBY'
Adam Harwell60ed9d92018-05-10 13:23:13 -070099
100# Protocols
101HTTP = 'HTTP'
102HTTPS = 'HTTPS'
103TCP = 'TCP'
Carlos Goncalves9777f112019-05-02 12:22:45 -0600104TERMINATED_HTTPS = 'TERMINATED_HTTPS'
Adam Harwell60ed9d92018-05-10 13:23:13 -0700105
106# HTTP Methods
107GET = 'GET'
108POST = 'POST'
109PUT = 'PUT'
110DELETE = 'DELETE'
111
112# HM Types
113HEALTH_MONITOR_PING = 'PING'
114HEALTH_MONITOR_TCP = 'TCP'
115HEALTH_MONITOR_HTTP = 'HTTP'
116HEALTH_MONITOR_HTTPS = 'HTTPS'
117HEALTH_MONITOR_TLS_HELLO = 'TLS-HELLO'
118
119# Session Persistence
120TYPE = 'type'
121COOKIE_NAME = 'cookie_name'
122SESSION_PERSISTENCE_SOURCE_IP = 'SOURCE_IP'
123SESSION_PERSISTENCE_HTTP_COOKIE = 'HTTP_COOKIE'
124SESSION_PERSISTENCE_APP_COOKIE = 'APP_COOKIE'
125
Adam Harwell446f8be2018-05-24 16:51:03 -0700126# L7Policy options
127POSITION = 'position'
128REDIRECT_URL = 'redirect_url'
129REDIRECT_POOL_ID = 'redirect_pool_id'
130
131ACTION = 'action'
132REDIRECT_TO_POOL = 'REDIRECT_TO_POOL'
133REDIRECT_TO_URL = 'REDIRECT_TO_URL'
134REJECT = 'REJECT'
135
Adam Harwelle029af22018-05-24 17:13:28 -0700136# L7Rule options
137L7POLICY_ID = 'l7policy_id'
138VALUE = 'value'
139COMPARE_TYPE = 'compare_type'
140KEY = 'key'
141INVERT = 'invert'
142# Compare types
143EQUAL_TO = 'EQUAL_TO'
144STARTS_WITH = 'STARTS_WITH'
145ENDS_WITH = 'ENDS_WITH'
146CONTAINS = 'CONTAINS'
147REGEX = 'REGEX'
148# Types
149COOKIE = 'COOKIE'
150FILE_TYPE = 'FILE_TYPE'
151HEADER = 'HEADER'
152HOST_NAME = 'HOST_NAME'
153PATH = 'PATH'
154
Adam Harwell60ed9d92018-05-10 13:23:13 -0700155# RBAC options
156ADVANCED = 'advanced'
157OWNERADMIN = 'owner_or_admin'
158NONE = 'none'
159
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700160# Amphora fields
161COMPUTE_ID = 'compute_id'
162LB_NETWORK_IP = 'lb_network_ip'
163VRRP_IP = 'vrrp_ip'
164HA_IP = 'ha_ip'
165VRRP_PORT_ID = 'vrrp_port_id'
166HA_PORT_ID = 'ha_port_id'
167CERT_EXPIRATION = 'cert_expiration'
168CERT_BUSY = 'cert_busy'
169ROLE = 'role'
170STATUS = 'status'
171VRRP_INTERFACE = 'vrrp_interface'
172VRRP_ID = 'vrrp_id'
173VRRP_PRIORITY = 'vrrp_priority'
174CACHED_ZONE = 'cached_zone'
175IMAGE_ID = 'image_id'
176
177# Amphora roles
178ROLE_STANDALONE = 'STANDALONE'
179ROLE_MASTER = 'MASTER'
180ROLE_BACKUP = 'BACKUP'
181AMPHORA_ROLES = (ROLE_STANDALONE, ROLE_MASTER, ROLE_BACKUP)
182
183# Amphora statuses
184STATUS_BOOTING = 'BOOTING'
185STATUS_ALLOCATED = 'ALLOCATED'
186STATUS_READY = 'READY'
187STATUS_PENDING_CREATE = 'PENDING_CREATE'
188STATUS_PENDING_DELETE = 'PENDING_DELETE'
189STATUS_DELETED = 'DELETED'
190STATUS_ERROR = 'ERROR'
191AMPHORA_STATUSES = (
192 STATUS_BOOTING, STATUS_ALLOCATED, STATUS_READY, STATUS_PENDING_CREATE,
193 STATUS_PENDING_DELETE, STATUS_DELETED, STATUS_ERROR
194)
195
Michael Johnsonaff2e862019-01-11 16:38:00 -0800196# Flavor capabilities
197LOADBALANCER_TOPOLOGY = 'loadbalancer_topology'
198
Jude Cross986e3f52017-07-24 14:57:20 -0700199# API valid fields
200SHOW_LOAD_BALANCER_RESPONSE_FIELDS = (
Adam Harwella795ae62018-04-23 12:11:19 -0700201 ADMIN_STATE_UP, CREATED_AT, DESCRIPTION, FLAVOR_ID, ID, LISTENERS, NAME,
Jude Cross986e3f52017-07-24 14:57:20 -0700202 OPERATING_STATUS, POOLS, PROJECT_ID, PROVIDER, PROVISIONING_STATUS,
203 UPDATED_AT, VIP_ADDRESS, VIP_NETWORK_ID, VIP_PORT_ID, VIP_SUBNET_ID,
204 VIP_QOS_POLICY_ID)
205
Michael Johnsondfd818a2018-08-21 20:54:54 -0700206SHOW_LISTENER_RESPONSE_FIELDS = [
Jude Crossfbbd2b42017-08-09 15:21:04 -0700207 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
208 ADMIN_STATE_UP, PROTOCOL, PROTOCOL_PORT, CONNECTION_LIMIT,
209 DEFAULT_TLS_CONTAINER_REF, SNI_CONTAINER_REFS, PROJECT_ID,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700210 DEFAULT_POOL_ID, L7_POLICIES, INSERT_HEADERS, CREATED_AT, UPDATED_AT
211]
Jude Crossfbbd2b42017-08-09 15:21:04 -0700212
Adam Harwell8ffce3e2018-05-01 21:18:44 -0700213SHOW_POOL_RESPONSE_FIELDS = (
214 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
215 ADMIN_STATE_UP, PROTOCOL, LB_ALGORITHM, SESSION_PERSISTENCE,
216 CREATED_AT, UPDATED_AT
217)
218
Michael Johnsondfd818a2018-08-21 20:54:54 -0700219SHOW_MEMBER_RESPONSE_FIELDS = [
Adam Harwellde3e0542018-05-03 18:21:06 -0700220 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700221 ADDRESS, PROTOCOL_PORT, WEIGHT, MONITOR_PORT, MONITOR_ADDRESS
222]
Adam Harwellde3e0542018-05-03 18:21:06 -0700223
Adam Harwell60ed9d92018-05-10 13:23:13 -0700224SHOW_HEALTHMONITOR_RESPONSE_FIELDS = (
225 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
226 TYPE, DELAY, TIMEOUT, MAX_RETRIES, MAX_RETRIES_DOWN, HTTP_METHOD,
227 URL_PATH, EXPECTED_CODES, CREATED_AT, UPDATED_AT
228)
Adam Harwell446f8be2018-05-24 16:51:03 -0700229
230SHOW_L7POLICY_RESPONSE_FIELDS = (
231 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
232 ADMIN_STATE_UP, LISTENER_ID, POSITION, ACTION, REDIRECT_URL,
233 REDIRECT_POOL_ID, CREATED_AT, UPDATED_AT
234)
Adam Harwelle029af22018-05-24 17:13:28 -0700235
236SHOW_L7RULE_RESPONSE_FIELDS = (
237 ID, ADMIN_STATE_UP, CREATED_AT, UPDATED_AT, TYPE, VALUE, COMPARE_TYPE,
238 KEY, INVERT
239)
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700240
Michael Johnsondfd818a2018-08-21 20:54:54 -0700241SHOW_AMPHORA_RESPONSE_FIELDS = [
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700242 ID, LOADBALANCER_ID, COMPUTE_ID, LB_NETWORK_IP, VRRP_IP, HA_IP,
243 VRRP_PORT_ID, HA_PORT_ID, CERT_EXPIRATION, CERT_BUSY, ROLE, STATUS,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700244 VRRP_INTERFACE, VRRP_ID, VRRP_PRIORITY, CACHED_ZONE
245]
Michael Johnsonaff2e862019-01-11 16:38:00 -0800246
247SHOW_FLAVOR_PROFILE_FIELDS = [ID, NAME, PROVIDER_NAME, FLAVOR_DATA]
Michael Johnsona2d03072019-01-14 17:18:21 -0800248
249SHOW_FLAVOR_FIELDS = [ID, NAME, DESCRIPTION, ENABLED, FLAVOR_PROFILE_ID]