dongtan5555 2017-07-14 18:53
浏览 10

从GO程序登录到Bluemix时出错

I don't know if this is the correct place or not to ask this question.

I am writing a program in GO. I am trying to issue the bx login command from the program and it fails. I can manually login on the command line and have the GO program issue the bx regions command successfully.

The GO code is:

tmpapikey := "--apikey " + risapikey
        cmd := exec.Command("bx", "login", tmpapikey, "-o", "\"Research Integrated Solutions\"", "-s dev")
        cmd.Stdout = &cmdout
        cmd.Stderr = &cmderr
        fmt.Printf("DEBUG: cmd struct is: %+v
", cmd)
        err = cmd.Run()
        fmt.Printf("DEBUG: stdout from cmd %s, stderr from cmd %s
",

The command in the exec Command structure is:

bx login --apikey <Real API key> -o "Research Integrated Solutions" -s dev

The error is:

Incorrect Usage.

NAME: login - Log user in

USAGE: bx login [-a API_ENDPOINT] [--sso] [-u USERNAME] [-p PASSWORD] [--apikey KEY | @KEY_FILE] [-c ACCOUNT_ID] [-o ORG] [-s SPACE]

(plus the rest of the help for the bx login command).

This exact command will work when run from the command line.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
    • ¥70 2048小游戏毕设项目
    • ¥20 mysql架构,按照姓名分表
    • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
    • ¥15 Macbookpro 连接热点正常上网,连接不了Wi-Fi。
    • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
    • ¥15 linux驱动,linux应用,多线程
    • ¥20 我要一个分身加定位两个功能的安卓app
    • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
    • ¥15 IAR程序莫名变量多重定义