WSO2-APIM-CLI(导入/导出)工具list-apis函数仅在结果中返回25个项目

时间:2018-09-06 10:23:10

标签: wso2-am

我尝试了以下步骤,从wso2am-2.2.0导入/扩展api

  1. 下载api-import-export-2.2.0-v4.war文件并将其复制到/ repository / deployment / server / webapps文件夹中
  2. 将apimcli-1.1.0-linux-x64.tar.gz下载并解压缩到Linux机器的首选位置
  3. 在apimcli工具中添加命名的mylocalhost:
./apimcli add-env -n mylocalhost \
    --registration https://localhost:9443/client-registration/v0.13/register \
    --apim https://localhost:9443 \
    --token https://localhost:8243/token \
    --import-export https://localhost:9443/api-import-export-2.5.0-v1 \
    --admin https://localhost:9443/api/am/admin/v0.13 \
    --api_list https://localhost:9443/api/am/publisher/v0.13/apis \
    --app_list https://localhost:9443/api/am/store/v0.13/applications
  1. 使用以下命令请求在环境mylocalhost上创建的所有api的列表,
  

./apimcli --insecure list apis -e mylocalhost -u admin -p admin

我返回了以下输出,但即使实际的API计数超过25,也总是只返回25个项目。

有人可以告诉我为什么吗?

<<<< strong>输出>>>

Environment: mylocalhost
No. of APIs: 25
+------------------------------------+---------+----------------------------------------------+------------+----------+--------------------------------------+
|                NAME                | VERSION |                   CONTEXT                    |   STATUS   | PROVIDER |                  ID                  |
+------------------------------------+---------+----------------------------------------------+------------+----------+--------------------------------------+
| DevOps_Test1                       |     001 | /devops1                                     | PUBLISHED  | admin    | f2ca6d69-6654-4c66-8bf7-c41f506e85d9 |
| DevOps_Test2                       | v1.0.0  | /devops2                                     | PUBLISHED  | admin    | b4a6c2a4-44b6-416d-8f33-9d278ee8cd55 | 
| DevOps_Test3                       |     001 | /devops3                                     | CREATED    | admin    | d50addce-3ee6-40a1-9d68-0147625178dc |
| DevOps_Test4                       |     001 | /devops4                                     | PUBLISHED  | admin    | 9f5d3c9c-f4e9-42db-86e8-ab7d0caeb58e |
| DevOps_Test5                       | v1      | /devops5                                     | PUBLISHED  | admin    | e5b2938c-4586-4a92-add2-e1fa02841b34 |
| DevOps_Test6                       |     001 | /devops6                                     | PUBLISHED  | admin    | 09234299-34e4-4603-8aa1-08082e47b73e |
| DevOps_Test7                       |     001 | /devops7                                     | PUBLISHED  | admin    | ff16e906-e345-4c48-9e5e-466651d6f8c6 |
| DevOps_Test8                       |     001 | /devops8                                     | PUBLISHED  | admin    | 60763f04-2178-40e2-bf11-12a5d6d536fa |
| DevOps_Test9                       |     001 | /devops9                                     | PUBLISHED  | admin    | 640f8585-0b2c-4c41-8ba5-0d5c6a93a66a |
| DevOps_Test10                      |     001 | /devops10                                    | PUBLISHED  | admin    | 61132bca-76c5-4cf9-b882-79c0a53567fb |
| DevOps_Test11                      |     001 | /devops11                                    | PUBLISHED  | admin    | 552e4954-5937-44b5-8c94-332a9358f026 |
| DevOps_Test12                      | 1.0.0   | /api/devops12                                | PUBLISHED  | admin    | 54b3e604-7753-46aa-8363-839db7df1b22 |
| DevOps_Test13                      | 1.0.0   | /api/devops13                                | PUBLISHED  | admin    | a1be533f-8fba-4d4f-be35-9d40141f7f49 |
| DevOps_Test14                      |     001 | /devops14                                    | PUBLISHED  | admin    | 8c00d02f-dcbf-4477-8f4e-e45ae33ed216 |
| DevOps_Test14                      |     002 | /devops14                                    | PUBLISHED  | admin    | 79fe53b0-750b-4198-be44-10f68b000dc7 |
| DevOps_Test14                      |     003 | /devops14                                    | PUBLISHED  | admin    | b959d0dd-605b-4c5c-aad7-e956542cb63c |
| DevOps_Test15                      |     001 | /devops15                                    | PUBLISHED  | admin    | d1002f45-faf0-466e-a78a-c42ed3bd4df9 |
| DevOps_Test16                      | 1.0.0   | /devops16                                    | PUBLISHED  | admin    | 9b69d553-b22e-45de-8711-317e7e93abe7 |
| DevOps_Test17                      |       1 | /devops17                                    | PROTOTYPED | admin    | 31a4bae4-470c-4226-9d2b-d6cc4b850f0e |
| DevOps_Test18                      | 1.0.0   | /devops18                                    | PROTOTYPED | admin    | c052a322-5493-4077-a826-0bed56e19d51 |
| DevOps_Test19                      |     001 | /devops19                                    | PUBLISHED  | yasas    | 1322fbab-c0be-4fa8-9d79-5bc46b7ceee7 |
| DevOps_Test20                      |     001 | /devops20                                    | PUBLISHED  | yasas    | 912ebb5c-dbb7-4ac4-99b0-3942104af0c6 |
| DevOps_Test21                      |     001 | /devops21                                    | PUBLISHED  | yasas    | df999477-c209-470e-94a0-ab26e78b6f69 |
| DevOps_Test22                      |     001 | /devops22                                    | PUBLISHED  | yasas    | c0009f59-4245-455e-b00a-43f671af4206 |
| DevOps_Test23                      |     001 | /devops23                                    | PUBLISHED  | yasas    | 51819611-f515-444c-a90b-8b02d766ba0c |
+------------------------------------+---------+----------------------------------------------+------------+----------+--------------------------------------+

1 个答案:

答案 0 :(得分:1)

这是因为API管理器列表API返回25作为返回的API列表的默认限制,并且似乎在API Manager CLI工具中未处理分页。解决方法是将限制vector参数添加到set<string> s( vec.begin(), vec.end() ); vec.assign( s.begin(), s.end() ); 中的set<string> s; for(auto iter = begin(vec); iter != end(vec); iter++) { s.insert(*iter); } vec.assign( s.begin(), s.end() ); 网址中。在query位置找到main_config.yaml。

例如:api_list_endpoint