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/02/14 10:25:19 UTC

[GitHub] [apisix] bzp2010 opened a new pull request #6318: docs: update public API relative usage

bzp2010 opened a new pull request #6318:
URL: https://github.com/apache/apisix/pull/6318


   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   Update the usage in the documentation of some plugins that use the public API feature.
   
   ### Pre-submission checklist:
   
   <!--
   Please follow the PR manners:
   1. Use Draft if the PR is not ready to be reviewed
   2. Test is required for the feat/fix PR, unless you have a good reason
   3. Doc is required for the feat PR
   4. Use a new commit to resolve review instead of `push -f`
   5. If you need to resolve merge conflicts after the PR is reviewed, please merge master but do not rebase
   6. Use "request review" to notify the reviewer once you have resolved the review
   7. Only reviewer can click "Resolve conversation" to mark the reviewer's review resolved
   -->
   
   * [x] Did you explain what problem does this PR solve? Or what new features have been added?
   * [x] Have you added corresponding test cases?
   * [x] Have you modified the corresponding document?
   * [x] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


-- 
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



[GitHub] [apisix] spacewander commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r810935177



##########
File path: docs/en/latest/plugins/prometheus.md
##########
@@ -93,6 +93,20 @@ Then add prometheus plugin:
 
 We fetch the metric data from the specified url `/apisix/prometheus/metrics`.
 
+First you need to setup the route for the metrics API, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/p -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/apisix/prometheus/metrics",
+    "plugins": {
+        "public-api": {}
+    }
+}'
+```
+
+Then, we can get the metrics.

Review comment:
       I think we should remove the example of public-api in prometheus. Better not encourage the abuse.




-- 
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



[GitHub] [apisix] bzp2010 commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r810746558



##########
File path: docs/en/latest/plugins/prometheus.md
##########
@@ -93,6 +93,20 @@ Then add prometheus plugin:
 
 We fetch the metric data from the specified url `/apisix/prometheus/metrics`.
 
+First you need to setup the route for the metrics API, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/p -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/apisix/prometheus/metrics",
+    "plugins": {
+        "public-api": {}
+    }
+}'
+```
+
+Then, we can get the metrics.

Review comment:
       I think now that we have introduced `public-api` plugin, can we reduce the existence of APIs with special configuration items on these plugins and let users give priority to using public-api plugin to realize similar functions, such as `prometheus` plugin and `batch-requests` plugins.
   
   




-- 
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



[GitHub] [apisix] juzhiyuan commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r806366050



##########
File path: docs/en/latest/plugins/jwt-auth.md
##########
@@ -196,6 +196,20 @@ then add jwt-auth plugin in the Consumer page:
 
 #### Get the Token in `jwt-auth` Plugin:
 
+First you need to setup the route for the API that sign the token, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/apisix/plugin/jwt/sign",

Review comment:
       Complex for me to understand 😅 




-- 
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



[GitHub] [apisix] tzssangglass commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r806370163



##########
File path: docs/en/latest/plugins/jwt-auth.md
##########
@@ -196,6 +196,20 @@ then add jwt-auth plugin in the Consumer page:
 
 #### Get the Token in `jwt-auth` Plugin:
 
+First you need to setup the route for the API that sign the token, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '

Review comment:
       ```suggestion
   $ curl http://127.0.0.1:9080/apisix/admin/routes/jwt-sign -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   ```




-- 
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



[GitHub] [apisix] spacewander commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r809676087



##########
File path: docs/en/latest/plugins/prometheus.md
##########
@@ -93,6 +93,20 @@ Then add prometheus plugin:
 
 We fetch the metric data from the specified url `/apisix/prometheus/metrics`.
 
+First you need to setup the route for the metrics API, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/p -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/apisix/prometheus/metrics",
+    "plugins": {
+        "public-api": {}
+    }
+}'
+```
+
+Then, we can get the metrics.

Review comment:
       We don't need to do it for prometheus, which uses a different port.




-- 
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



[GitHub] [apisix] bzp2010 commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r807486987



##########
File path: docs/en/latest/plugins/jwt-auth.md
##########
@@ -196,6 +196,20 @@ then add jwt-auth plugin in the Consumer page:
 
 #### Get the Token in `jwt-auth` Plugin:
 
+First you need to setup the route for the API that sign the token, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '

Review comment:
       fixed




-- 
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



[GitHub] [apisix] bzp2010 commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r810979178



##########
File path: docs/en/latest/plugins/prometheus.md
##########
@@ -93,6 +93,20 @@ Then add prometheus plugin:
 
 We fetch the metric data from the specified url `/apisix/prometheus/metrics`.
 
+First you need to setup the route for the metrics API, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/p -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/apisix/prometheus/metrics",
+    "plugins": {
+        "public-api": {}
+    }
+}'
+```
+
+Then, we can get the metrics.

Review comment:
       @spacewander changes rolled back




-- 
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



[GitHub] [apisix] bzp2010 commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r807913157



##########
File path: docs/en/latest/plugins/jwt-auth.md
##########
@@ -196,6 +196,20 @@ then add jwt-auth plugin in the Consumer page:
 
 #### Get the Token in `jwt-auth` Plugin:
 
+First you need to setup the route for the API that sign the token, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/apisix/plugin/jwt/sign",

Review comment:
       Haha, It is not necessary for you to understand its actual meaning, you can check the content such as the description in English and Chinese, and other content is checked by other reviewers.




-- 
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



[GitHub] [apisix] bzp2010 commented on pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#issuecomment-1041451996


   Hi, @spacewander. Please help check it out, thanks!


-- 
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



[GitHub] [apisix] spacewander commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r810850515



##########
File path: docs/en/latest/plugins/prometheus.md
##########
@@ -93,6 +93,20 @@ Then add prometheus plugin:
 
 We fetch the metric data from the specified url `/apisix/prometheus/metrics`.
 
+First you need to setup the route for the metrics API, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/p -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/apisix/prometheus/metrics",
+    "plugins": {
+        "public-api": {}
+    }
+}'
+```
+
+Then, we can get the metrics.

Review comment:
       It is not recommended to configure the port to 9080, which abuses the 9080 port and should be only used in the CI.




-- 
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



[GitHub] [apisix] tzssangglass commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r806370163



##########
File path: docs/en/latest/plugins/jwt-auth.md
##########
@@ -196,6 +196,20 @@ then add jwt-auth plugin in the Consumer page:
 
 #### Get the Token in `jwt-auth` Plugin:
 
+First you need to setup the route for the API that sign the token, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '

Review comment:
       ```suggestion
   $ curl http://127.0.0.1:9080/apisix/admin/routes/jwt-sign -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   ```




-- 
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



[GitHub] [apisix] juzhiyuan commented on pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#issuecomment-1046446096


   ![image](https://user-images.githubusercontent.com/2106987/154886149-ae71ece5-8c30-4dce-b29f-9365bb2d4e55.png)
   
   Hi @bzp2010, please have a check on this.


-- 
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



[GitHub] [apisix] spacewander commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r810849108



##########
File path: docs/en/latest/plugins/prometheus.md
##########
@@ -93,6 +93,20 @@ Then add prometheus plugin:
 
 We fetch the metric data from the specified url `/apisix/prometheus/metrics`.
 
+First you need to setup the route for the metrics API, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/p -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/apisix/prometheus/metrics",
+    "plugins": {
+        "public-api": {}
+    }
+}'
+```
+
+Then, we can get the metrics.

Review comment:
       The default port of Prometheus metrics is 9091, not the 9080.




-- 
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



[GitHub] [apisix] juzhiyuan commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r809032931



##########
File path: docs/en/latest/plugins/batch-requests.md
##########
@@ -118,23 +118,35 @@ Response is `Array` of [HttpResponse](#httpresponse).
 
 ## How to specify custom uri
 
-We can change the default uri in the `plugin_attr` section of `conf/config.yaml`.
+We have the [public-api](public-api.md) plugin, customizing the uri becomes even easier. We just need to set the `uri` you want when creating the route and change the configuration of the `public-api` plugin.
 
-| Name       | Type   | Requirement | Default                      | Description                       |
-| ---------- | ------ |-------------| ---------------------------- | --------------------------------- |
-| uri        | string | optional    | "/apisix/batch-requests"     | uri to use with batch-requests plugin   |
-
-Here is an example:
-
-```yaml
-plugin_attr:
-  batch-requests:
-    uri: "/api-gw/batch"
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/br -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/batch-requests",
+    "plugins": {
+        "public-api": {
+            "uri": "/apisix/batch-requests"
+        }
+    }
+}'
 ```
 
 ## Test Plugin
 
-You can pass your request detail to batch API( `/apisix/batch-requests` ), `apisix` can automatically complete requests via [http pipeline](https://en.wikipedia.org/wiki/HTTP_pipelining). Such as:
+First you need to setup the route for the API that batch request, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/br -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/apisix/batch-requests",
+    "plugins": {
+        "public-api": {}
+    }
+}'
+```
+
+Then, you can pass your request detail to batch API( `/apisix/batch-requests` ), APISIX can automatically complete requests via [http pipeline](https://en.wikipedia.org/wiki/HTTP_pipelining). Such as:

Review comment:
       ```suggestion
   Then, you can pass your request detail to batch API(`/apisix/batch-requests`), APISIX can automatically complete requests via [http pipeline](https://en.wikipedia.org/wiki/HTTP_pipelining). Such as:
   ```

##########
File path: docs/en/latest/plugins/prometheus.md
##########
@@ -93,6 +93,20 @@ Then add prometheus plugin:
 
 We fetch the metric data from the specified url `/apisix/prometheus/metrics`.
 
+First you need to setup the route for the metrics API, which will use the [public-api](public-api.md) plugin.

Review comment:
       ```suggestion
   First, you need to set up the route for the metrics API, which will use the [public-api](public-api.md) plugin.
   ```

##########
File path: docs/zh/latest/plugins/batch-requests.md
##########
@@ -122,23 +122,35 @@ curl http://127.0.0.1:9080/apisix/admin/plugin_metadata/batch-requests -H 'X-API
 
 ## 如何修改自定义 uri
 
-我们可以在 `conf/config.yaml` 的 `plugin_attr` 配置项中修改默认的 `uri`
+我们可以使用 [public-api](../../../en/latest/plugins/public-api.md) 插件轻易的设置自定义 uri。只需要在创建路由时设置需要的 uri 并改变 `public-api` 插件的配置即可。
 
-| 名称       | 类型   | 必选项	| 默认值                       | 描述           |
-| --------- | ------ | ------ | ---------------------------- | -------------- |
-| uri       | string |  可选  |"/apisix/batch-requests"     | `batch-requests` 插件的自定义 uri    |
-
-配置示例:
-
-```yaml
-plugin_attr:
-  batch-requests:
-    uri: "/api-gw/batch"
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/br -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/batch-requests",
+    "plugins": {
+        "public-api": {
+            "uri": "/apisix/batch-requests"
+        }
+    }
+}'
 ```
 
 ## 测试插件
 
-你可以将要访问的请求信息传到网关的批量请求接口( `/apisix/batch-requests` ),网关会以 [http pipeline](https://en.wikipedia.org/wiki/HTTP_pipelining) 的方式自动帮你完成请求。
+首先,你需要为 batch request 的 API 设置一个路由,它将使用 [public-api](public-api.md) 插件。

Review comment:
       `[public-api](public-api.md)` only has English version?

##########
File path: docs/en/latest/plugins/jwt-auth.md
##########
@@ -196,6 +196,20 @@ then add jwt-auth plugin in the Consumer page:
 
 #### Get the Token in `jwt-auth` Plugin:
 
+First you need to setup the route for the API that sign the token, which will use the [public-api](public-api.md) plugin.

Review comment:
       ```suggestion
   First, you need to set up the route for the API that signs the token, which will use the [public-api](public-api.md) plugin.
   ```




-- 
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



[GitHub] [apisix] juzhiyuan commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r806366050



##########
File path: docs/en/latest/plugins/jwt-auth.md
##########
@@ -196,6 +196,20 @@ then add jwt-auth plugin in the Consumer page:
 
 #### Get the Token in `jwt-auth` Plugin:
 
+First you need to setup the route for the API that sign the token, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/apisix/plugin/jwt/sign",

Review comment:
       Complex for me to understand 😅 




-- 
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



[GitHub] [apisix] bzp2010 commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r810979178



##########
File path: docs/en/latest/plugins/prometheus.md
##########
@@ -93,6 +93,20 @@ Then add prometheus plugin:
 
 We fetch the metric data from the specified url `/apisix/prometheus/metrics`.
 
+First you need to setup the route for the metrics API, which will use the [public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/p -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/apisix/prometheus/metrics",
+    "plugins": {
+        "public-api": {}
+    }
+}'
+```
+
+Then, we can get the metrics.

Review comment:
       changes rolled back




-- 
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



[GitHub] [apisix] spacewander merged pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #6318:
URL: https://github.com/apache/apisix/pull/6318


   


-- 
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



[GitHub] [apisix] bzp2010 commented on a change in pull request #6318: docs: update public API relative usage

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r810732274



##########
File path: docs/zh/latest/plugins/batch-requests.md
##########
@@ -122,23 +122,35 @@ curl http://127.0.0.1:9080/apisix/admin/plugin_metadata/batch-requests -H 'X-API
 
 ## 如何修改自定义 uri
 
-我们可以在 `conf/config.yaml` 的 `plugin_attr` 配置项中修改默认的 `uri`
+我们可以使用 [public-api](../../../en/latest/plugins/public-api.md) 插件轻易的设置自定义 uri。只需要在创建路由时设置需要的 uri 并改变 `public-api` 插件的配置即可。
 
-| 名称       | 类型   | 必选项	| 默认值                       | 描述           |
-| --------- | ------ | ------ | ---------------------------- | -------------- |
-| uri       | string |  可选  |"/apisix/batch-requests"     | `batch-requests` 插件的自定义 uri    |
-
-配置示例:
-
-```yaml
-plugin_attr:
-  batch-requests:
-    uri: "/api-gw/batch"
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/br -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/batch-requests",
+    "plugins": {
+        "public-api": {
+            "uri": "/apisix/batch-requests"
+        }
+    }
+}'
 ```
 
 ## 测试插件
 
-你可以将要访问的请求信息传到网关的批量请求接口( `/apisix/batch-requests` ),网关会以 [http pipeline](https://en.wikipedia.org/wiki/HTTP_pipelining) 的方式自动帮你完成请求。
+首先,你需要为 batch request 的 API 设置一个路由,它将使用 [public-api](public-api.md) 插件。

Review comment:
       broken link fixed




-- 
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