This is an automated email from the ASF dual-hosted git repository.
membphis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git
The following commit(s) were added to refs/heads/master by this push:
new c3893a5 doc: update admin-api doc (#1433)
c3893a5 is described below
commit c3893a5c08202d5fbc68fd76a46945ab75d68577
Author: Zhang Qiang <[email protected]>
AuthorDate: Fri Apr 10 10:12:19 2020 +0800
doc: update admin-api doc (#1433)
clarify route priority sorting rule.
---
doc/admin-api-cn.md | 2 +-
doc/admin-api.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/admin-api-cn.md b/doc/admin-api-cn.md
index 890cb46..aed1981 100644
--- a/doc/admin-api-cn.md
+++ b/doc/admin-api-cn.md
@@ -67,7 +67,7 @@
|remote_addr|可选 |匹配规则|客户端请求 IP 地址: `192.168.1.101`、`192.168.1.102` 以及 CIDR
格式的支持 `192.168.1.0/24`。特别的,APISIX 也完整支持 IPv6 地址匹配:`::1`,`fe80::1`, `fe80::1/64`
等。|"192.168.1.0/24"|
|remote_addrs|可选 |匹配规则|列表形态的 `remote_addr`,表示允许有多个不同 IP
地址,符合其中任意一个即可。|{"127.0.0.1", "192.0.0.0/8", "::1"}|
|methods |可选 |匹配规则|如果为空或没有该选项,代表没有任何 `method` 限制,也可以是一个或多个的组合:`GET`, `POST`,
`PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS`,`CONNECT`,`TRACE`。|{"GET", "POST"}|
-|priority |可选 |匹配规则|如果不同路由包含相同 `uri`,根据属性 `priority` 确定哪个 `route` 被优先匹配,默认值为
0。|priority = 10|
+|priority |可选 |匹配规则|如果不同路由包含相同 `uri`,根据属性 `priority` 确定哪个 `route`
被优先匹配,值越大优先级越高,默认值为 0。|priority = 10|
|vars |可选 |匹配规则|由一个或多个`{var, operator, val}`元素组成的列表,类似这样:`{{var,
operator, val}, {var, operator, val}, ...}`。例如:`{"arg_name", "==",
"json"}`,表示当前请求参数 `name` 是 `json`。这里的 `var` 与 Nginx 内部自身变量命名是保持一致,所以也可以使用
`request_uri`、`host` 等;对于 `operator` 部分,目前已支持的运算符有 `==`、`~=`、`>`、`<` 和
`~~`。对于`>`和`<`两个运算符,会把结果先转换成 number 然后再做比较。查看支持的[运算符列表](#运算符列表)|{{"arg_name",
"==", "json"}, {"arg_age", ">", 18}}|
|filter_func|可选|匹配规则|用户自定义的过滤函数。可以使用它来实现特殊场景的匹配要求实现。该函数默认接受一个名为 vars
的输入参数,可以用它来获取 Nginx 变量。|function(vars) return vars["arg_name"] == "json" end|
diff --git a/doc/admin-api.md b/doc/admin-api.md
index f22021f..fa81646 100644
--- a/doc/admin-api.md
+++ b/doc/admin-api.md
@@ -60,7 +60,7 @@ Table of contents
|remote_addr|False |Match Rules|The client requests an IP address:
`192.168.1.101`, `192.168.1.102`, and CIDR format support `192.168.1.0/24`. In
particular, APISIX also fully supports IPv6 address matching: `::1`, `fe80::1`,
`fe80::1/64`, etc.|"192.168.1.0/24"|
|remote_addrs|False |Match Rules|The `remote_addr` in the form of a list
indicates that multiple different IP addresses are allowed, and match any one
of them.|{"127.0.0.1", "192.0.0.0/8", "::1"}|
|methods |False |Match Rules|If empty or without this option, there are no
`method` restrictions, and it can be a combination of one or more:
`GET`,`POST`,`PUT`,`DELETE`,`PATCH`,
`HEAD`,`OPTIONS`,`CONNECT`,`TRACE`.|{"GET", "POST"}|
-|priority |False |Match Rules|If different routes contain the same `uri`,
determine which route is matched first based on the attribute` priority`, the
default value is 0.|priority = 10|
+|priority |False |Match Rules|If different routes contain the same `uri`,
determine which route is matched first based on the attribute` priority`.
Larger value means higher priority. The default value is 0.|priority = 10|
|vars |False |Match Rules |A list of one or more `{var, operator, val}`
elements, like this: `{{var, operator, val}, {var, operator, val}, ...}`. For
example: `{"arg_name", "==", "json"}` means that the current request parameter
`name` is `json`. The `var` here is consistent with the internal variable name
of Nginx, so you can also use `request_uri`, `host`, etc. For the operator
part, the currently supported operators are `==`, `~=`,`>`, `<`, and `~~`. For
the `>` and `<` operato [...]
|filter_func|False|Match Rules|User-defined filtering function. You can use it
to achieve matching requirements for special scenarios. This function accepts
an input parameter named `vars` by default, which you can use to get Nginx
variables.|function(vars) return vars["arg_name"] == "json" end|
|plugins |False |Plugin|See [Plugin](architecture-design.md#plugin) for more
||