Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 1 | # 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 |
| 16 | ACTIVE_CONNECTIONS = 'active_connections' |
Adam Harwell | c2aa20c | 2019-11-20 11:15:07 -0800 | [diff] [blame] | 17 | AVAILABILITY_ZONE = 'availability_zone' |
| 18 | AVAILABILITY_ZONE_DATA = 'availability_zone_data' |
| 19 | AVAILABILITY_ZONE_PROFILE_ID = 'availability_zone_profile_id' |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 20 | ADMIN_STATE_UP = 'admin_state_up' |
| 21 | BYTES_IN = 'bytes_in' |
| 22 | BYTES_OUT = 'bytes_out' |
Michael Johnson | 6378663 | 2019-11-08 23:22:13 -0800 | [diff] [blame] | 23 | CLIENT_AUTHENTICATION = 'client_authentication' |
| 24 | CLIENT_AUTH_NONE = 'NONE' |
| 25 | CLIENT_AUTH_OPTIONAL = 'OPTIONAL' |
| 26 | CLIENT_AUTH_MANDATORY = 'MANDATORY' |
| 27 | CLIENT_CA_TLS_CONTAINER_REF = 'client_ca_tls_container_ref' |
| 28 | CLIENT_CRL_CONTAINER_REF = 'client_crl_container_ref' |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 29 | CREATED_AT = 'created_at' |
| 30 | DESCRIPTION = 'description' |
Adam Harwell | c2aa20c | 2019-11-20 11:15:07 -0800 | [diff] [blame] | 31 | FLAVOR_DATA = 'flavor_data' |
Adam Harwell | a795ae6 | 2018-04-23 12:11:19 -0700 | [diff] [blame] | 32 | FLAVOR_ID = 'flavor_id' |
Adam Harwell | c2aa20c | 2019-11-20 11:15:07 -0800 | [diff] [blame] | 33 | FLAVOR_PROFILE_ID = 'flavor_profile_id' |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 34 | ID = 'id' |
| 35 | LISTENERS = 'listeners' |
| 36 | LOADBALANCER = 'loadbalancer' |
| 37 | NAME = 'name' |
| 38 | OPERATING_STATUS = 'operating_status' |
| 39 | POOLS = 'pools' |
| 40 | PROJECT_ID = 'project_id' |
| 41 | PROVIDER = 'provider' |
Michael Johnson | aff2e86 | 2019-01-11 16:38:00 -0800 | [diff] [blame] | 42 | PROVIDER_NAME = 'provider_name' |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 43 | PROVISIONING_STATUS = 'provisioning_status' |
| 44 | REQUEST_ERRORS = 'request_errors' |
| 45 | TOTAL_CONNECTIONS = 'total_connections' |
| 46 | UPDATED_AT = 'updated_at' |
| 47 | VIP_ADDRESS = 'vip_address' |
| 48 | VIP_NETWORK_ID = 'vip_network_id' |
| 49 | VIP_PORT_ID = 'vip_port_id' |
| 50 | VIP_SUBNET_ID = 'vip_subnet_id' |
| 51 | VIP_QOS_POLICY_ID = 'vip_qos_policy_id' |
Jude Cross | fbbd2b4 | 2017-08-09 15:21:04 -0700 | [diff] [blame] | 52 | PROTOCOL = 'protocol' |
| 53 | PROTOCOL_PORT = 'protocol_port' |
| 54 | LOADBALANCER_ID = 'loadbalancer_id' |
| 55 | CONNECTION_LIMIT = 'connection_limit' |
| 56 | INSERT_HEADERS = 'insert_headers' |
| 57 | X_FORWARDED_FOR = 'X-Forwarded-For' |
| 58 | X_FORWARDED_PORT = 'X-Forwarded-Port' |
oschwart | 540bb3b | 2020-06-16 18:23:53 +0300 | [diff] [blame^] | 59 | TAGS = 'tags' |
Jude Cross | fbbd2b4 | 2017-08-09 15:21:04 -0700 | [diff] [blame] | 60 | TIMEOUT_CLIENT_DATA = 'timeout_client_data' |
| 61 | TIMEOUT_MEMBER_CONNECT = 'timeout_member_connect' |
| 62 | TIMEOUT_MEMBER_DATA = 'timeout_member_data' |
| 63 | TIMEOUT_TCP_INSPECT = 'timeout_tcp_inspect' |
| 64 | DEFAULT_TLS_CONTAINER_REF = 'default_tls_container_ref' |
| 65 | SNI_CONTAINER_REFS = 'sni_container_refs' |
| 66 | DEFAULT_POOL_ID = 'default_pool_id' |
| 67 | L7_POLICIES = 'l7_policies' |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 68 | |
Adam Harwell | 8ffce3e | 2018-05-01 21:18:44 -0700 | [diff] [blame] | 69 | LB_ALGORITHM = 'lb_algorithm' |
| 70 | LB_ALGORITHM_ROUND_ROBIN = 'ROUND_ROBIN' |
| 71 | LB_ALGORITHM_LEAST_CONNECTIONS = 'LEAST_CONNECTIONS' |
| 72 | LB_ALGORITHM_SOURCE_IP = 'SOURCE_IP' |
Maciej Józefczyk | b6df5f8 | 2019-12-10 10:12:30 +0000 | [diff] [blame] | 73 | LB_ALGORITHM_SOURCE_IP_PORT = 'SOURCE_IP_PORT' |
| 74 | SUPPORTED_LB_ALGORITHMS_AMPHORA = [ |
| 75 | LB_ALGORITHM_ROUND_ROBIN, |
| 76 | LB_ALGORITHM_LEAST_CONNECTIONS, |
| 77 | LB_ALGORITHM_SOURCE_IP] |
| 78 | SUPPORTED_LB_ALGORITHMS = { |
| 79 | 'default': SUPPORTED_LB_ALGORITHMS_AMPHORA, |
| 80 | 'octavia': SUPPORTED_LB_ALGORITHMS_AMPHORA, |
| 81 | 'amphorav2': SUPPORTED_LB_ALGORITHMS_AMPHORA, |
| 82 | 'amphora': SUPPORTED_LB_ALGORITHMS_AMPHORA, |
| 83 | 'ovn': [LB_ALGORITHM_SOURCE_IP_PORT]} |
Adam Harwell | 8ffce3e | 2018-05-01 21:18:44 -0700 | [diff] [blame] | 84 | SESSION_PERSISTENCE = 'session_persistence' |
| 85 | LISTENER_ID = 'listener_id' |
| 86 | LOADBALANCERS = 'loadbalancers' |
| 87 | |
Adam Harwell | de3e054 | 2018-05-03 18:21:06 -0700 | [diff] [blame] | 88 | POOL_ID = 'pool_id' |
| 89 | ADDRESS = 'address' |
| 90 | WEIGHT = 'weight' |
| 91 | BACKUP = 'backup' |
| 92 | SUBNET_ID = 'subnet_id' |
| 93 | MONITOR_ADDRESS = 'monitor_address' |
| 94 | MONITOR_PORT = 'monitor_port' |
| 95 | |
Adam Harwell | 60ed9d9 | 2018-05-10 13:23:13 -0700 | [diff] [blame] | 96 | DELAY = 'delay' |
| 97 | TIMEOUT = 'timeout' |
| 98 | MAX_RETRIES = 'max_retries' |
| 99 | MAX_RETRIES_DOWN = 'max_retries_down' |
| 100 | HTTP_METHOD = 'http_method' |
| 101 | URL_PATH = 'url_path' |
| 102 | EXPECTED_CODES = 'expected_codes' |
| 103 | |
Michael Johnson | a2d0307 | 2019-01-14 17:18:21 -0800 | [diff] [blame] | 104 | ENABLED = 'enabled' |
Michael Johnson | aff2e86 | 2019-01-11 16:38:00 -0800 | [diff] [blame] | 105 | |
Adam Harwell | 60ed9d9 | 2018-05-10 13:23:13 -0700 | [diff] [blame] | 106 | # Other constants |
| 107 | ACTIVE = 'ACTIVE' |
Carlos Goncalves | c2e1216 | 2019-02-14 23:57:44 +0100 | [diff] [blame] | 108 | PENDING_UPDATE = 'PENDING_UPDATE' |
Adam Harwell | 60ed9d9 | 2018-05-10 13:23:13 -0700 | [diff] [blame] | 109 | ADMIN_STATE_UP_TRUE = 'true' |
| 110 | ASC = 'asc' |
| 111 | DELETED = 'DELETED' |
| 112 | DESC = 'desc' |
| 113 | FIELDS = 'fields' |
| 114 | OFFLINE = 'OFFLINE' |
| 115 | ONLINE = 'ONLINE' |
| 116 | NO_MONITOR = 'NO_MONITOR' |
| 117 | ERROR = 'ERROR' |
| 118 | SORT = 'sort' |
Michael Johnson | aff2e86 | 2019-01-11 16:38:00 -0800 | [diff] [blame] | 119 | SINGLE = 'SINGLE' |
| 120 | ACTIVE_STANDBY = 'ACTIVE_STANDBY' |
Carlos Goncalves | ee09a1b | 2019-07-22 11:45:04 +0200 | [diff] [blame] | 121 | SUPPORTED_LB_TOPOLOGIES = (SINGLE, ACTIVE_STANDBY) |
Adam Harwell | 60ed9d9 | 2018-05-10 13:23:13 -0700 | [diff] [blame] | 122 | |
| 123 | # Protocols |
| 124 | HTTP = 'HTTP' |
| 125 | HTTPS = 'HTTPS' |
| 126 | TCP = 'TCP' |
Carlos Goncalves | 9777f11 | 2019-05-02 12:22:45 -0600 | [diff] [blame] | 127 | TERMINATED_HTTPS = 'TERMINATED_HTTPS' |
Gregory Thiemonge | 26853ac | 2019-07-02 08:56:41 +0200 | [diff] [blame] | 128 | UDP = 'UDP' |
Adam Harwell | 60ed9d9 | 2018-05-10 13:23:13 -0700 | [diff] [blame] | 129 | |
| 130 | # HTTP Methods |
| 131 | GET = 'GET' |
| 132 | POST = 'POST' |
| 133 | PUT = 'PUT' |
| 134 | DELETE = 'DELETE' |
| 135 | |
| 136 | # HM Types |
| 137 | HEALTH_MONITOR_PING = 'PING' |
| 138 | HEALTH_MONITOR_TCP = 'TCP' |
| 139 | HEALTH_MONITOR_HTTP = 'HTTP' |
| 140 | HEALTH_MONITOR_HTTPS = 'HTTPS' |
| 141 | HEALTH_MONITOR_TLS_HELLO = 'TLS-HELLO' |
Gregory Thiemonge | 29d1790 | 2019-04-30 15:06:17 +0200 | [diff] [blame] | 142 | HEALTH_MONITOR_UDP_CONNECT = 'UDP-CONNECT' |
Adam Harwell | 60ed9d9 | 2018-05-10 13:23:13 -0700 | [diff] [blame] | 143 | |
| 144 | # Session Persistence |
| 145 | TYPE = 'type' |
| 146 | COOKIE_NAME = 'cookie_name' |
| 147 | SESSION_PERSISTENCE_SOURCE_IP = 'SOURCE_IP' |
| 148 | SESSION_PERSISTENCE_HTTP_COOKIE = 'HTTP_COOKIE' |
| 149 | SESSION_PERSISTENCE_APP_COOKIE = 'APP_COOKIE' |
| 150 | |
Adam Harwell | 446f8be | 2018-05-24 16:51:03 -0700 | [diff] [blame] | 151 | # L7Policy options |
| 152 | POSITION = 'position' |
| 153 | REDIRECT_URL = 'redirect_url' |
| 154 | REDIRECT_POOL_ID = 'redirect_pool_id' |
| 155 | |
| 156 | ACTION = 'action' |
| 157 | REDIRECT_TO_POOL = 'REDIRECT_TO_POOL' |
| 158 | REDIRECT_TO_URL = 'REDIRECT_TO_URL' |
| 159 | REJECT = 'REJECT' |
| 160 | |
Adam Harwell | e029af2 | 2018-05-24 17:13:28 -0700 | [diff] [blame] | 161 | # L7Rule options |
| 162 | L7POLICY_ID = 'l7policy_id' |
| 163 | VALUE = 'value' |
| 164 | COMPARE_TYPE = 'compare_type' |
| 165 | KEY = 'key' |
| 166 | INVERT = 'invert' |
| 167 | # Compare types |
| 168 | EQUAL_TO = 'EQUAL_TO' |
| 169 | STARTS_WITH = 'STARTS_WITH' |
| 170 | ENDS_WITH = 'ENDS_WITH' |
| 171 | CONTAINS = 'CONTAINS' |
| 172 | REGEX = 'REGEX' |
| 173 | # Types |
| 174 | COOKIE = 'COOKIE' |
| 175 | FILE_TYPE = 'FILE_TYPE' |
| 176 | HEADER = 'HEADER' |
| 177 | HOST_NAME = 'HOST_NAME' |
| 178 | PATH = 'PATH' |
| 179 | |
Adam Harwell | 60ed9d9 | 2018-05-10 13:23:13 -0700 | [diff] [blame] | 180 | # RBAC options |
| 181 | ADVANCED = 'advanced' |
| 182 | OWNERADMIN = 'owner_or_admin' |
| 183 | NONE = 'none' |
| 184 | |
Adam Harwell | dfc11ee | 2018-05-30 09:38:55 -0700 | [diff] [blame] | 185 | # Amphora fields |
| 186 | COMPUTE_ID = 'compute_id' |
| 187 | LB_NETWORK_IP = 'lb_network_ip' |
| 188 | VRRP_IP = 'vrrp_ip' |
| 189 | HA_IP = 'ha_ip' |
| 190 | VRRP_PORT_ID = 'vrrp_port_id' |
| 191 | HA_PORT_ID = 'ha_port_id' |
| 192 | CERT_EXPIRATION = 'cert_expiration' |
| 193 | CERT_BUSY = 'cert_busy' |
| 194 | ROLE = 'role' |
| 195 | STATUS = 'status' |
| 196 | VRRP_INTERFACE = 'vrrp_interface' |
| 197 | VRRP_ID = 'vrrp_id' |
| 198 | VRRP_PRIORITY = 'vrrp_priority' |
| 199 | CACHED_ZONE = 'cached_zone' |
| 200 | IMAGE_ID = 'image_id' |
| 201 | |
| 202 | # Amphora roles |
| 203 | ROLE_STANDALONE = 'STANDALONE' |
| 204 | ROLE_MASTER = 'MASTER' |
| 205 | ROLE_BACKUP = 'BACKUP' |
| 206 | AMPHORA_ROLES = (ROLE_STANDALONE, ROLE_MASTER, ROLE_BACKUP) |
| 207 | |
| 208 | # Amphora statuses |
| 209 | STATUS_BOOTING = 'BOOTING' |
| 210 | STATUS_ALLOCATED = 'ALLOCATED' |
| 211 | STATUS_READY = 'READY' |
| 212 | STATUS_PENDING_CREATE = 'PENDING_CREATE' |
| 213 | STATUS_PENDING_DELETE = 'PENDING_DELETE' |
| 214 | STATUS_DELETED = 'DELETED' |
| 215 | STATUS_ERROR = 'ERROR' |
| 216 | AMPHORA_STATUSES = ( |
| 217 | STATUS_BOOTING, STATUS_ALLOCATED, STATUS_READY, STATUS_PENDING_CREATE, |
| 218 | STATUS_PENDING_DELETE, STATUS_DELETED, STATUS_ERROR |
| 219 | ) |
| 220 | |
Ann Taraday | 7d0b582 | 2019-10-17 15:28:30 +0400 | [diff] [blame] | 221 | # Amphora providers list |
| 222 | AMPHORA_PROVIDERS = ['amphora', 'amphorav2', 'octavia'] |
| 223 | |
Michael Johnson | aff2e86 | 2019-01-11 16:38:00 -0800 | [diff] [blame] | 224 | # Flavor capabilities |
| 225 | LOADBALANCER_TOPOLOGY = 'loadbalancer_topology' |
| 226 | |
Adam Harwell | c2aa20c | 2019-11-20 11:15:07 -0800 | [diff] [blame] | 227 | # Availability zone capabilities |
| 228 | COMPUTE_ZONE = 'compute_zone' |
| 229 | MANAGEMENT_NETWORK = 'management_network' |
| 230 | |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 231 | # API valid fields |
| 232 | SHOW_LOAD_BALANCER_RESPONSE_FIELDS = ( |
Adam Harwell | a795ae6 | 2018-04-23 12:11:19 -0700 | [diff] [blame] | 233 | ADMIN_STATE_UP, CREATED_AT, DESCRIPTION, FLAVOR_ID, ID, LISTENERS, NAME, |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 234 | OPERATING_STATUS, POOLS, PROJECT_ID, PROVIDER, PROVISIONING_STATUS, |
| 235 | UPDATED_AT, VIP_ADDRESS, VIP_NETWORK_ID, VIP_PORT_ID, VIP_SUBNET_ID, |
| 236 | VIP_QOS_POLICY_ID) |
| 237 | |
Michael Johnson | dfd818a | 2018-08-21 20:54:54 -0700 | [diff] [blame] | 238 | SHOW_LISTENER_RESPONSE_FIELDS = [ |
Jude Cross | fbbd2b4 | 2017-08-09 15:21:04 -0700 | [diff] [blame] | 239 | ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS, |
| 240 | ADMIN_STATE_UP, PROTOCOL, PROTOCOL_PORT, CONNECTION_LIMIT, |
| 241 | DEFAULT_TLS_CONTAINER_REF, SNI_CONTAINER_REFS, PROJECT_ID, |
Michael Johnson | dfd818a | 2018-08-21 20:54:54 -0700 | [diff] [blame] | 242 | DEFAULT_POOL_ID, L7_POLICIES, INSERT_HEADERS, CREATED_AT, UPDATED_AT |
| 243 | ] |
Jude Cross | fbbd2b4 | 2017-08-09 15:21:04 -0700 | [diff] [blame] | 244 | |
Adam Harwell | 8ffce3e | 2018-05-01 21:18:44 -0700 | [diff] [blame] | 245 | SHOW_POOL_RESPONSE_FIELDS = ( |
| 246 | ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS, |
| 247 | ADMIN_STATE_UP, PROTOCOL, LB_ALGORITHM, SESSION_PERSISTENCE, |
| 248 | CREATED_AT, UPDATED_AT |
| 249 | ) |
| 250 | |
Michael Johnson | dfd818a | 2018-08-21 20:54:54 -0700 | [diff] [blame] | 251 | SHOW_MEMBER_RESPONSE_FIELDS = [ |
Adam Harwell | de3e054 | 2018-05-03 18:21:06 -0700 | [diff] [blame] | 252 | ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP, |
Michael Johnson | dfd818a | 2018-08-21 20:54:54 -0700 | [diff] [blame] | 253 | ADDRESS, PROTOCOL_PORT, WEIGHT, MONITOR_PORT, MONITOR_ADDRESS |
| 254 | ] |
Adam Harwell | de3e054 | 2018-05-03 18:21:06 -0700 | [diff] [blame] | 255 | |
Adam Harwell | 60ed9d9 | 2018-05-10 13:23:13 -0700 | [diff] [blame] | 256 | SHOW_HEALTHMONITOR_RESPONSE_FIELDS = ( |
| 257 | ID, NAME, PROVISIONING_STATUS, OPERATING_STATUS, ADMIN_STATE_UP, |
| 258 | TYPE, DELAY, TIMEOUT, MAX_RETRIES, MAX_RETRIES_DOWN, HTTP_METHOD, |
| 259 | URL_PATH, EXPECTED_CODES, CREATED_AT, UPDATED_AT |
| 260 | ) |
Adam Harwell | 446f8be | 2018-05-24 16:51:03 -0700 | [diff] [blame] | 261 | |
| 262 | SHOW_L7POLICY_RESPONSE_FIELDS = ( |
| 263 | ID, NAME, DESCRIPTION, PROVISIONING_STATUS, OPERATING_STATUS, |
| 264 | ADMIN_STATE_UP, LISTENER_ID, POSITION, ACTION, REDIRECT_URL, |
| 265 | REDIRECT_POOL_ID, CREATED_AT, UPDATED_AT |
| 266 | ) |
Adam Harwell | e029af2 | 2018-05-24 17:13:28 -0700 | [diff] [blame] | 267 | |
| 268 | SHOW_L7RULE_RESPONSE_FIELDS = ( |
| 269 | ID, ADMIN_STATE_UP, CREATED_AT, UPDATED_AT, TYPE, VALUE, COMPARE_TYPE, |
| 270 | KEY, INVERT |
| 271 | ) |
Adam Harwell | dfc11ee | 2018-05-30 09:38:55 -0700 | [diff] [blame] | 272 | |
Michael Johnson | dfd818a | 2018-08-21 20:54:54 -0700 | [diff] [blame] | 273 | SHOW_AMPHORA_RESPONSE_FIELDS = [ |
Adam Harwell | dfc11ee | 2018-05-30 09:38:55 -0700 | [diff] [blame] | 274 | ID, LOADBALANCER_ID, COMPUTE_ID, LB_NETWORK_IP, VRRP_IP, HA_IP, |
| 275 | VRRP_PORT_ID, HA_PORT_ID, CERT_EXPIRATION, CERT_BUSY, ROLE, STATUS, |
Michael Johnson | dfd818a | 2018-08-21 20:54:54 -0700 | [diff] [blame] | 276 | VRRP_INTERFACE, VRRP_ID, VRRP_PRIORITY, CACHED_ZONE |
| 277 | ] |
Michael Johnson | aff2e86 | 2019-01-11 16:38:00 -0800 | [diff] [blame] | 278 | |
| 279 | SHOW_FLAVOR_PROFILE_FIELDS = [ID, NAME, PROVIDER_NAME, FLAVOR_DATA] |
Michael Johnson | a2d0307 | 2019-01-14 17:18:21 -0800 | [diff] [blame] | 280 | |
| 281 | SHOW_FLAVOR_FIELDS = [ID, NAME, DESCRIPTION, ENABLED, FLAVOR_PROFILE_ID] |
Adam Harwell | c2aa20c | 2019-11-20 11:15:07 -0800 | [diff] [blame] | 282 | |
| 283 | SHOW_AVAILABILITY_ZONE_PROFILE_FIELDS = [ |
| 284 | ID, NAME, PROVIDER_NAME, AVAILABILITY_ZONE_DATA] |
| 285 | |
| 286 | SHOW_AVAILABILITY_ZONE_FIELDS = [ |
| 287 | NAME, DESCRIPTION, ENABLED, AVAILABILITY_ZONE_PROFILE_ID] |