blob: 7c293ea2b94351f97640256e138e51431659a769 [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.
#
anyOf:
- required:
- plugins
- uri
- required:
- upstream
- uri
- required:
- upstream_id
- uri
- required:
- service_id
- uri
- required:
- plugins
- uris
- required:
- upstream
- uris
- required:
- upstream_id
- uris
- required:
- service_id
- uris
- required:
- script
- uri
- required:
- script
- uris
allOf:
- oneOf:
- required:
- uri
- required:
- uris
- oneOf:
- not:
anyOf:
- required:
- host
- required:
- hosts
- required:
- host
- required:
- hosts
- oneOf:
- not:
anyOf:
- required:
- remote_addr
- required:
- remote_addrs
- required:
- remote_addr
- required:
- remote_addrs
additionalProperties: false
not:
anyOf:
- required:
- script
- plugins
- required:
- script
- plugin_config_id
properties:
update_time:
type: integer
readOnly: true
upstream:
$ref: ./Upstream.yaml
script:
minLength: 10
maxLength: 102400
type: string
plugins:
type: object
remote_addrs:
items:
description: client IP
anyOf:
- format: ipv4
type: string
title: IPv4
- pattern: ^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$
type: string
title: IPv4/CIDR
- format: ipv6
type: string
title: IPv6
- pattern: ^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$
type: string
title: IPv6/CIDR
type: string
minItems: 1
uniqueItems: true
type: array
priority:
default: 0
type: integer
hosts:
items:
pattern: ^\*$|^\*?[0-9a-zA-Z-._\[\]:]+$
type: string
minItems: 1
uniqueItems: true
type: array
plugin_config_id:
$ref: ./ResourceId.yaml
methods:
items:
description: HTTP method
enum:
- GET
- POST
- PUT
- DELETE
- PATCH
- HEAD
- OPTIONS
- CONNECT
- TRACE
- PURGE
type: string
uniqueItems: true
type: array
uri:
minLength: 1
maxLength: 4096
type: string
enable_websocket:
type: boolean
description: enable websocket for request
upstream_id:
$ref: ./ResourceId.yaml
service_id:
$ref: ./ResourceId.yaml
host:
pattern: ^\*$|^\*?[0-9a-zA-Z-._\[\]:]+$
type: string
timeout:
$ref: ./Timeout.yaml
create_time:
type: integer
readOnly: true
labels:
$ref: ./Labels.yaml
script_id:
$ref: ./ResourceId.yaml
remote_addr:
description: client IP
anyOf:
- format: ipv4
type: string
title: IPv4
- pattern: ^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$
type: string
title: IPv4/CIDR
- format: ipv6
type: string
title: IPv6
- pattern: ^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$
type: string
title: IPv6/CIDR
type: string
status:
default: 1
description: route status, 1 to enable, 0 to disable
enum:
- 1
- 0
type: integer
filter_func:
pattern: ^function
minLength: 10
type: string
vars:
type: array
items: {}
name:
minLength: 1
maxLength: 256
type: string
id:
$ref: ./ResourceId.yaml
desc:
maxLength: 256
type: string
uris:
items:
type: string
description: HTTP uri
minItems: 1
uniqueItems: true
type: array
modifiedIndex:
type: integer
type: object
x-source: apisix/schema_def.lua