I have an organization that has multiple users being part of this organization.
When I used my private docker account I could access the resources such as stacks, etc. through the docker-cloud CLI.
I’m using MacOS with docker-cloud CLI installed using brew.
How am I supposed to address any resources associated with the organization? I can only see my personal stacks and resources when I use the CLI. Is there a way to log in as the organization or in some other way specify which organization to work with?
The docker-cloud login argument doesn’t really provide much options.
The TL;DR: version is that you can pass an optional namespace in the API calls to access organization resources. If you don’t specify a namespace, the API assumes you mean the namespace of the authenticated user.
I’m still a bit confused how this translates beyond the HTTP API calls (where you are able to specify the URL).
When I use the CLI there is no way to specify the namespace - or am I missing something here?
We’re in a situation where we try to automate part of the deployment process and a part of that is to be able to push new versions of the stack definition file from the command line. I would rather not have to dive into the HTTP REST API calls just to do that if not absolutely necessary. Also it would be nice to be able to use the other CLI commands towards an organisation (namespace).
Thanks in advance! And also thanks for an awesome service - Docker Cloud has really made my life soo much easier.
You can do it -> https://github.com/docker/dockercloud-cli#namespace
Either you set the environment variable to work with your organisation or you prefix the env var before every CLI command, whatever works best for your use case.
Basically (maybe this info is useful to your automation), what CLI does is to add the namespace in the resource URI that you are going to work with. For example, the list URL to work with stacks is
/api/app/v1/(namespace/)stack/
Where the namespace is optional. If you do not specify the namespace, by default it will take the namespace of the user that logs in.