You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/11/01 09:31:33 UTC

[GitHub] [apisix] SylviaBABY commented on a diff in pull request #8223: docs: update consumer and upstream docs

SylviaBABY commented on code in PR #8223:
URL: https://github.com/apache/apisix/pull/8223#discussion_r1010240858


##########
docs/en/latest/terminology/consumer.md:
##########
@@ -54,83 +62,102 @@ Consumers are useful when you have different consumers requesting the same API a
 
 Refer to the documentation for the [key-auth](../plugins/key-auth.md) authentication Plugin to further understand the concept of a Consumer.
 
+:::note
+
+For more information about the Consumer object, you can refer to the [Admin API Consumer](../admin-api.md#consumer) object resource introduction.
+
+:::
+
 ## Example
 
 The example below shows how you can enable a Plugin for a specific Consumer.
 
-```shell
-# Create a Consumer, specify the authentication plugin key-auth, and enable the specific plugin limit-count
-$ curl http://127.0.0.1:9180/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "username": "jack",
-    "plugins": {
-        "key-auth": {
-            "key": "auth-one"
-        },
-        "limit-count": {
-            "count": 2,
-            "time_window": 60,
-            "rejected_code": 503,
-            "key": "remote_addr"
+1. Create a Consumer, specify the authentication plugin `key-auth`, and enable the specific plugin `limit-count`:
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/consumers \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "username": "jack",
+        "plugins": {
+            "key-auth": {
+                "key": "auth-one"
+            },
+            "limit-count": {
+                "count": 2,
+                "time_window": 60,
+                "rejected_code": 503,
+                "key": "remote_addr"
+            }
         }
-    }
-}'
-
-# Create a Router, set routing rules and enable plugin configuration
-$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "plugins": {
-        "key-auth": {}
-    },
-    "upstream": {
-        "nodes": {
-            "127.0.0.1:1980": 1
+    }'
+    ```
+
+2. Create a Router, set routing rules and enable plugin configuration:
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/routes/1 \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "plugins": {
+            "key-auth": {}
+        },
+        "upstream": {
+            "nodes": {
+                "127.0.0.1:1980": 1
+            },
+            "type": "roundrobin"
         },
-        "type": "roundrobin"
-    },
-    "uri": "/hello"
-}'
+        "uri": "/hello"
+    }'
+    ```
 
-# Send a test request, the first two return to normal, did not reach the speed limit threshold
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-...
+3. Send a test request, the first two return to normal, did not reach the speed limit threshold:
 
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-...
+    ```shell
+    curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
+    ```
 
-# The third test returns 503 and the request is restricted
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-HTTP/1.1 503 Service Temporarily Unavailable
-...
+    The third test returns 503 and the request is restricted
 
-```
+    ```shell
+    HTTP/1.1 503 Service Temporarily Unavailable
+    ...
+    ```
 
 We can use the [consumer-restriction](../plugins/consumer-restriction.md) Plugin to restrict our user "Jack" from accessing the API.
 
-```shell
-# Add Jack to the blacklist
-$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "plugins": {
-        "key-auth": {},
-        "consumer-restriction": {
-            "blacklist": [
-                "jack"
-            ]
-        }
-    },
-    "upstream": {
-        "nodes": {
-            "127.0.0.1:1980": 1
+1. Add Jack to the blacklist

Review Comment:
   ```suggestion
   1. Add Jack to the blacklist.
   ```



##########
docs/zh/latest/terminology/consumer.md:
##########
@@ -41,87 +56,108 @@ title: Consumer
 2. 获取 consumer_name:通过授权认证,即可自然获取到对应的 Consumer name,它是 Consumer 对象的唯一识别标识。
 3. 获取 Consumer 上绑定的 Plugin 或 Upstream 信息:完成对不同 Consumer 做不同配置的效果。
 
-概括一下,Consumer 是某类服务的消费者,需与用户认证体系配合才能使用。
-比如不同的 Consumer 请求同一个 API,网关服务根据当前请求用户信息,对应不同的 Plugin 或 Upstream 配置。
+你可以参考 [key-auth](../plugins/key-auth.md) 认证授权插件的调用逻辑,进一步理解 Consumer 概念和使用。
 
-此外,大家也可以参考 [key-auth](../plugins/key-auth.md) 认证授权插件的调用逻辑,辅助大家来进一步理解 Consumer 概念和使用。
+:::note 注意
 
-如何对某个 Consumer 开启指定插件,可以看下面例子:
+如需了解更多关于 Consumer 对象的信息,你可以参考 [Admin API Consumer](../admin-api.md#consumer) 资源介绍。
 
-```shell
-# 创建 Consumer ,指定认证插件 key-auth ,并开启特定插件 limit-count
-$ curl http://127.0.0.1:9180/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "username": "jack",
-    "plugins": {
-        "key-auth": {
-            "key": "auth-one"
-        },
-        "limit-count": {
-            "count": 2,
-            "time_window": 60,
-            "rejected_code": 503,
-            "key": "remote_addr"
+:::
+
+## 使用示例
+
+以下示例介绍了如何对某个 Consumer 开启指定插件:
+
+1. 创建 Consumer ,指定认证插件 `key-auth`,并开启特定插件 `limit-count`:
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/consumers \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "username": "jack",
+        "plugins": {
+            "key-auth": {
+                "key": "auth-one"
+            },
+            "limit-count": {
+                "count": 2,
+                "time_window": 60,
+                "rejected_code": 503,
+                "key": "remote_addr"
+            }
         }
-    }
-}'
-
-# 创建 Router,设置路由规则和启用插件配置
-$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "plugins": {
-        "key-auth": {}
-    },
-    "upstream": {
-        "nodes": {
-            "127.0.0.1:1980": 1
+    }'
+    ```
+
+2. 创建路由,设置路由规则和启用插件配置:
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/routes/1 \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "plugins": {
+            "key-auth": {}
         },
-        "type": "roundrobin"
-    },
-    "uri": "/hello"
-}'
-
-# 发测试请求,前两次返回正常,没达到限速阈值
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-...
-
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-...
-
-# 第三次测试返回 503,请求被限制
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-HTTP/1.1 503 Service Temporarily Unavailable
-...
-
-```
-
-结合 [consumer-restriction](../plugins/consumer-restriction.md) 插件,限制 jack 对该 route 的访问
-
-```shell
-# 设置黑名单,禁止 jack 访问该 API
-
-$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "plugins": {
-        "key-auth": {},
-        "consumer-restriction": {
-            "blacklist": [
-                "jack"
-            ]
-        }
-    },
-    "upstream": {
-        "nodes": {
-            "127.0.0.1:1980": 1
+        "upstream": {
+            "nodes": {
+                "127.0.0.1:1980": 1
+            },
+            "type": "roundrobin"
         },
-        "type": "roundrobin"
-    },
-    "uri": "/hello"
-}'
+        "uri": "/hello"
+    }'
+    ```
+
+3. 测试插件
+
+    连续发送三次测试请求,前两次返回正常,没达到限速阈值。
+
+    ```shell
+    curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
+    ```
+
+    第三次测试返回 `503`,请求被限制:
+
+    ```shell
+    HTTP/1.1 503 Service Temporarily Unavailable
+    ...
+    ```
+
+通过 [consumer-restriction](../plugins/consumer-restriction.md) 插件,限制用户 `jack` 对该 Route 的访问

Review Comment:
   ```suggestion
   通过 [consumer-restriction](../plugins/consumer-restriction.md) 插件,限制用户 `jack` 对该 Route 的访问。
   ```



##########
docs/zh/latest/terminology/consumer.md:
##########
@@ -41,87 +56,108 @@ title: Consumer
 2. 获取 consumer_name:通过授权认证,即可自然获取到对应的 Consumer name,它是 Consumer 对象的唯一识别标识。
 3. 获取 Consumer 上绑定的 Plugin 或 Upstream 信息:完成对不同 Consumer 做不同配置的效果。
 
-概括一下,Consumer 是某类服务的消费者,需与用户认证体系配合才能使用。
-比如不同的 Consumer 请求同一个 API,网关服务根据当前请求用户信息,对应不同的 Plugin 或 Upstream 配置。
+你可以参考 [key-auth](../plugins/key-auth.md) 认证授权插件的调用逻辑,进一步理解 Consumer 概念和使用。
 
-此外,大家也可以参考 [key-auth](../plugins/key-auth.md) 认证授权插件的调用逻辑,辅助大家来进一步理解 Consumer 概念和使用。
+:::note 注意
 
-如何对某个 Consumer 开启指定插件,可以看下面例子:
+如需了解更多关于 Consumer 对象的信息,你可以参考 [Admin API Consumer](../admin-api.md#consumer) 资源介绍。
 
-```shell
-# 创建 Consumer ,指定认证插件 key-auth ,并开启特定插件 limit-count
-$ curl http://127.0.0.1:9180/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "username": "jack",
-    "plugins": {
-        "key-auth": {
-            "key": "auth-one"
-        },
-        "limit-count": {
-            "count": 2,
-            "time_window": 60,
-            "rejected_code": 503,
-            "key": "remote_addr"
+:::
+
+## 使用示例
+
+以下示例介绍了如何对某个 Consumer 开启指定插件:
+
+1. 创建 Consumer ,指定认证插件 `key-auth`,并开启特定插件 `limit-count`:
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/consumers \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "username": "jack",
+        "plugins": {
+            "key-auth": {
+                "key": "auth-one"
+            },
+            "limit-count": {
+                "count": 2,
+                "time_window": 60,
+                "rejected_code": 503,
+                "key": "remote_addr"
+            }
         }
-    }
-}'
-
-# 创建 Router,设置路由规则和启用插件配置
-$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "plugins": {
-        "key-auth": {}
-    },
-    "upstream": {
-        "nodes": {
-            "127.0.0.1:1980": 1
+    }'
+    ```
+
+2. 创建路由,设置路由规则和启用插件配置:
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/routes/1 \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "plugins": {
+            "key-auth": {}
         },
-        "type": "roundrobin"
-    },
-    "uri": "/hello"
-}'
-
-# 发测试请求,前两次返回正常,没达到限速阈值
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-...
-
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-...
-
-# 第三次测试返回 503,请求被限制
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-HTTP/1.1 503 Service Temporarily Unavailable
-...
-
-```
-
-结合 [consumer-restriction](../plugins/consumer-restriction.md) 插件,限制 jack 对该 route 的访问
-
-```shell
-# 设置黑名单,禁止 jack 访问该 API
-
-$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "plugins": {
-        "key-auth": {},
-        "consumer-restriction": {
-            "blacklist": [
-                "jack"
-            ]
-        }
-    },
-    "upstream": {
-        "nodes": {
-            "127.0.0.1:1980": 1
+        "upstream": {
+            "nodes": {
+                "127.0.0.1:1980": 1
+            },
+            "type": "roundrobin"
         },
-        "type": "roundrobin"
-    },
-    "uri": "/hello"
-}'
+        "uri": "/hello"
+    }'
+    ```
+
+3. 测试插件
+
+    连续发送三次测试请求,前两次返回正常,没达到限速阈值。
+
+    ```shell
+    curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
+    ```
+
+    第三次测试返回 `503`,请求被限制:
+
+    ```shell
+    HTTP/1.1 503 Service Temporarily Unavailable
+    ...
+    ```
+
+通过 [consumer-restriction](../plugins/consumer-restriction.md) 插件,限制用户 `jack` 对该 Route 的访问
+
+1. 设置黑名单,禁止 jack 访问该 API
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/routes/1  \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "plugins": {
+            "key-auth": {},
+            "consumer-restriction": {
+                "blacklist": [
+                    "jack"
+                ]
+            }
+        },
+        "upstream": {
+            "nodes": {
+                "127.0.0.1:1980": 1
+            },
+            "type": "roundrobin"
+        },
+        "uri": "/hello"
+    }'
+    ```
+
+2. 通过以下命令访问该路由,均返回 `403`,`jack` 被禁止访问:

Review Comment:
   ```suggestion
   2. 通过以下命令访问该路由,均返回 `403`,`jack` 被禁止访问。
   ```



##########
docs/zh/latest/terminology/consumer.md:
##########
@@ -41,87 +56,108 @@ title: Consumer
 2. 获取 consumer_name:通过授权认证,即可自然获取到对应的 Consumer name,它是 Consumer 对象的唯一识别标识。
 3. 获取 Consumer 上绑定的 Plugin 或 Upstream 信息:完成对不同 Consumer 做不同配置的效果。
 
-概括一下,Consumer 是某类服务的消费者,需与用户认证体系配合才能使用。
-比如不同的 Consumer 请求同一个 API,网关服务根据当前请求用户信息,对应不同的 Plugin 或 Upstream 配置。
+你可以参考 [key-auth](../plugins/key-auth.md) 认证授权插件的调用逻辑,进一步理解 Consumer 概念和使用。
 
-此外,大家也可以参考 [key-auth](../plugins/key-auth.md) 认证授权插件的调用逻辑,辅助大家来进一步理解 Consumer 概念和使用。
+:::note 注意
 
-如何对某个 Consumer 开启指定插件,可以看下面例子:
+如需了解更多关于 Consumer 对象的信息,你可以参考 [Admin API Consumer](../admin-api.md#consumer) 资源介绍。
 
-```shell
-# 创建 Consumer ,指定认证插件 key-auth ,并开启特定插件 limit-count
-$ curl http://127.0.0.1:9180/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "username": "jack",
-    "plugins": {
-        "key-auth": {
-            "key": "auth-one"
-        },
-        "limit-count": {
-            "count": 2,
-            "time_window": 60,
-            "rejected_code": 503,
-            "key": "remote_addr"
+:::
+
+## 使用示例
+
+以下示例介绍了如何对某个 Consumer 开启指定插件:
+
+1. 创建 Consumer ,指定认证插件 `key-auth`,并开启特定插件 `limit-count`:
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/consumers \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "username": "jack",
+        "plugins": {
+            "key-auth": {
+                "key": "auth-one"
+            },
+            "limit-count": {
+                "count": 2,
+                "time_window": 60,
+                "rejected_code": 503,
+                "key": "remote_addr"
+            }
         }
-    }
-}'
-
-# 创建 Router,设置路由规则和启用插件配置
-$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "plugins": {
-        "key-auth": {}
-    },
-    "upstream": {
-        "nodes": {
-            "127.0.0.1:1980": 1
+    }'
+    ```
+
+2. 创建路由,设置路由规则和启用插件配置:
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/routes/1 \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "plugins": {
+            "key-auth": {}
         },
-        "type": "roundrobin"
-    },
-    "uri": "/hello"
-}'
-
-# 发测试请求,前两次返回正常,没达到限速阈值
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-...
-
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-...
-
-# 第三次测试返回 503,请求被限制
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-HTTP/1.1 503 Service Temporarily Unavailable
-...
-
-```
-
-结合 [consumer-restriction](../plugins/consumer-restriction.md) 插件,限制 jack 对该 route 的访问
-
-```shell
-# 设置黑名单,禁止 jack 访问该 API
-
-$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "plugins": {
-        "key-auth": {},
-        "consumer-restriction": {
-            "blacklist": [
-                "jack"
-            ]
-        }
-    },
-    "upstream": {
-        "nodes": {
-            "127.0.0.1:1980": 1
+        "upstream": {
+            "nodes": {
+                "127.0.0.1:1980": 1
+            },
+            "type": "roundrobin"
         },
-        "type": "roundrobin"
-    },
-    "uri": "/hello"
-}'
+        "uri": "/hello"
+    }'
+    ```
+
+3. 测试插件
+
+    连续发送三次测试请求,前两次返回正常,没达到限速阈值。
+
+    ```shell
+    curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
+    ```
+
+    第三次测试返回 `503`,请求被限制:
+
+    ```shell
+    HTTP/1.1 503 Service Temporarily Unavailable
+    ...
+    ```
+
+通过 [consumer-restriction](../plugins/consumer-restriction.md) 插件,限制用户 `jack` 对该 Route 的访问
+
+1. 设置黑名单,禁止 jack 访问该 API

Review Comment:
   ```suggestion
   1. 设置黑名单,禁止 jack 访问该 API。
   ```



##########
docs/zh/latest/terminology/upstream.md:
##########
@@ -21,197 +27,217 @@ title: Upstream
 #
 -->
 
-Upstream 是虚拟主机抽象,对给定的多个服务节点按照配置规则进行负载均衡。Upstream 的地址信息可以直接配置到 `Route`(或 `Service`) 上,当 Upstream 有重复时,就需要用“引用”方式避免重复了。
+## 描述
 
-![Upstream 示例](../../../assets/images/upstream-example.png)
+Upstream(也称之为上游)是对虚拟主机抽象,即应用层服务或节点的抽象。你可以通过 Upstream 对象,它支持对多个服务节点按照配置规则进行负载均衡。

Review Comment:
   ```suggestion
   Upstream(也称之为上游)是对虚拟主机抽象,即应用层服务或节点的抽象。你可以通过 Upstream 对象对多个服务节点按照配置规则进行负载均衡。
   ```



##########
docs/en/latest/terminology/consumer.md:
##########
@@ -54,83 +62,102 @@ Consumers are useful when you have different consumers requesting the same API a
 
 Refer to the documentation for the [key-auth](../plugins/key-auth.md) authentication Plugin to further understand the concept of a Consumer.
 
+:::note
+
+For more information about the Consumer object, you can refer to the [Admin API Consumer](../admin-api.md#consumer) object resource introduction.
+
+:::
+
 ## Example
 
 The example below shows how you can enable a Plugin for a specific Consumer.
 
-```shell
-# Create a Consumer, specify the authentication plugin key-auth, and enable the specific plugin limit-count
-$ curl http://127.0.0.1:9180/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "username": "jack",
-    "plugins": {
-        "key-auth": {
-            "key": "auth-one"
-        },
-        "limit-count": {
-            "count": 2,
-            "time_window": 60,
-            "rejected_code": 503,
-            "key": "remote_addr"
+1. Create a Consumer, specify the authentication plugin `key-auth`, and enable the specific plugin `limit-count`:
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/consumers \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "username": "jack",
+        "plugins": {
+            "key-auth": {
+                "key": "auth-one"
+            },
+            "limit-count": {
+                "count": 2,
+                "time_window": 60,
+                "rejected_code": 503,
+                "key": "remote_addr"
+            }
         }
-    }
-}'
-
-# Create a Router, set routing rules and enable plugin configuration
-$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "plugins": {
-        "key-auth": {}
-    },
-    "upstream": {
-        "nodes": {
-            "127.0.0.1:1980": 1
+    }'
+    ```
+
+2. Create a Router, set routing rules and enable plugin configuration:
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/routes/1 \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "plugins": {
+            "key-auth": {}
+        },
+        "upstream": {
+            "nodes": {
+                "127.0.0.1:1980": 1
+            },
+            "type": "roundrobin"
         },
-        "type": "roundrobin"
-    },
-    "uri": "/hello"
-}'
+        "uri": "/hello"
+    }'
+    ```
 
-# Send a test request, the first two return to normal, did not reach the speed limit threshold
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-...
+3. Send a test request, the first two return to normal, did not reach the speed limit threshold:
 
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-...
+    ```shell
+    curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
+    ```
 
-# The third test returns 503 and the request is restricted
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-HTTP/1.1 503 Service Temporarily Unavailable
-...
+    The third test returns 503 and the request is restricted
 
-```
+    ```shell
+    HTTP/1.1 503 Service Temporarily Unavailable
+    ...
+    ```
 
 We can use the [consumer-restriction](../plugins/consumer-restriction.md) Plugin to restrict our user "Jack" from accessing the API.
 
-```shell
-# Add Jack to the blacklist
-$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "plugins": {
-        "key-auth": {},
-        "consumer-restriction": {
-            "blacklist": [
-                "jack"
-            ]
-        }
-    },
-    "upstream": {
-        "nodes": {
-            "127.0.0.1:1980": 1
+1. Add Jack to the blacklist
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/routes/1 \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "plugins": {
+            "key-auth": {},
+            "consumer-restriction": {
+                "blacklist": [
+                    "jack"
+                ]
+            }
         },
-        "type": "roundrobin"
-    },
-    "uri": "/hello"
-}'
+        "upstream": {
+            "nodes": {
+                "127.0.0.1:1980": 1
+            },
+            "type": "roundrobin"
+        },
+        "uri": "/hello"
+    }'
+    ```
+
+Repeated tests, all return 403; Jack is forbidden to access this API:

Review Comment:
   ```suggestion
   2. Repeated tests, all return `403`; Jack is forbidden to access this API:
   ```



##########
docs/en/latest/terminology/consumer.md:
##########
@@ -54,83 +62,102 @@ Consumers are useful when you have different consumers requesting the same API a
 
 Refer to the documentation for the [key-auth](../plugins/key-auth.md) authentication Plugin to further understand the concept of a Consumer.
 
+:::note
+
+For more information about the Consumer object, you can refer to the [Admin API Consumer](../admin-api.md#consumer) object resource introduction.
+
+:::
+
 ## Example
 
 The example below shows how you can enable a Plugin for a specific Consumer.
 
-```shell
-# Create a Consumer, specify the authentication plugin key-auth, and enable the specific plugin limit-count
-$ curl http://127.0.0.1:9180/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "username": "jack",
-    "plugins": {
-        "key-auth": {
-            "key": "auth-one"
-        },
-        "limit-count": {
-            "count": 2,
-            "time_window": 60,
-            "rejected_code": 503,
-            "key": "remote_addr"
+1. Create a Consumer, specify the authentication plugin `key-auth`, and enable the specific plugin `limit-count`:
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/consumers \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "username": "jack",
+        "plugins": {
+            "key-auth": {
+                "key": "auth-one"
+            },
+            "limit-count": {
+                "count": 2,
+                "time_window": 60,
+                "rejected_code": 503,
+                "key": "remote_addr"
+            }
         }
-    }
-}'
-
-# Create a Router, set routing rules and enable plugin configuration
-$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "plugins": {
-        "key-auth": {}
-    },
-    "upstream": {
-        "nodes": {
-            "127.0.0.1:1980": 1
+    }'
+    ```
+
+2. Create a Router, set routing rules and enable plugin configuration:
+
+    ```shell
+    curl http://127.0.0.1:9180/apisix/admin/routes/1 \
+    -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+    {
+        "plugins": {
+            "key-auth": {}
+        },
+        "upstream": {
+            "nodes": {
+                "127.0.0.1:1980": 1
+            },
+            "type": "roundrobin"
         },
-        "type": "roundrobin"
-    },
-    "uri": "/hello"
-}'
+        "uri": "/hello"
+    }'
+    ```
 
-# Send a test request, the first two return to normal, did not reach the speed limit threshold
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-...
+3. Send a test request, the first two return to normal, did not reach the speed limit threshold:
 
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-...
+    ```shell
+    curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
+    ```
 
-# The third test returns 503 and the request is restricted
-$ curl http://127.0.0.1:9080/hello -H 'apikey: auth-one' -I
-HTTP/1.1 503 Service Temporarily Unavailable
-...
+    The third test returns 503 and the request is restricted

Review Comment:
   ```suggestion
       The third test returns `503` and the request is restricted.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org