blob: fc2b12a088500480f9843f53138ca03af8bb8a1b [file]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
additionalProperties: false
properties:
labels:
patternProperties:
.*:
maxLength: 256
description: value of label
minLength: 1
pattern: ^\S+$
type: string
type: object
description: key/value pairs to specify attributes
desc:
maxLength: 256
type: string
enable_websocket:
type: boolean
description: enable websocket for request
script:
maxLength: 102400
minLength: 10
type: string
name:
minLength: 1
maxLength: 256
type: string
create_time:
type: integer
readOnly: true
hosts:
uniqueItems: true
minItems: 1
items:
pattern: ^\*$|^\*?[0-9a-zA-Z-._\[\]:]+$
type: string
type: array
upstream_id:
anyOf:
- pattern: ^[a-zA-Z0-9-_.]+$
maxLength: 64
minLength: 1
type: string
- minimum: 1
type: integer
plugins:
type: object
id:
anyOf:
- pattern: ^[a-zA-Z0-9-_.]+$
maxLength: 64
minLength: 1
type: string
- minimum: 1
type: integer
upstream:
additionalProperties: false
properties:
tls:
properties:
ca_certs:
items:
$ref: ./CertificatePem.yaml
description: CA certificates used to verify the upstream certificate
minItems: 1
type: array
client_cert_id:
anyOf:
- pattern: ^[a-zA-Z0-9-_.]+$
maxLength: 64
minLength: 1
type: string
- minimum: 1
type: integer
client_key:
$ref: ./PrivateKeyPem.yaml
client_cert:
$ref: ./CertificatePem.yaml
verify:
description: Enable or disable upstream certificate verification. When omitted, fall back to the NGINX verification setting.
type: boolean
type: object
dependentSchemas:
client_key:
required:
- client_cert
client_cert:
required:
- client_key
client_cert_id:
not:
required:
- client_cert
- client_key
checks:
anyOf:
- required:
- active
- required:
- active
- passive
properties:
passive:
properties:
unhealthy:
properties:
timeouts:
minimum: 0
maximum: 254
default: 7
type: integer
tcp_failures:
minimum: 0
maximum: 254
default: 2
type: integer
http_failures:
minimum: 0
maximum: 254
default: 5
type: integer
http_statuses:
type: array
uniqueItems: true
items:
minimum: 200
maximum: 599
type: integer
minItems: 1
default:
- 429
- 500
- 503
type: object
healthy:
properties:
successes:
minimum: 0
maximum: 254
default: 5
type: integer
http_statuses:
type: array
uniqueItems: true
items:
minimum: 200
maximum: 599
type: integer
minItems: 1
default:
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 226
- 300
- 301
- 302
- 303
- 304
- 305
- 306
- 307
- 308
type: object
type:
default: http
enum:
- http
- https
- tcp
type: string
type: object
active:
properties:
host:
pattern: ^\*$|^\*?[0-9a-zA-Z-._\[\]:]+$
type: string
concurrency:
default: 10
type: integer
timeout:
default: 1
type: number
type:
default: http
enum:
- http
- https
- tcp
type: string
unhealthy:
properties:
tcp_failures:
minimum: 1
maximum: 254
default: 2
type: integer
http_statuses:
type: array
uniqueItems: true
items:
minimum: 200
maximum: 599
type: integer
minItems: 1
default:
- 429
- 404
- 500
- 501
- 502
- 503
- 504
- 505
interval:
minimum: 1
default: 1
type: integer
http_failures:
minimum: 1
maximum: 254
default: 5
type: integer
timeouts:
minimum: 1
maximum: 254
default: 3
type: integer
type: object
http_req_body:
default: ""
type: string
http_method:
default: GET
enum:
- GET
- POST
- PUT
- DELETE
- PATCH
- HEAD
- OPTIONS
- CONNECT
- TRACE
- PURGE
type: string
http_path:
default: /
type: string
req_headers:
items:
uniqueItems: true
type: string
minItems: 1
type: array
healthy:
properties:
interval:
minimum: 1
default: 1
type: integer
successes:
minimum: 1
maximum: 254
default: 2
type: integer
http_statuses:
type: array
uniqueItems: true
items:
minimum: 200
maximum: 599
type: integer
minItems: 1
default:
- 200
- 302
type: object
https_verify_certificate:
default: true
type: boolean
port:
minimum: 1
maximum: 65535
type: integer
type: object
type: object
retries:
minimum: 0
type: integer
create_time:
type: integer
discovery_type:
type: string
description: discovery type
id:
anyOf:
- pattern: ^[a-zA-Z0-9-_.]+$
maxLength: 64
minLength: 1
type: string
- minimum: 1
type: integer
service_name:
minLength: 1
maxLength: 256
type: string
labels:
patternProperties:
.*:
maxLength: 256
description: value of label
minLength: 1
pattern: ^\S+$
type: string
type: object
description: key/value pairs to specify attributes
desc:
maxLength: 256
type: string
timeout:
required:
- connect
- send
- read
properties:
connect:
exclusiveMinimum: 0
type: number
send:
exclusiveMinimum: 0
type: number
read:
exclusiveMinimum: 0
type: number
type: object
type:
default: roundrobin
type: string
description: algorithms of load balancing
pass_host:
default: pass
enum:
- pass
- node
- rewrite
type: string
description: mod of host passing
scheme:
description: The scheme of the upstream. For L7 proxy, it can be one of grpc/grpcs/http/https/ws/wss. For L4 proxy, it can be one of tcp/tls/udp. For specific protocols, it can be kafka.
enum:
- grpc
- grpcs
- http
- https
- tcp
- tls
- udp
- kafka
- ws
- wss
default: http
upstream_host:
pattern: ^\*$|^\*?[0-9a-zA-Z-._\[\]:]+$
type: string
discovery_args:
properties:
namespace_id:
type: string
description: namespace id
group_name:
type: string
description: group name
cluster_ids:
description: ids of the kubernetes discovery clusters to get nodes from
uniqueItems: true
items:
type: string
minItems: 1
type: array
type: object
name:
minLength: 1
maxLength: 256
type: string
warm_up_conf:
additionalProperties: false
required:
- slow_start_time_seconds
- min_weight_percent
description: "slow start: ramp a newly observed node up to its configured weight"
type: object
properties:
min_weight_percent:
minimum: 1
maximum: 100
type: integer
description: lowest effective weight, as a percentage of the original weight
aggression:
minimum: 0.01
default: 1
type: number
description: "shape of the ramp: 1 is linear, above 1 ramps up faster at the beginning, below 1 slower"
startup_grace_period_seconds:
minimum: 0
default: 0
type: integer
description: seconds after the data plane started during which a node observed for the first time is considered mature
interval:
minimum: 1
default: 1
type: integer
description: seconds between two effective weight refreshes
slow_start_time_seconds:
minimum: 1
type: integer
description: seconds a new node takes to reach its full weight
key:
type: string
description: the key of chash for dynamic load balancing
hash_on:
enum:
- vars
- header
- cookie
- consumer
- vars_combinations
default: vars
type: string
keepalive_pool:
properties:
requests:
minimum: 1
default: 1000
type: integer
idle_timeout:
minimum: 0
default: 60
type: number
size:
minimum: 1
default: 320
type: integer
type: object
retry_timeout:
minimum: 0
type: number
nodes:
anyOf:
- patternProperties:
.*:
minimum: 0
type: integer
description: weight of node
type: object
- items:
required:
- host
- weight
properties:
host:
pattern: ^\*$|^\*?[0-9a-zA-Z-._\[\]:]+$
type: string
metadata:
type: object
description: metadata of node
priority:
default: 0
type: integer
description: priority of node
weight:
minimum: 0
type: integer
description: weight of node
port:
minimum: 1
maximum: 65535
type: integer
description: port of node
type: object
type: array
update_time:
type: integer
oneOf:
- required:
- nodes
- required:
- service_name
- discovery_type
type: object
update_time:
type: integer
readOnly: true
type: object
x-source: apisix/schema_def.lua