scaleway-cli
scaleway-cli copied to clipboard
`instance server list` fails to list existing server in specific project and zone
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Command attempted
scw instance server list project=project-name zone=fr-par-2
Expected Behaviour
Returns my server in my project-name project and in the fr-par-2 zone.
Actual Behaviour
No servers are returned, even i have a server that is up, running and listed in the Scaleway web console in the project-name project and the fr-par-2 zone.
More info
Build Info: Version 2.2.3+dev BuildDate unknown GoVersion go1.14.10 GitBranch unknown GitCommit unknown GoArch amd64 GoOS linux
Fedora 32
The server was created in the web console, maybe that makes a difference.
Project is the project ID, not name :)
Ah, thanks @Sh4d1 :) Is there a way to list that frow the cli? I just had tried to find it in the cli but couldn't find it.
Grabbed the project ID from the web console and just tried to list my server using scw instance server list project=abdab632-3562-4789-b0f0-XXXXXXXXXXXX zone=fr-par-2 but still, nothing is returned :/
@axelsimon the argument is project-id not project (you can use --help to see all arguments). Can you try again with:
scw instance server list project-id=abdab632-3562-4789-b0f0-XXXXXXXXXXXX zone=fr-par-2
Hi @QuentinBrosse, thanks for your help.
Sadly, using project-id and not project returns the same result: an empty list.
Here's the full command result, when run in debug mode:
$ scw instance server list -D project-id=abdab632-3562-4789-b0f0-XXXXXXXXXXXX zone=fr-par-2
running: [scw instance server list -D project-id=abdab632-3562-4789-b0f0-XXXXXXXXXXXX zone=fr-par-2]
client: using sdk version v1.0.0-beta.7+devclient: using sdk version v1.0.0-beta.7+devcreating GET request on https://api.scaleway.com/instance/v1/zones/fr-par-2/servers?page=1&project=abdab632-3562-4789-b0f0-XXXXXXXXXXXX
--------------- Scaleway SDK REQUEST 1 : ---------------
GET /instance/v1/zones/fr-par-2/servers?page=1&project=abdab632-3562-4789-b0f0-XXXXXXXXXXXX HTTP/1.1
Host: api.scaleway.com
User-Agent: scaleway-sdk-go/v1.0.0-beta.7+dev (go1.14.10; linux; amd64) scaleway-cli/2.2.3+dev
X-Auth-Token: 40c2047c-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Accept-Encoding: gzip
---------------------------------------------------------
--------------- Scaleway SDK RESPONSE 1 : ---------------
HTTP/2.0 200 OK
Content-Length: 15
Content-Security-Policy: default-src 'none'; frame-ancestors 'none'
Content-Type: application/json
Date: Tue, 08 Dec 2020 19:28:25 GMT
Link: </servers?page=0&per_page=50&project=abdab632-3562-4789-b0f0-XXXXXXXXXXXX; rel="last"
Server: Scaleway API-Gateway
Strict-Transport-Security: max-age=63072000
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Request-Id: b61e60d7-3be1-4d2c-a629-63040beeb282
X-Total-Count: 0
{"servers": []}
----------------------------------------------------------fieldType '*instance.PlacementGroup' is not marshallableID NAME TYPE STATE ZONE PUBLIC IP PRIVATE IP TAGS IMAGE NAME MODIFICATION DATE CREATION DATE VOLUMES PROTECTED SECURITY GROUP NAME SECURITY GROUP ID STATE DETAIL ARCH IMAGE ID
skipping check version
skipping telemetry report
Hi @axelsimon, does your default-project-id (or default-organisation-id) is set to abdab632-3562-4789-b0f0-XXXXXXXXXXXX?
The token generated by the CLI has access to a single project.
Some interesting links:
Hi, sorry for the slow reply.
No, the default-project-id and default-organisation-id are both set to another value, which is (of course) the same as the one for the default org and project in the web interface.
No offence, but it's a bit stupid that the CLI tool that is supposed to help you manage your machines faster than by clicking around in the web interface ends up taking so much more time to do anything, because by default it's scoped to not have access to anything but the default project, in the default org.
Is there a way to make the CLI generate a token that has access to all projects?
Could that be made the default in future versions of scw?
Thanks
This is not a CLI problem. Creating a token with access to multiple project will come with IAM. Also, the best way to use multiple projects with different api keys is using profiles for the moment.