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