Skip to content

Cancel an in-flight build.

POST
/v1/projects/{projectId}/compute/image-builds/{buildId}/actions/cancel
Code sample: Shell / cURL
curl --request POST \
--url https://stratum.example.com/v1/projects/example/compute/image-builds/example/actions/cancel \
--header 'Authorization: Bearer <token>'

Flags the build; the reconciler finishes the step in flight, terminates the throwaway and marks it canceled. 409 INVALID_STATE once terminal. Gated on compute:CancelImageBuild.

projectId
required
string
/^p-[a-z0-9-]+$/
buildId
required
string
/^ib-[a-z0-9-]+$/

The build with cancelRequested.

Media typeapplication/json

One build of a recipe (ib-…), the desired-state row the image-builder reconciler drives: pending → launching → provisioning → testing → imaging → distributing → succeeded | failed | canceled on a throwaway instance tagged stratum.dev/image-build=<id> that is always terminated (instanceGone is the observation that it is).

object
id
required
string
recipeId
required
string
projectId
required
string
number
required
integer
phase
required
string
Allowed values: pending launching provisioning testing imaging distributing succeeded failed canceled
phaseAt
required
string format: date-time
cancelRequested
boolean
baseImageId

The image the base resolved to at launch.

string
instanceId

The throwaway build instance.

string
instanceGone
required
boolean
outputImageId
string
steps
required
Array<object>

One step’s or test’s recorded outcome. The full output is in the project’s Logs (group image-builder, stream = the build id); the row keeps the last 4 KiB as outputTail.

object
name
required
string
kind
required
string
Allowed values: cloudInit runCommand
status
required
string
Allowed values: pending succeeded failed skipped
exitCode
integer
durationMs
integer format: int64
startedAt
string format: date-time
finishedAt
string format: date-time
outputTail
string
error

Set when the step could not run at all (agent unavailable, timeout).

string
tags

Tags the step discovered for the output image: every stratum-image-tag: <key>=<value> line in its output (valid, non-reserved keys only). Laid over the recipe’s output.tags at create-image, later steps winning.

object
key
additional properties
string
tests
required
Array<object>

One step’s or test’s recorded outcome. The full output is in the project’s Logs (group image-builder, stream = the build id); the row keeps the last 4 KiB as outputTail.

object
name
required
string
kind
required
string
Allowed values: cloudInit runCommand
status
required
string
Allowed values: pending succeeded failed skipped
exitCode
integer
durationMs
integer format: int64
startedAt
string format: date-time
finishedAt
string format: date-time
outputTail
string
error

Set when the step could not run at all (agent unavailable, timeout).

string
tags

Tags the step discovered for the output image: every stratum-image-tag: <key>=<value> line in its output (valid, non-reserved keys only). Laid over the recipe’s output.tags at create-image, later steps winning.

object
key
additional properties
string
distribution

Per-target results of the roll.

Array<object>

One distribution target’s outcome, written the moment it lands. Exactly one of launchTemplateId / autoScalingGroupId is set; error carries a refusal (the build still succeeded).

object
launchTemplateId
string
versionId
string
setDefault
boolean
autoScalingGroupId
string
instanceRefreshId
string
error
string
trigger
required
string
Allowed values: manual schedule
reason

Why the build is not progressing, in whatever sense applies: on a failed or canceled build, why it ended; on a succeeded one, how many distribution targets were refused; and on a build still in flight, the converge refusal it is currently retrying — a full compute.images.count, an unreachable backend. Cleared when the build gets through or changes phase, so a value here is always live.

string
requestedBy
required
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
finishedAt
string format: date-time

Example

{
"phase": "pending",
"steps": [
{
"kind": "cloudInit",
"status": "pending"
}
],
"tests": [
{
"kind": "cloudInit",
"status": "pending"
}
],
"trigger": "manual"
}

Authenticated but not authorized.

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance
string format: uri-reference
requestId
required
string
code
required
string
issues

The findings of a rejected IAM policy document (custom and resource policies).

Array<object>

One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.

object
code
required

The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.

string
statement
required

Index of the statement at fault; -1 for the document as a whole.

integer
>= -1
detail
required
string
action

The offending action, where one is at fault (ACTION_NOT_APPLICABLE).

string
errors

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.

Array<object>

One field’s problem, the stage-2 installer API’s shape. field is the field’s path, message what is wrong with it.

object
field
required

The field’s path, e.g. links[0].interface, disks[1].confirm, mgmt.address or role; empty for the whole request.

string
message
required
string
details

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
key
additional properties
any

Example

{
"issues": [
{
"code": "ACTION_NOT_APPLICABLE",
"action": "compute:CreateVpc"
}
]
}

Resource not found.

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance
string format: uri-reference
requestId
required
string
code
required
string
issues

The findings of a rejected IAM policy document (custom and resource policies).

Array<object>

One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.

object
code
required

The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.

string
statement
required

Index of the statement at fault; -1 for the document as a whole.

integer
>= -1
detail
required
string
action

The offending action, where one is at fault (ACTION_NOT_APPLICABLE).

string
errors

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.

Array<object>

One field’s problem, the stage-2 installer API’s shape. field is the field’s path, message what is wrong with it.

object
field
required

The field’s path, e.g. links[0].interface, disks[1].confirm, mgmt.address or role; empty for the whole request.

string
message
required
string
details

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
key
additional properties
any

Example

{
"issues": [
{
"code": "ACTION_NOT_APPLICABLE",
"action": "compute:CreateVpc"
}
]
}

Conflicting state.

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
>= 400 <= 599
detail
string
instance
string format: uri-reference
requestId
required
string
code
required
string
issues

The findings of a rejected IAM policy document (custom and resource policies).

Array<object>

One finding of a rejected IAM policy document. A rejection lists every finding, so the author fixes the document in one round trip.

object
code
required

The finding, e.g. INVALID_DOCUMENT, UNKNOWN_ACTION, ACTION_NOT_APPLICABLE.

string
statement
required

Index of the statement at fault; -1 for the document as a whole.

integer
>= -1
detail
required
string
action

The offending action, where one is at fault (ACTION_NOT_APPLICABLE).

string
errors

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.

Array<object>

One field’s problem, the stage-2 installer API’s shape. field is the field’s path, message what is wrong with it.

object
field
required

The field’s path, e.g. links[0].interface, disks[1].confirm, mgmt.address or role; empty for the whole request.

string
message
required
string
details

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
key
additional properties
any

Example

{
"issues": [
{
"code": "ACTION_NOT_APPLICABLE",
"action": "compute:CreateVpc"
}
]
}