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/08/12 02:44:22 UTC

[GitHub] [apisix] hf400159 commented on a diff in pull request #7647: docs: introduce the paging and filtering

hf400159 commented on code in PR #7647:
URL: https://github.com/apache/apisix/pull/7647#discussion_r944066769


##########
docs/zh/latest/admin-api.md:
##########
@@ -29,6 +29,89 @@ Admin API 是为 Apache APISIX 服务的一组 API,我们可以将参数传递
 
 在下面出现的 `X-API-KEY` 指的是 `conf/config.yaml` 文件中的 `apisix.admin_key.key`,它是 Admin API 的访问 token。
 
+## V3
+
+Admin API 在 V3 版本中做了一些不向下兼容的调整,以及支持更多特性。
+
+### 响应体格式

Review Comment:
   ```suggestion
   ### 支持新的响应体格式
   ```



##########
docs/zh/latest/admin-api.md:
##########
@@ -29,6 +29,89 @@ Admin API 是为 Apache APISIX 服务的一组 API,我们可以将参数传递
 
 在下面出现的 `X-API-KEY` 指的是 `conf/config.yaml` 文件中的 `apisix.admin_key.key`,它是 Admin API 的访问 token。
 
+## V3
+
+Admin API 在 V3 版本中做了一些不向下兼容的调整,以及支持更多特性。
+
+### 响应体格式
+
+1. 移除响应体中的 `action` 字段;
+2. 调整获取资源列表时的响应体结构,新的响应体结构示例:
+
+```json
+{
+    "count":2,
+    "list":[
+        {
+            ...
+        },
+        {
+            ...
+        }
+    ]
+}
+```
+
+### 分页
+
+获取资源列表时支持分页查询,分页参数包括:
+
+| 参数       | 默认值 | 范围     | 说明           |
+| --------- | ------ | -------- | ------------ |
+| page      | 1      | >=1      | 页数          |
+| page_size |        | 10 ~ 500 | 每页资源数量   |
+
+示例:
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes?page=1&page_size=10 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
+{
+  "count": 1,
+  "list": [
+    {
+      ...
+    }
+  ]
+}
+```
+
+支持分页查询的资源:
+
+- Consumer
+- Global Rules
+- Plugin Config
+- Proto
+- Route
+- Service
+- SSL
+- Stream Route
+- Upstream
+
+### 过滤

Review Comment:
   ```suggestion
   ### 支持过滤资源
   ```



##########
docs/zh/latest/admin-api.md:
##########
@@ -29,6 +29,89 @@ Admin API 是为 Apache APISIX 服务的一组 API,我们可以将参数传递
 
 在下面出现的 `X-API-KEY` 指的是 `conf/config.yaml` 文件中的 `apisix.admin_key.key`,它是 Admin API 的访问 token。
 
+## V3
+
+Admin API 在 V3 版本中做了一些不向下兼容的调整,以及支持更多特性。
+
+### 响应体格式
+
+1. 移除响应体中的 `action` 字段;
+2. 调整获取资源列表时的响应体结构,新的响应体结构示例:
+
+```json
+{
+    "count":2,
+    "list":[
+        {
+            ...
+        },
+        {
+            ...
+        }
+    ]
+}
+```
+
+### 分页
+
+获取资源列表时支持分页查询,分页参数包括:
+
+| 参数       | 默认值 | 范围     | 说明           |
+| --------- | ------ | -------- | ------------ |
+| page      | 1      | >=1      | 页数          |
+| page_size |        | 10 ~ 500 | 每页资源数量   |

Review Comment:
   ```suggestion
   | page      | 1      | [1, ...]      | 页数          |
   | page_size |        | [10, 500] | 每页资源数量   |
   ```



##########
docs/zh/latest/admin-api.md:
##########
@@ -29,6 +29,89 @@ Admin API 是为 Apache APISIX 服务的一组 API,我们可以将参数传递
 
 在下面出现的 `X-API-KEY` 指的是 `conf/config.yaml` 文件中的 `apisix.admin_key.key`,它是 Admin API 的访问 token。
 
+## V3
+
+Admin API 在 V3 版本中做了一些不向下兼容的调整,以及支持更多特性。
+
+### 响应体格式
+
+1. 移除响应体中的 `action` 字段;
+2. 调整获取资源列表时的响应体结构,新的响应体结构示例:
+
+```json
+{
+    "count":2,
+    "list":[
+        {
+            ...
+        },
+        {
+            ...
+        }
+    ]
+}
+```
+
+### 分页

Review Comment:
   ```suggestion
   ### 支持分页查询
   ```



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