cloudthinker api calls any Public API operation and prints the JSON response. It uses your CLI login, or the token in CLOUDTHINKER_TOKEN, so scripts need no curl headers.
Prerequisites
- The CloudThinker CLI installed, and either logged in or with
CLOUDTHINKER_TOKENset to an API token. - jq for the scripted examples.
Read data
Name the operation as<module>.<resource>.<verb>. Query parameters become flags:
--all follows every page and prints all items, up to 10,000. Use it only when you need everything; each page counts against your rate limit. The CLI doesn’t retry a 429: wait for the Retry-After time, then run the command again.
cloudthinker <module> <resource> <verb> runs the same operation, for example cloudthinker review reviews list --limit 5.
To see every operation, run cloudthinker api --list. It prints each operation’s command, name, method and scope; add --json for a JSON table.
You can also name the method and path instead of the operation. The path must match a Public API operation. On this form, pass each query parameter as --query NAME=VALUE, repeated as needed:
Write data
Pick the workspace
A CLI login and an API token each cover one workspace, andapi calls that workspace. A call to any other workspace returns 404.
To call another workspace with a login, log in to it once, then pick it with the global --workspace before the command: cloudthinker --workspace Production api review.releases.list. With CLOUDTHINKER_TOKEN, use a token for that workspace instead. Don’t set --workspace or CLOUDTHINKER_WORKSPACE beside the token: the command exits with code 2.
Related
Use CloudThinker in CI/CD
Run these calls from a pipeline with a service account.
CLI Reference
Every command, flag and exit code.