get_deployments
Get Deployments · read tool
Where a Service runs: each Deployment’s Environment, its full Deployment Target chain (outermost first), main url, named endpoints and instances (a count, or {min, max} for autoscale). Pass environment for one Environment, e.g. a Service’s URL in staging.
| Field | Type | Required | Notes |
|---|---|---|---|
service |
string | yes | The Service’s qualified id, project:id. |
environment |
string | An Environment id, such as prod or staging. | |
limit |
integer | The most items to return; truncated says whether there were more. Default: 50. At least 1. At most 9007199254740991. |
|
at |
string | A point in time to answer at: a tag, a commit sha or its first 4 or more characters, or a date (YYYY-MM-DD) or time (ISO 8601, UTC unless it gives a zone). On a checkout, any git ref works too. Leave out for the current Workspace. |
Output
Section titled “Output”| Field | Type | Required | Notes |
|---|---|---|---|
service |
object | yes | |
service.id |
string | yes | |
service.kind |
"person" or "system" or "service" or "component" |
yes | |
service.name |
string | yes | |
environment |
string or null | yes | |
total |
number | yes | |
truncated |
boolean | yes | |
deployments |
list of object | yes | |
deployments[].environment |
string | yes | |
deployments[].target |
string | yes | |
deployments[].url |
string or null | yes | |
deployments[].endpoints |
list of object | yes | |
deployments[].instances |
number or object | yes | Default: 1. |
deployments[].owner |
string | yes | |
deployments[].source |
object | yes | |
deployments[].targetPath |
list of object | yes |
Example
Section titled “Example”Called over the Kitchen sink example Workspace.
Arguments:
{ "service": "sink:api"}Result:
{ "service": { "id": "sink:api", "kind": "service", "name": "API" }, "environment": null, "total": 1, "truncated": false, "deployments": [ { "environment": "prod", "target": "sink:cluster", "targetPath": [ { "id": "sink:cloud", "name": "Cloud region", "kind": "region" }, { "id": "sink:cluster", "name": "Kubernetes cluster", "kind": "k8s" } ], "url": "https://api.sink.example", "endpoints": [ { "name": "health", "url": "https://api.sink.example/healthz" } ], "instances": 3, "owner": "core", "source": { "file": "examples/kitchen-sink/archidocs/sink/deployments.yaml", "line": 18 } } ]}Errors
Section titled “Errors”A call that fails returns isError: true, with {code, message, suggestions?} as structuredContent. This tool returns:
invalid_inputwhen the arguments don’t fit the input above.not_foundwhen an id or name, or the point in history given asat, matches nothing, or a sha prefix starts more than one Revision, with the candidates.source_unavailablewhen the server can’t read the Workspace.history_unavailablewhen the Workspace has no history to read atat.
Error codes says what to do about each.
See also
Section titled “See also”Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.