Skip to content

Commit

Permalink
doc: add 'X-API-KEY' parameter for each interface of Admin API. (#1661)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miss-you authored Jun 8, 2020
1 parent f61b703 commit 12bfcec
Show file tree
Hide file tree
Showing 24 changed files with 33 additions and 31 deletions.
6 changes: 3 additions & 3 deletions doc/admin-api-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,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 +294,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 +387,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
6 changes: 3 additions & 3 deletions doc/admin-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,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 +286,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 +378,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
2 changes: 1 addition & 1 deletion doc/plugins/http-logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,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
2 changes: 1 addition & 1 deletion doc/plugins/ip-restriction.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,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
2 changes: 1 addition & 1 deletion doc/plugins/kafka-logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,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
2 changes: 1 addition & 1 deletion doc/plugins/skywalking.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,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
2 changes: 1 addition & 1 deletion doc/plugins/syslog.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,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
2 changes: 1 addition & 1 deletion doc/plugins/tcp-logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,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/udp-logger-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ hello, world
想要禁用“udp-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
2 changes: 1 addition & 1 deletion doc/plugins/udp-logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,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/zipkin-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ http://127.0.0.1:9411/zipkin
当你想去掉插件的时候,很简单,在插件的配置中把对应的 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"],
"uri": "/index.html",
Expand Down
2 changes: 1 addition & 1 deletion doc/plugins/zipkin.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ When you want to disable the zipkin 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"],
"uri": "/index.html",
Expand Down

0 comments on commit 12bfcec

Please sign in to comment.