【问题标题】:apimcli list apis : 400 Bad requestapim cli list api:400 错误请求
【发布时间】:2019-08-26 13:41:29
【问题描述】:

我有 wso2am-2.5.0 和 apimcli-1.1.0

全部从这里下载:https://wso2.com/api-management/install/

我尝试在本地运行 wso2am 配置和使用 apimcli

所以,我添加了名为 local 的环境:

apimcli add-env -n local 
    --apim          https://localhost:9443  
    --registration  https://localhost:9443/identity/connect/register 
    --import-export https://localhost:9443/api-import-export-2.2.0-v2
    --api_list      https://localhost:9443/api/am/publisher/v0.12/apis 
    --token         https://localhost:9443/oauth2/token

注意文档中定义为--list的参数--api_list

但是 apimcli add-env --help 显示 --api_list 而不是

最后我尝试获取 api 列表:

apimcli list apis -e local -u admin -p admin --insecure --verbose

但它给了我以下输出:

Executed ImportExportCLI (apimcli) on Wed, 26 Sep 2018 15:59:48 EEST
[INFO]: Insecure: true
[INFO]: apis called
[INFO]: Environment: 'local'
[INFO]: Reg Endpoint read: https://localhost:9443/identity/connect/register
Getting ClientID, ClientSecret: Status - 403 Forbidden
Error: <nil>
Body: 
<html>
    <head>
        <title>Error 403</title>
    </head>
    <body>
        <h1>Error 403 - Forbidden</h1>
    </body>
</html>
Error: Request didn't respond 200 OK: 403 Forbidden
[INFO]: EnvKeysAll: &{map[]}
[ERROR]: connecting to https://localhost:9443/oauth2/token
apimcli: Unable to connect. Reason: Status: 400 Bad Request
[ERROR]: Unable to connect.: Status: 400 Bad Request
Exit status 1

【问题讨论】:

    标签: wso2 wso2-am


    【解决方案1】:

    好像发布者API版本不对。

    --api_list https://localhost:9443/api/am/publisher/v0.12/apis

    将其设为v0.13,然后重试。


    编辑: 看来 DCR 端点也是错误的。改成这样。

    --registration https://localhost:9443/client-registration/v0.13/register

    cli 附带的自述文件似乎不正确。 :-/

    请改用以下文档。

    https://docs.wso2.com/display/AM250/Migrating+the+APIs+and+Applications+to+a+Different+Environment

    【讨论】:

    • 问题解决了。谢谢。但我在导出过程中得到了新的:apimcli export-api -n first -v 1.0.0 -r admin -e local -u admin -p admin --insecure -> [ERROR]: Error exporting API: first: Get https://localhost:9443/carbon/admin/login.jsp: Auto redirect is disabled
    • 进出口战争也是错误的。您需要使用正确的版本。
    • @daggett 我目前遇到的问题与您相同:自动重定向已禁用。您找到解决此问题的方法了吗?
    • @jdel,请仔细按照 APIM 服务器版本的说明进行操作,然后它应该可以工作
    猜你喜欢
    • 2021-01-07
    • 2022-01-04
    • 2020-11-13
    • 2011-06-18
    • 2017-02-13
    • 1970-01-01
    • 1970-01-01
    • 2018-11-20
    • 2023-03-08
    相关资源
    最近更新 更多