Rancher Version:
Rancher v1.2.0-pre4-rc5
Cattle v0.170.4
User Interface v1.2.18
Rancher Compose v0.11.0-rc5
Docker Version:
Docker version 1.10.3, build 20f81dd
OS and where are the hosts located? (cloud, bare metal, etc):
RancherOS, AWS
Setup Details: (single node rancher vs. HA rancher, internal DB vs. external DB)
single node rancher
Environment Type: (Cattle/Kubernetes/Swarm/Mesos)
Cattle
Steps to Reproduce:
Creating an Account API key. Calling api like that:
GET /v2-beta/projects HTTP/1.1
Host: rancher.something.something
Authorization: Basic XXXX
Accept: application/json
Cache-Control: no-cache
Results:
{
"type": "collection",
"resourceType": "project",
"links": {
"self": "https://rancher.something.something/v2-beta/projects"
},
"createTypes": {},
"actions": {},
"data": [],
"sortLinks": {},
"pagination": null,
"sort": null,
"filters": {},
"createDefaults": {}
}
However, if I try to get a project by id it works:
GET /v2-beta/projects/1a11 HTTP/1.1
Host: rancher.something.something
Authorization: Basic XXX
Accept: application/json
Cache-Control: no-cache
Expected:
Allows the user to browse all the projects it has access to.
P.S. Calling /v1
instead of /v2-beta
gives similar results.
The funny thing it works fine for an environment api key, even though it always returns a single environment (project).
Listing environments/projects only returns ones the account is a member of. If your account is an admin, then you can add an all=true
query param to see the others that you are not a member of.
thanks @vincent99 - that worked. It wasn't clear enough from the API though...
I too stumbled on this, thanks @vincent99.
Looks like Bearer Token works but not Access keys
Most helpful comment
Listing environments/projects only returns ones the account is a member of. If your account is an admin, then you can add an
all=true
query param to see the others that you are not a member of.