Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc]Supplement the 'X-API-KEY' parameter for each interface that operates admin. #1661

Merged
merged 3 commits into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions doc/admin-api-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

# 目录

* [Route](#route)
* [Service](#service)
* [Consumer](#consumer)
* [Upstream](#upstream)
* [SSL](#ssl)
- [目录](#%e7%9b%ae%e5%bd%95)
- [Route](#route)
- [运算符列表](#%e8%bf%90%e7%ae%97%e7%ac%a6%e5%88%97%e8%a1%a8)
- [Service](#service)
- [Consumer](#consumer)
- [Upstream](#upstream)
- [SSL](#ssl)

## Route

Expand Down Expand Up @@ -214,7 +216,7 @@ serivce 对象 json 配置内容:

```shell
# 创建一个Service
$ curl http://127.0.0.1:9080/apisix/admin/services/201 -X PUT -i -d '
$ curl http://127.0.0.1:9080/apisix/admin/services/201 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
"plugins": {
"limit-count": {
Expand Down Expand Up @@ -294,7 +296,7 @@ consumer 对象 json 配置内容:

```shell
# 创建 Consumer ,指定认证插件 key-auth ,并开启特定插件 limit-count
$ curl http://127.0.0.1:9080/apisix/admin/consumers/2 -X PUT -i -d '
$ curl http://127.0.0.1:9080/apisix/admin/consumers/2 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
"username": "jack",
"plugins": {
Expand Down Expand Up @@ -387,7 +389,7 @@ upstream 对象 json 配置内容:

```shell
# 创建一个upstream
$ curl http://127.0.0.1:9080/apisix/admin/upstreams/100 -i -X PUT -d '
$ curl http://127.0.0.1:9080/apisix/admin/upstreams/100 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -i -X PUT -d '
> {
> "type": "roundrobin",
> "nodes": {
Expand Down
18 changes: 10 additions & 8 deletions doc/admin-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@

===

* [Route](#route)
* [Service](#service)
* [Consumer](#consumer)
* [Upstream](#upstream)
* [SSL](#ssl)
- [Table of Contents](#table-of-contents)
- [Route](#route)
- [Available Operators](#available-operators)
- [Service](#service)
- [Consumer](#consumer)
- [Upstream](#upstream)
- [SSL](#ssl)

## Route

Expand Down Expand Up @@ -209,7 +211,7 @@ Config Example:
Example:

```shell
$ curl http://127.0.0.1:9080/apisix/admin/services/201 -X PUT -i -d '
$ curl http://127.0.0.1:9080/apisix/admin/services/201 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
"plugins": {
"limit-count": {
Expand Down Expand Up @@ -286,7 +288,7 @@ The binding authentication and authorization plug-in is a bit special. When it n
Example:

```shell
$ curl http://127.0.0.1:9080/apisix/admin/consumers/2 -X PUT -i -d '
$ curl http://127.0.0.1:9080/apisix/admin/consumers/2 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
"username": "jack",
"plugins": {
Expand Down Expand Up @@ -378,7 +380,7 @@ Config Example:
Example:

```shell
$ curl http://127.0.0.1:9080/apisix/admin/upstreams/100 -i -X PUT -d '
$ curl http://127.0.0.1:9080/apisix/admin/upstreams/100 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -i -X PUT -d '
> {
> "type": "roundrobin",
> "nodes": {
Expand Down
3 changes: 2 additions & 1 deletion doc/architecture-design-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ HTTP/1.1 503 Service Temporarily Unavailable
curl -X PUT \
https://{apisix_listen_address}/apisix/admin/global_rules/1 \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
-d '{
"plugins": {
"limit-count": {
Expand All @@ -577,7 +578,7 @@ curl -X PUT \
我们可以通过以下接口查看所有的 `GlobalRule`:

```shell
curl https://{apisix_listen_address}/apisix/admin/global_rules
curl https://{apisix_listen_address}/apisix/admin/global_rules -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
```

[返回目录](#目录)
Expand Down
1 change: 1 addition & 0 deletions doc/architecture-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ We can register a global [Plugin](#Plugin) with `GlobalRule`:
curl -X PUT \
https://{apisix_listen_address}/apisix/admin/global_rules/1 \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
-d '{
"plugins": {
"limit-count": {
Expand Down
2 changes: 1 addition & 1 deletion doc/plugins/http-logger-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ hello, world
在插件配置中删除相应的json配置以禁用http-logger。APISIX插件是热重载的,因此无需重新启动APISIX:

```shell
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -X PUT -d value='
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d value='
{
"methods": ["GET"],
"uri": "/hello",
Expand Down
13 changes: 7 additions & 6 deletions doc/plugins/http-logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
-->

# Summary
- [**Name**](#name)
- [**Attributes**](#attributes)
- [**How To Enable**](#how-to-enable)
- [**Test Plugin**](#test-plugin)
- [**Disable Plugin**](#disable-plugin)
- [Summary](#summary)
- [Name](#name)
- [Attributes](#attributes)
- [How To Enable](#how-to-enable)
- [Test Plugin](#test-plugin)
- [Disable Plugin](#disable-plugin)


## Name
Expand Down Expand Up @@ -85,7 +86,7 @@ Remove the corresponding json configuration in the plugin configuration to disab
APISIX plugins are hot-reloaded, therefore no need to restart APISIX.

```shell
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -X PUT -d value='
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d value='
{
"methods": ["GET"],
"uri": "/hello",
Expand Down
2 changes: 1 addition & 1 deletion doc/plugins/ip-restriction-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ HTTP/1.1 403 Forbidden
当你想去掉 `ip-restriction` 插件的时候,很简单,在插件的配置中把对应的 json 配置删除即可,无须重启服务,即刻生效:

```shell
$ curl http://127.0.0.1:2379/v2/keys/apisix/routes/1 -X PUT -d value='
$ curl http://127.0.0.1:2379/v2/keys/apisix/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d value='
{
"uri": "/index.html",
"plugins": {},
Expand Down
15 changes: 9 additions & 6 deletions doc/plugins/ip-restriction.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
[Chinese](ip-restriction-cn.md)

# Summary
- [**Name**](#name)
- [**Attributes**](#attributes)
- [**How To Enable**](#how-to-enable)
- [**Test Plugin**](#test-plugin)
- [**Disable Plugin**](#disable-plugin)
- [Summary](#summary)
- [Name](#name)
- [Attributes](#attributes)
- [How To Enable](#how-to-enable)
- [Test Plugin](#test-plugin)
- [Change the restriction](#change-the-restriction)
- [Test Plugin after restriction change](#test-plugin-after-restriction-change)
- [Disable Plugin](#disable-plugin)


## Name
Expand Down Expand Up @@ -141,7 +144,7 @@ you can delete the corresponding json configuration in the plugin configuration,
no need to restart the service, it will take effect immediately:

```shell
$ curl http://127.0.0.1:2379/v2/keys/apisix/routes/1 -X PUT -d value='
$ curl http://127.0.0.1:2379/v2/keys/apisix/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d value='
{
"uri": "/index.html",
"plugins": {},
Expand Down
2 changes: 1 addition & 1 deletion doc/plugins/kafka-logger-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ hello, world
当您要禁用`kafka-logger`插件时,这很简单,您可以在插件配置中删除相应的json配置,无需重新启动服务,它将立即生效:

```shell
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -X PUT -d value='
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d value='
{
"methods": ["GET"],
"uri": "/hello",
Expand Down
16 changes: 9 additions & 7 deletions doc/plugins/kafka-logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
-->

# Summary
- [**Name**](#name)
- [**Attributes**](#attributes)
- [**Info**](#info)
- [**How To Enable**](#how-to-enable)
- [**Test Plugin**](#test-plugin)
- [**Disable Plugin**](#disable-plugin)
- [Summary](#summary)
- [Name](#name)
- [Attributes](#attributes)
- [Info](#info)
- [Sample broker list](#sample-broker-list)
- [How To Enable](#how-to-enable)
- [Test Plugin](#test-plugin)
- [Disable Plugin](#disable-plugin)


## Name
Expand Down Expand Up @@ -119,7 +121,7 @@ Remove the corresponding json configuration in the plugin configuration to disab
APISIX plugins are hot-reloaded, therefore no need to restart APISIX.

```shell
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -X PUT -d value='
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d value='
{
"methods": ["GET"],
"uri": "/hello",
Expand Down
4 changes: 2 additions & 2 deletions doc/plugins/proxy-cache-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
示例1:为特定路由启用 `proxy-cache` 插件:

```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"plugins": {
"proxy-cache": {
Expand Down Expand Up @@ -130,7 +130,7 @@ Server: APISIX web server
移除插件配置中相应的 JSON 配置可立即禁用该插件,无需重启服务:

```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"uri": "/hello",
"plugins": {},
Expand Down
4 changes: 2 additions & 2 deletions doc/plugins/proxy-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Note:
1: enable the proxy-cache plugin for a specific route :

```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"plugins": {
"proxy-cache": {
Expand Down Expand Up @@ -130,7 +130,7 @@ Remove the corresponding JSON in the plugin configuration to disable the plugin


```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"uri": "/hello",
"plugins": {},
Expand Down
4 changes: 2 additions & 2 deletions doc/plugins/proxy-mirror-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
示例1:为特定路由启用 `proxy-mirror` 插件:

```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"plugins": {
"proxy-mirror": {
Expand Down Expand Up @@ -77,7 +77,7 @@ hello world
移除插件配置中相应的 JSON 配置可立即禁用该插件,无需重启服务:

```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"uri": "/hello",
"plugins": {},
Expand Down
4 changes: 2 additions & 2 deletions doc/plugins/proxy-mirror.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The proxy-mirror plugin, which provides the ability to mirror client requests.
1: enable the proxy-mirror plugin for a specific route :

```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"plugins": {
"proxy-mirror": {
Expand Down Expand Up @@ -81,7 +81,7 @@ Remove the corresponding JSON in the plugin configuration to disable the plugin


```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"uri": "/hello",
"plugins": {},
Expand Down
2 changes: 1 addition & 1 deletion doc/plugins/skywalking-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f1
当你想去掉插件的时候,很简单,在插件的配置中把对应的 json 配置删除即可,无须重启服务,即刻生效:
```shell
$ curl http://127.0.0.1:2379/v2/keys/apisix/routes/1 -X PUT -d value='
$ curl http://127.0.0.1:2379/v2/keys/apisix/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d value='
{
"methods": ["GET"],
"uris": [
Expand Down
19 changes: 10 additions & 9 deletions doc/plugins/skywalking.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
[Chinese](skywalking-cn.md)

# Summary
- [**Summary**](#Summary)
- [**Name**](#Name)
- [**Attributes**](#Attributes)
- [**How To Enable**](#How-To-Enable)
- [**Test Plugin**](#Test-Plugin)
- [**Run Skywalking Example**](#Run-Skywalking-Example)
- [**Disable Plugin**](#Disable-Plugin)
- [**Upstream services(Code With SpringBoot)**](#Upstream-services(Code-With-SpringBoot))
- [Summary](#summary)
- [Name](#name)
- [Attributes](#attributes)
- [How To Enable](#how-to-enable)
- [Test Plugin](#test-plugin)
- [Run-Skywalking-Example](#run-skywalking-example)
- [e.g.](#eg)
- [Disable Plugin](#disable-plugin)
- [Upstream services(Code With SpringBoot)](#upstream-servicescode-with-springboot)

## Name

Expand Down Expand Up @@ -127,7 +128,7 @@ When you want to disable the skyWalking plugin, it is very simple,
no need to restart the service, it will take effect immediately:

```shell
$ curl http://127.0.0.1:2379/v2/keys/apisix/routes/1 -X PUT -d value='
$ curl http://127.0.0.1:2379/v2/keys/apisix/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d value='
{
"methods": ["GET"],
"uris": [
Expand Down
2 changes: 1 addition & 1 deletion doc/plugins/syslog-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ hello, world
想要禁用“sys-logger”插件,是非常简单的,将对应的插件配置从json配置删除,就会立即生效,不需要重新启动服务:

```shell
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -X PUT -d value='
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d value='
{
"methods": ["GET"],
"uri": "/hello",
Expand Down
13 changes: 7 additions & 6 deletions doc/plugins/syslog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
-->

# Summary
- [**Name**](#name)
- [**Attributes**](#attributes)
- [**How To Enable**](#how-to-enable)
- [**Test Plugin**](#test-plugin)
- [**Disable Plugin**](#disable-plugin)
- [Summary](#summary)
- [Name](#name)
- [Attributes](#attributes)
- [How To Enable](#how-to-enable)
- [Test Plugin](#test-plugin)
- [Disable Plugin](#disable-plugin)


## Name
Expand Down Expand Up @@ -90,7 +91,7 @@ Remove the corresponding json configuration in the plugin configuration to disab
APISIX plugins are hot-reloaded, therefore no need to restart APISIX.

```shell
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -X PUT -d value='
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d value='
{
"methods": ["GET"],
"uri": "/hello",
Expand Down
2 changes: 1 addition & 1 deletion doc/plugins/tcp-logger-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ hello, world
想要禁用“tcp-logger”插件,是非常简单的,将对应的插件配置从json配置删除,就会立即生效,不需要重新启动服务:

```shell
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -X PUT -d value='
$ curl http://127.0.0.1:2379/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d value='
{
"methods": ["GET"],
"uri": "/hello",
Expand Down
Loading