commands.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:dockercloud-cli 作者: docker 项目源码 文件源码
def node_byo():
    token = ""
    try:
        if dockercloud.namespace:
            json = dockercloud.api.http.send_request("POST", "api/infra/%s/%s/token" %
                                                     (API_VERSION, dockercloud.namespace))
        else:
            json = dockercloud.api.http.send_request("POST", "api/infra/%s/token" % API_VERSION)
        if json:
            token = json.get("token", "")
    except Exception as e:
        print(e, file=sys.stderr)
        sys.exit(EXCEPTION_EXIT_CODE)

    print("Docker Cloud lets you use your own servers as nodes to run containers. "
          "For this you have to install our agent.")
    print("Run the following command on your server:")
    print()
    print("\tcurl -Ls https://get.cloud.docker.com/ | sudo -H sh -s", token)
    print()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号