blob: 0122424ecc81ea29af24081bc141e29f8aef2b53 [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'
104
105# HTTP Methods
106GET = 'GET'
107POST = 'POST'
108PUT = 'PUT'
109DELETE = 'DELETE'
110
111# HM Types
112HEALTH_MONITOR_PING = 'PING'
113HEALTH_MONITOR_TCP = 'TCP'
114HEALTH_MONITOR_HTTP = 'HTTP'
115HEALTH_MONITOR_HTTPS = 'HTTPS'
116HEALTH_MONITOR_TLS_HELLO = 'TLS-HELLO'
117
118# Session Persistence
119TYPE = 'type'
120COOKIE_NAME = 'cookie_name'
121SESSION_PERSISTENCE_SOURCE_IP = 'SOURCE_IP'
122SESSION_PERSISTENCE_HTTP_COOKIE = 'HTTP_COOKIE'
123SESSION_PERSISTENCE_APP_COOKIE = 'APP_COOKIE'
124
Adam Harwell446f8be2018-05-24 16:51:03 -0700125# L7Policy options
126POSITION = 'position'
127REDIRECT_URL = 'redirect_url'
128REDIRECT_POOL_ID = 'redirect_pool_id'
129
130ACTION = 'action'
131REDIRECT_TO_POOL = 'REDIRECT_TO_POOL'
132REDIRECT_TO_URL = 'REDIRECT_TO_URL'
133REJECT = 'REJECT'
134
Adam Harwelle029af22018-05-24 17:13:28 -0700135# L7Rule options
136L7POLICY_ID = 'l7policy_id'
137VALUE = 'value'
138COMPARE_TYPE = 'compare_type'
139KEY = 'key'
140INVERT = 'invert'
141# Compare types
142EQUAL_TO = 'EQUAL_TO'
143STARTS_WITH = 'STARTS_WITH'
144ENDS_WITH = 'ENDS_WITH'
145CONTAINS = 'CONTAINS'
146REGEX = 'REGEX'
147# Types
148COOKIE = 'COOKIE'
149FILE_TYPE = 'FILE_TYPE'
150HEADER = 'HEADER'
151HOST_NAME = 'HOST_NAME'
152PATH = 'PATH'
153
Adam Harwell60ed9d92018-05-10 13:23:13 -0700154# RBAC options
155ADVANCED = 'advanced'
156OWNERADMIN = 'owner_or_admin'
157NONE = 'none'
158
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700159# Amphora fields
160COMPUTE_ID = 'compute_id'
161LB_NETWORK_IP = 'lb_network_ip'
162VRRP_IP = 'vrrp_ip'
163HA_IP = 'ha_ip'
164VRRP_PORT_ID = 'vrrp_port_id'
165HA_PORT_ID = 'ha_port_id'
166CERT_EXPIRATION = 'cert_expiration'
167CERT_BUSY = 'cert_busy'
168ROLE = 'role'
169STATUS = 'status'
170VRRP_INTERFACE = 'vrrp_interface'
171VRRP_ID = 'vrrp_id'
172VRRP_PRIORITY = 'vrrp_priority'
173CACHED_ZONE = 'cached_zone'
174IMAGE_ID = 'image_id'
175
176# Amphora roles
177ROLE_STANDALONE = 'STANDALONE'
178ROLE_MASTER = 'MASTER'
179ROLE_BACKUP = 'BACKUP'
180AMPHORA_ROLES = (ROLE_STANDALONE, ROLE_MASTER, ROLE_BACKUP)
181
182# Amphora statuses
183STATUS_BOOTING = 'BOOTING'
184STATUS_ALLOCATED = 'ALLOCATED'
185STATUS_READY = 'READY'
186STATUS_PENDING_CREATE = 'PENDING_CREATE'
187STATUS_PENDING_DELETE = 'PENDING_DELETE'
188STATUS_DELETED = 'DELETED'
189STATUS_ERROR = 'ERROR'
190AMPHORA_STATUSES = (
191 STATUS_BOOTING, STATUS_ALLOCATED, STATUS_READY, STATUS_PENDING_CREATE,
192 STATUS_PENDING_DELETE, STATUS_DELETED, STATUS_ERROR
193)
194
Michael Johnsonaff2e862019-01-11 16:38:00 -0800195# Flavor capabilities
196LOADBALANCER_TOPOLOGY = 'loadbalancer_topology'
197
Jude Cross986e3f52017-07-24 14:57:20 -0700198# API valid fields
199SHOW_LOAD_BALANCER_RESPONSE_FIELDS = (
Adam Harwella795ae62018-04-23 12:11:19 -0700200 ADMIN_STATE_UP, CREATED_AT, DESCRIPTION, FLAVOR_ID, ID, LISTENERS, NAME,
Jude Cross986e3f52017-07-24 14:57:20 -0700201 OPERATING_STATUS, POOLS, PROJECT_ID, PROVIDER, PROVISIONING_STATUS,
202 UPDATED_AT, VIP_ADDRESS, VIP_NETWORK_ID, VIP_PORT_ID, VIP_SUBNET_ID,
203 VIP_QOS_POLICY_ID)
204
Michael Johnsondfd818a2018-08-21 20:54:54 -0700205SHOW_LISTENER_RESPONSE_FIELDS = [
Jude Crossfbbd2b42017-08-09 15:21:04 -0700206 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
207 ADMIN_STATE_UP, PROTOCOL, PROTOCOL_PORT, CONNECTION_LIMIT,
208 DEFAULT_TLS_CONTAINER_REF, SNI_CONTAINER_REFS, PROJECT_ID,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700209 DEFAULT_POOL_ID, L7_POLICIES, INSERT_HEADERS, CREATED_AT, UPDATED_AT
210]
Jude Crossfbbd2b42017-08-09 15:21:04 -0700211
Adam Harwell8ffce3e2018-05-01 21:18:44 -0700212SHOW_POOL_RESPONSE_FIELDS = (
213 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
214 ADMIN_STATE_UP, PROTOCOL, LB_ALGORITHM, SESSION_PERSISTENCE,
215 CREATED_AT, UPDATED_AT
216)
217
Michael Johnsondfd818a2018-08-21 20:54:54 -0700218SHOW_MEMBER_RESPONSE_FIELDS = [
Adam Harwellde3e0542018-05-03 18:21:06 -0700219 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700220 ADDRESS, PROTOCOL_PORT, WEIGHT, MONITOR_PORT, MONITOR_ADDRESS
221]
Adam Harwellde3e0542018-05-03 18:21:06 -0700222
Adam Harwell60ed9d92018-05-10 13:23:13 -0700223SHOW_HEALTHMONITOR_RESPONSE_FIELDS = (
224 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
225 TYPE, DELAY, TIMEOUT, MAX_RETRIES, MAX_RETRIES_DOWN, HTTP_METHOD,
226 URL_PATH, EXPECTED_CODES, CREATED_AT, UPDATED_AT
227)
Adam Harwell446f8be2018-05-24 16:51:03 -0700228
229SHOW_L7POLICY_RESPONSE_FIELDS = (
230 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
231 ADMIN_STATE_UP, LISTENER_ID, POSITION, ACTION, REDIRECT_URL,
232 REDIRECT_POOL_ID, CREATED_AT, UPDATED_AT
233)
Adam Harwelle029af22018-05-24 17:13:28 -0700234
235SHOW_L7RULE_RESPONSE_FIELDS = (
236 ID, ADMIN_STATE_UP, CREATED_AT, UPDATED_AT, TYPE, VALUE, COMPARE_TYPE,
237 KEY, INVERT
238)
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700239
Michael Johnsondfd818a2018-08-21 20:54:54 -0700240SHOW_AMPHORA_RESPONSE_FIELDS = [
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700241 ID, LOADBALANCER_ID, COMPUTE_ID, LB_NETWORK_IP, VRRP_IP, HA_IP,
242 VRRP_PORT_ID, HA_PORT_ID, CERT_EXPIRATION, CERT_BUSY, ROLE, STATUS,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700243 VRRP_INTERFACE, VRRP_ID, VRRP_PRIORITY, CACHED_ZONE
244]
Michael Johnsonaff2e862019-01-11 16:38:00 -0800245
246SHOW_FLAVOR_PROFILE_FIELDS = [ID, NAME, PROVIDER_NAME, FLAVOR_DATA]
Michael Johnsona2d03072019-01-14 17:18:21 -0800247
248SHOW_FLAVOR_FIELDS = [ID, NAME, DESCRIPTION, ENABLED, FLAVOR_PROFILE_ID]