Skip to content

Execute the teardown plan the operator confirmed.

POST
/v1/admin/services/{key}/teardown
Code sample: Shell / cURL
curl --request POST \
--url https://stratum.example.com/v1/admin/services/db/teardown \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "planId": "example" }'

Records the teardown (tenant routes answer 503 from here on), issues each listed resource’s own delete as the operator, and returns 202. A reconciler finishes it and switches the service off once none is left; follow it with GET. Audited Critical (platform.service.teardown.started / .completed). A teardown that cannot finish is stopped with POST…/teardown/cancel.

Refusals:

  • 409 PLAN_STALE: the resources changed since the plan was shown. The body carries the fresh plan; show it and confirm again.
  • 409 TEARDOWN_BLOCKED: an item has a blocker. The body carries the plan.
  • 409 TEARDOWN_RUNNING: one is already running.
  • 409 TEARDOWN_NOT_SUPPORTED: the service has no teardown.

Cedar action: platform:ManageServices.

key
required
string
Allowed values: db k8s client-vpn backup s3 secrets security asg

A registered service key. images and lb are always-on services with no registry row, so they are not addressable here.

Media typeapplication/json
object
planId
required
string

Example generated

{
"planId": "example"
}

Started; the plan as executed.

Media typeapplication/json

What a service teardown would delete, grouped by project. The console shows it in the standard confirm modal; executing requires this planId, and a plan whose resources changed since is refused (PLAN_STALE).

object
service
required
string
planId
required

A hash of the listed resources, not a stored object.

string
projects
required
Array<object>
object
projectId
required
string
projectName
string
orgName
string
items
required
Array<object>

One live tenant resource a teardown deletes.

object
kind
required

Db-instance, backup-plan or client-vpn-endpoint.

string
id
required
string
name
string
projectId
required
string
action
required

A database instance keeps a final snapshot, which is not deleted.

string
Allowed values: delete final-snapshot-then-delete
finalSnapshot

The final snapshot’s name, for final-snapshot-then-delete.

string
blocker

Why a teardown cannot delete it (deletion protection, a blue/green member). Clear it through the resource’s own API; the plan cannot be executed while any item is blocked.

string
status

Where the resource is now, in progress (e.g. “deleting”).

string
count
required
integer
blocked
required

At least one item has a blocker; executing is refused.

boolean
finalSnapshots
required
integer

Example

{
"projects": [
{
"items": [
{
"action": "delete"
}
]
}
]
}

Bad request.

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"
}
]
}

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"
}
]
}

Refused. PLAN_STALE and TEARDOWN_BLOCKED answer with the plan (ServiceTeardownConflict); TEARDOWN_RUNNING and TEARDOWN_NOT_SUPPORTED with a plain problem.

Media typeapplication/problem+json
One of:

A refused teardown execute. PLAN_STALE carries the fresh plan to show and confirm again; TEARDOWN_BLOCKED carries the plan with each item’s blocker.

object
type
string
title
string
status
required
integer
code
required
string
Allowed values: PLAN_STALE TEARDOWN_BLOCKED
detail
string
plan
required

What a service teardown would delete, grouped by project. The console shows it in the standard confirm modal; executing requires this planId, and a plan whose resources changed since is refused (PLAN_STALE).

object
service
required
string
planId
required

A hash of the listed resources, not a stored object.

string
projects
required
Array<object>
object
projectId
required
string
projectName
string
orgName
string
items
required
Array<object>

One live tenant resource a teardown deletes.

object
kind
required

Db-instance, backup-plan or client-vpn-endpoint.

string
id
required
string
name
string
projectId
required
string
action
required

A database instance keeps a final snapshot, which is not deleted.

string
Allowed values: delete final-snapshot-then-delete
finalSnapshot

The final snapshot’s name, for final-snapshot-then-delete.

string
blocker

Why a teardown cannot delete it (deletion protection, a blue/green member). Clear it through the resource’s own API; the plan cannot be executed while any item is blocked.

string
status

Where the resource is now, in progress (e.g. “deleting”).

string
count
required
integer
blocked
required

At least one item has a blocker; executing is refused.

boolean
finalSnapshots
required
integer

Example

{
"code": "PLAN_STALE",
"plan": {
"projects": [
{
"items": [
{
"action": "delete"
}
]
}
]
}
}