代码之家  ›  专栏  ›  技术社区  ›  daggett

apimcli list api:400错误请求

  •  1
  • daggett  · 技术社区  · 6 年前

    我有wso2am-2.5.0和apimcli-1.1.0

    https://wso2.com/api-management/install/

    我尝试配置和使用 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
    

    --api_list 在文件中定义为 --list

    apimcli add-env --help --api\U列表 相反

    最后,我尝试获取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
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   Bee    6 年前

    看来publisher的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

    推荐文章