This is an automated email from the ASF dual-hosted git repository.
tokers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 2aeb6e4 docs: for global rule (#3317)
2aeb6e4 is described below
commit 2aeb6e44c72ebe3d2cb0e5fec41c89cc34626949
Author: 罗泽轩 <[email protected]>
AuthorDate: Mon Jan 18 05:14:57 2021 -0600
docs: for global rule (#3317)
fix #2854
---
doc/admin-api.md | 26 ++++++++++++++++++++++++++
doc/zh-cn/admin-api.md | 26 ++++++++++++++++++++++++++
2 files changed, 52 insertions(+)
diff --git a/doc/admin-api.md b/doc/admin-api.md
index 4243fa5..fe68321 100644
--- a/doc/admin-api.md
+++ b/doc/admin-api.md
@@ -24,6 +24,7 @@
* [Consumer](#consumer)
* [Upstream](#upstream)
* [SSL](#ssl)
+* [Global Rule](#global-rule)
* [Plugin Metadata](#plugin-metadata)
* [Plugin](#plugin)
@@ -695,6 +696,31 @@ Config Example:
}
```
+## Global Rule
+
+*API*:/apisix/admin/global_rules/{id}
+
+*Description*: Set plugins which run globally. Those plugins will be run
before any Route/Service level plugins.
+
+> Request Methods:
+
+|Method |Request URI|Request Body|Description |
+|---------|-------------------------|--|------|
+|GET |/apisix/admin/global_rules|NULL|Fetch resource list|
+|GET |/apisix/admin/global_rules/{id}|NULL|Fetch resource|
+|PUT |/apisix/admin/global_rules/{id}|{...}|Create resource by ID|
+|DELETE |/apisix/admin/global_rules/{id}|NULL|Remove resource|
+|PATCH |/apisix/admin/global_rules/{id}|{...}|Standard PATCH. Update some
attributes of the existing global rule, and other attributes not involved will
remain as they are; if you want to delete an attribute, set the value of the
attribute Set to null to delete; especially, when the value of the attribute is
an array, the attribute will be updated in full|
+|PATCH |/apisix/admin/global_rules/{id}/{path}|{...}|SubPath PATCH, specify
the attribute of global rule to be updated through {path}, update the value of
this attribute in full, and other attributes that are not involved will remain
as they are.|
+
+> Request Body Parameters:
+
+|Parameter|Required|Description|Example|
+|---------|---------|-----------|----|
+|plugins |True |See [Plugin](architecture-design.md#plugin)||
+|create_time|False|epoch timestamp in second, will be created automatically if
missing | 1602883670|
+|update_time|False|epoch timestamp in second, will be created automatically if
missing | 1602883670|
+
## Plugin Metadata
*API*:/apisix/admin/plugin_metadata/{plugin_name}
diff --git a/doc/zh-cn/admin-api.md b/doc/zh-cn/admin-api.md
index ae7335b..78815d0 100644
--- a/doc/zh-cn/admin-api.md
+++ b/doc/zh-cn/admin-api.md
@@ -24,6 +24,7 @@
* [Consumer](#consumer)
* [Upstream](#upstream)
* [SSL](#ssl)
+* [Global Rule](#global-rule)
* [Plugin Metadata](#plugin-metadata)
* [Plugin](#plugin)
@@ -702,6 +703,31 @@ ssl 对象 json 配置内容:
}
```
+## Global Rule
+
+*地址*:/apisix/admin/global_rules/{id}
+
+*说明*:设置全局运行的插件。这一类插件在所有路由级别的插件之前优先运行。
+
+> 请求方法:
+
+|名字 |请求 uri|请求 body|说明 |
+|---------|-------------------------|--|------|
+|GET |/apisix/admin/global_rules|无|获取资源列表|
+|GET |/apisix/admin/global_rules/{id}|无|获取资源|
+|PUT |/apisix/admin/global_rules/{id}|{...}|根据 id 创建资源|
+|DELETE |/apisix/admin/global_rules/{id}|无|删除资源|
+|PATCH |/apisix/admin/global_rules/{id}|{...}|标准 PATCH ,修改已有 Global Rule
的部分属性,其他不涉及的属性会原样保留;如果你要删除某个属性,将该属性的值设置为null 即可删除;特别地,当需要修改属性的值为数组时,该属性将全量更新|
+|PATCH |/apisix/admin/global_rules/{id}/{path}|{...}|SubPath PATCH,通过
{path} 指定 Global Rule 要更新的属性,全量更新该属性的数据,其他不涉及的属性会原样保留。|
+
+> body 请求参数:
+
+|名字 |可选项 |类型 |说明 |示例|
+|---------|---------|----|-----------|----|
+|plugins |必需|Plugin|详见 [Plugin](architecture-design.md#plugin) ||
+|create_time|可选|辅助|单位为秒的 epoch 时间戳,如果不指定则自动创建|1602883670|
+|update_time|可选|辅助|单位为秒的 epoch 时间戳,如果不指定则自动创建|1602883670|
+
## Plugin Metadata
*地址*:/apisix/admin/plugin_metadata/{plugin_name}