blob: 4154e7ba586d80a6b9c65b21f1ec2ff15ee981d4 [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'
31PROVISIONING_STATUS = 'provisioning_status'
32REQUEST_ERRORS = 'request_errors'
33TOTAL_CONNECTIONS = 'total_connections'
34UPDATED_AT = 'updated_at'
35VIP_ADDRESS = 'vip_address'
36VIP_NETWORK_ID = 'vip_network_id'
37VIP_PORT_ID = 'vip_port_id'
38VIP_SUBNET_ID = 'vip_subnet_id'
39VIP_QOS_POLICY_ID = 'vip_qos_policy_id'
Jude Crossfbbd2b42017-08-09 15:21:04 -070040PROTOCOL = 'protocol'
41PROTOCOL_PORT = 'protocol_port'
42LOADBALANCER_ID = 'loadbalancer_id'
43CONNECTION_LIMIT = 'connection_limit'
44INSERT_HEADERS = 'insert_headers'
45X_FORWARDED_FOR = 'X-Forwarded-For'
46X_FORWARDED_PORT = 'X-Forwarded-Port'
47TIMEOUT_CLIENT_DATA = 'timeout_client_data'
48TIMEOUT_MEMBER_CONNECT = 'timeout_member_connect'
49TIMEOUT_MEMBER_DATA = 'timeout_member_data'
50TIMEOUT_TCP_INSPECT = 'timeout_tcp_inspect'
51DEFAULT_TLS_CONTAINER_REF = 'default_tls_container_ref'
52SNI_CONTAINER_REFS = 'sni_container_refs'
53DEFAULT_POOL_ID = 'default_pool_id'
54L7_POLICIES = 'l7_policies'
Jude Cross986e3f52017-07-24 14:57:20 -070055
Adam Harwell8ffce3e2018-05-01 21:18:44 -070056LB_ALGORITHM = 'lb_algorithm'
57LB_ALGORITHM_ROUND_ROBIN = 'ROUND_ROBIN'
58LB_ALGORITHM_LEAST_CONNECTIONS = 'LEAST_CONNECTIONS'
59LB_ALGORITHM_SOURCE_IP = 'SOURCE_IP'
60SESSION_PERSISTENCE = 'session_persistence'
61LISTENER_ID = 'listener_id'
62LOADBALANCERS = 'loadbalancers'
63
Adam Harwellde3e0542018-05-03 18:21:06 -070064POOL_ID = 'pool_id'
65ADDRESS = 'address'
66WEIGHT = 'weight'
67BACKUP = 'backup'
68SUBNET_ID = 'subnet_id'
69MONITOR_ADDRESS = 'monitor_address'
70MONITOR_PORT = 'monitor_port'
71
Adam Harwell60ed9d92018-05-10 13:23:13 -070072DELAY = 'delay'
73TIMEOUT = 'timeout'
74MAX_RETRIES = 'max_retries'
75MAX_RETRIES_DOWN = 'max_retries_down'
76HTTP_METHOD = 'http_method'
77URL_PATH = 'url_path'
78EXPECTED_CODES = 'expected_codes'
79
80# Other constants
81ACTIVE = 'ACTIVE'
82ADMIN_STATE_UP_TRUE = 'true'
83ASC = 'asc'
84DELETED = 'DELETED'
85DESC = 'desc'
86FIELDS = 'fields'
87OFFLINE = 'OFFLINE'
88ONLINE = 'ONLINE'
89NO_MONITOR = 'NO_MONITOR'
90ERROR = 'ERROR'
91SORT = 'sort'
92
93# Protocols
94HTTP = 'HTTP'
95HTTPS = 'HTTPS'
96TCP = 'TCP'
97
98# HTTP Methods
99GET = 'GET'
100POST = 'POST'
101PUT = 'PUT'
102DELETE = 'DELETE'
103
104# HM Types
105HEALTH_MONITOR_PING = 'PING'
106HEALTH_MONITOR_TCP = 'TCP'
107HEALTH_MONITOR_HTTP = 'HTTP'
108HEALTH_MONITOR_HTTPS = 'HTTPS'
109HEALTH_MONITOR_TLS_HELLO = 'TLS-HELLO'
110
111# Session Persistence
112TYPE = 'type'
113COOKIE_NAME = 'cookie_name'
114SESSION_PERSISTENCE_SOURCE_IP = 'SOURCE_IP'
115SESSION_PERSISTENCE_HTTP_COOKIE = 'HTTP_COOKIE'
116SESSION_PERSISTENCE_APP_COOKIE = 'APP_COOKIE'
117
Adam Harwell446f8be2018-05-24 16:51:03 -0700118# L7Policy options
119POSITION = 'position'
120REDIRECT_URL = 'redirect_url'
121REDIRECT_POOL_ID = 'redirect_pool_id'
122
123ACTION = 'action'
124REDIRECT_TO_POOL = 'REDIRECT_TO_POOL'
125REDIRECT_TO_URL = 'REDIRECT_TO_URL'
126REJECT = 'REJECT'
127
Adam Harwelle029af22018-05-24 17:13:28 -0700128# L7Rule options
129L7POLICY_ID = 'l7policy_id'
130VALUE = 'value'
131COMPARE_TYPE = 'compare_type'
132KEY = 'key'
133INVERT = 'invert'
134# Compare types
135EQUAL_TO = 'EQUAL_TO'
136STARTS_WITH = 'STARTS_WITH'
137ENDS_WITH = 'ENDS_WITH'
138CONTAINS = 'CONTAINS'
139REGEX = 'REGEX'
140# Types
141COOKIE = 'COOKIE'
142FILE_TYPE = 'FILE_TYPE'
143HEADER = 'HEADER'
144HOST_NAME = 'HOST_NAME'
145PATH = 'PATH'
146
Adam Harwell60ed9d92018-05-10 13:23:13 -0700147# RBAC options
148ADVANCED = 'advanced'
149OWNERADMIN = 'owner_or_admin'
150NONE = 'none'
151
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700152# Amphora fields
153COMPUTE_ID = 'compute_id'
154LB_NETWORK_IP = 'lb_network_ip'
155VRRP_IP = 'vrrp_ip'
156HA_IP = 'ha_ip'
157VRRP_PORT_ID = 'vrrp_port_id'
158HA_PORT_ID = 'ha_port_id'
159CERT_EXPIRATION = 'cert_expiration'
160CERT_BUSY = 'cert_busy'
161ROLE = 'role'
162STATUS = 'status'
163VRRP_INTERFACE = 'vrrp_interface'
164VRRP_ID = 'vrrp_id'
165VRRP_PRIORITY = 'vrrp_priority'
166CACHED_ZONE = 'cached_zone'
167IMAGE_ID = 'image_id'
168
169# Amphora roles
170ROLE_STANDALONE = 'STANDALONE'
171ROLE_MASTER = 'MASTER'
172ROLE_BACKUP = 'BACKUP'
173AMPHORA_ROLES = (ROLE_STANDALONE, ROLE_MASTER, ROLE_BACKUP)
174
175# Amphora statuses
176STATUS_BOOTING = 'BOOTING'
177STATUS_ALLOCATED = 'ALLOCATED'
178STATUS_READY = 'READY'
179STATUS_PENDING_CREATE = 'PENDING_CREATE'
180STATUS_PENDING_DELETE = 'PENDING_DELETE'
181STATUS_DELETED = 'DELETED'
182STATUS_ERROR = 'ERROR'
183AMPHORA_STATUSES = (
184 STATUS_BOOTING, STATUS_ALLOCATED, STATUS_READY, STATUS_PENDING_CREATE,
185 STATUS_PENDING_DELETE, STATUS_DELETED, STATUS_ERROR
186)
187
Jude Cross986e3f52017-07-24 14:57:20 -0700188# API valid fields
189SHOW_LOAD_BALANCER_RESPONSE_FIELDS = (
Adam Harwella795ae62018-04-23 12:11:19 -0700190 ADMIN_STATE_UP, CREATED_AT, DESCRIPTION, FLAVOR_ID, ID, LISTENERS, NAME,
Jude Cross986e3f52017-07-24 14:57:20 -0700191 OPERATING_STATUS, POOLS, PROJECT_ID, PROVIDER, PROVISIONING_STATUS,
192 UPDATED_AT, VIP_ADDRESS, VIP_NETWORK_ID, VIP_PORT_ID, VIP_SUBNET_ID,
193 VIP_QOS_POLICY_ID)
194
Michael Johnsondfd818a2018-08-21 20:54:54 -0700195SHOW_LISTENER_RESPONSE_FIELDS = [
Jude Crossfbbd2b42017-08-09 15:21:04 -0700196 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
197 ADMIN_STATE_UP, PROTOCOL, PROTOCOL_PORT, CONNECTION_LIMIT,
198 DEFAULT_TLS_CONTAINER_REF, SNI_CONTAINER_REFS, PROJECT_ID,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700199 DEFAULT_POOL_ID, L7_POLICIES, INSERT_HEADERS, CREATED_AT, UPDATED_AT
200]
Jude Crossfbbd2b42017-08-09 15:21:04 -0700201
Adam Harwell8ffce3e2018-05-01 21:18:44 -0700202SHOW_POOL_RESPONSE_FIELDS = (
203 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
204 ADMIN_STATE_UP, PROTOCOL, LB_ALGORITHM, SESSION_PERSISTENCE,
205 CREATED_AT, UPDATED_AT
206)
207
Michael Johnsondfd818a2018-08-21 20:54:54 -0700208SHOW_MEMBER_RESPONSE_FIELDS = [
Adam Harwellde3e0542018-05-03 18:21:06 -0700209 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700210 ADDRESS, PROTOCOL_PORT, WEIGHT, MONITOR_PORT, MONITOR_ADDRESS
211]
Adam Harwellde3e0542018-05-03 18:21:06 -0700212
Adam Harwell60ed9d92018-05-10 13:23:13 -0700213SHOW_HEALTHMONITOR_RESPONSE_FIELDS = (
214 ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP,
215 TYPE, DELAY, TIMEOUT, MAX_RETRIES, MAX_RETRIES_DOWN, HTTP_METHOD,
216 URL_PATH, EXPECTED_CODES, CREATED_AT, UPDATED_AT
217)
Adam Harwell446f8be2018-05-24 16:51:03 -0700218
219SHOW_L7POLICY_RESPONSE_FIELDS = (
220 ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS,
221 ADMIN_STATE_UP, LISTENER_ID, POSITION, ACTION, REDIRECT_URL,
222 REDIRECT_POOL_ID, CREATED_AT, UPDATED_AT
223)
Adam Harwelle029af22018-05-24 17:13:28 -0700224
225SHOW_L7RULE_RESPONSE_FIELDS = (
226 ID, ADMIN_STATE_UP, CREATED_AT, UPDATED_AT, TYPE, VALUE, COMPARE_TYPE,
227 KEY, INVERT
228)
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700229
Michael Johnsondfd818a2018-08-21 20:54:54 -0700230SHOW_AMPHORA_RESPONSE_FIELDS = [
Adam Harwelldfc11ee2018-05-30 09:38:55 -0700231 ID, LOADBALANCER_ID, COMPUTE_ID, LB_NETWORK_IP, VRRP_IP, HA_IP,
232 VRRP_PORT_ID, HA_PORT_ID, CERT_EXPIRATION, CERT_BUSY, ROLE, STATUS,
Michael Johnsondfd818a2018-08-21 20:54:54 -0700233 VRRP_INTERFACE, VRRP_ID, VRRP_PRIORITY, CACHED_ZONE
234]