Upgrade the in-VM agent in place on one or more instances.
curl --request POST \ --url https://stratum.example.com/v1/projects/example/compute/instances/actions/refresh-agent \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "instanceIds": [ "i-a8c2d4e6f0" ] }'The “refresh agent” button. Re-fetches the current agent
binary from IMDS and reinstalls the full systemd unit set on each target
over its live Session Manager channel (no relaunch, no floating IP), so
an instance launched before a unit existed (e.g. the inventory
units) gains it. Requires a LIVE agent channel: an instance whose agent
was never enabled at all has no rail to reach and still needs a relaunch
— that is reported in-band in the per-instance error. Gates on the
compute:RunCommand Cedar action in the project.
the rail is picked per instance from what its agent
advertised on its session channel, never by trying one and waiting. An
agent that supports it runs the refresh as root itself (method: agent-root, the self-update path, no login-user sudo) and checks the
installed binary against the checksum the control plane serves. An
older agent gets the previous run-command refresh (method: sudo-fallback), which needs the agent’s login user to hold
passwordless sudo; when it does not, the result says so in error and
nothing on the instance is changed. Every per-instance failure is
in-band: the call answers 200 as long as the request is well-formed.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Request to upgrade the in-VM agent in place on instances.
object
Target instance ids (i-…). Up to 100 per call.
Example
[ "i-a8c2d4e6f0"]Responses
Section titled “Responses”Per-instance refresh results.
object
One instance’s agent-refresh outcome. Carries the run-command result fields plus the rail the refresh took.
object
The rail the refresh took. agent-root: the agent advertised the root refresh on its session channel and ran the served bootstrap as itself, the same path its heartbeat self-update takes, with no login-user sudo. sudo-fallback: the agent predates that, so the refresh ran as the agent’s login user through passwordless sudo. Absent when the refresh never reached an agent (instance not running, agent unavailable, channel busy); error then says why.
Exit status of the refresh bootstrap on the instance.
Combined stdout+stderr of the refresh, truncated to 64 KiB.
True when output was truncated at the 64 KiB cap.
Set whenever the refresh did not complete on this instance, naming the rail and the reason: not reachable, the login user has no passwordless sudo on the sudo-fallback rail, the bootstrap failed, or the installed agent did not match the checksum the control plane serves. Unlike run-command, a non-zero exitCode always comes with an error here.
Example
{ "results": [ { "instanceId": "i-a8c2d4e6f0", "method": "agent-root", "exitCode": 0, "error": "agent refresh via agent-root failed: the agent bootstrap exited 1 (see output)" } ]}Bad request.
object
The findings of a rejected IAM policy document (custom and resource policies).
One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.
object
The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.
Index of the statement at fault; -1 for the document as a whole.
The offending action, where one is at fault (ACTION_NOT_APPLICABLE).
Field errors, for codes that carry them: each problem at its field
(see FieldError). Documented on the responses that set it, e.g.
approveNodeJoin’s INVALID_INPUT and JOIN_APPROVAL_REFUSED.
Absent otherwise.
One field’s problem, the stage-2 installer API’s shape.
field is the field’s path, message what is wrong with it.
object
The field’s path, e.g. links[0].interface, disks[1].confirm,
mgmt.address or role; empty for the whole request.
Structured facts about the refusal, for codes that carry them. The
shape is fixed per code and documented on the response that answers
it, e.g. IMAGE_POOL_MISMATCH (see ImagePoolMismatchDetails) and
IMAGE_IN_USE. Absent for codes that carry none.
object
Example
{ "issues": [ { "code": "ACTION_NOT_APPLICABLE", "action": "compute:CreateVpc" } ]}Authenticated but not authorized.
object
The findings of a rejected IAM policy document (custom and resource policies).
One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.
object
The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.
Index of the statement at fault; -1 for the document as a whole.
The offending action, where one is at fault (ACTION_NOT_APPLICABLE).
Field errors, for codes that carry them: each problem at its field
(see FieldError). Documented on the responses that set it, e.g.
approveNodeJoin’s INVALID_INPUT and JOIN_APPROVAL_REFUSED.
Absent otherwise.
One field’s problem, the stage-2 installer API’s shape.
field is the field’s path, message what is wrong with it.
object
The field’s path, e.g. links[0].interface, disks[1].confirm,
mgmt.address or role; empty for the whole request.
Structured facts about the refusal, for codes that carry them. The
shape is fixed per code and documented on the response that answers
it, e.g. IMAGE_POOL_MISMATCH (see ImagePoolMismatchDetails) and
IMAGE_IN_USE. Absent for codes that carry none.
object
Example
{ "issues": [ { "code": "ACTION_NOT_APPLICABLE", "action": "compute:CreateVpc" } ]}Request rate limit exceeded. The API-boundary throttle caps request throughput per principal and per project; code is RATE_LIMITED (distinct from the quota engine’s QUOTA_EXCEEDED). The Retry-After header carries the seconds to wait. Applies to any authenticated endpoint — it is enforced by middleware, not per-path.
object
The findings of a rejected IAM policy document (custom and resource policies).
One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.
object
The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.
Index of the statement at fault; -1 for the document as a whole.
The offending action, where one is at fault (ACTION_NOT_APPLICABLE).
Field errors, for codes that carry them: each problem at its field
(see FieldError). Documented on the responses that set it, e.g.
approveNodeJoin’s INVALID_INPUT and JOIN_APPROVAL_REFUSED.
Absent otherwise.
One field’s problem, the stage-2 installer API’s shape.
field is the field’s path, message what is wrong with it.
object
The field’s path, e.g. links[0].interface, disks[1].confirm,
mgmt.address or role; empty for the whole request.
Structured facts about the refusal, for codes that carry them. The
shape is fixed per code and documented on the response that answers
it, e.g. IMAGE_POOL_MISMATCH (see ImagePoolMismatchDetails) and
IMAGE_IN_USE. Absent for codes that carry none.
object
Example
{ "issues": [ { "code": "ACTION_NOT_APPLICABLE", "action": "compute:CreateVpc" } ]}Headers
Section titled “Headers”Seconds to wait before retrying.
