Skip to content

Ask the service to drain and exit.

API version mission-write unreleased

POST
/shutdown

The service stops accepting writes and repairs (health reads draining and a new write or repair is refused with SERVICE_DRAINING). A write or repair still waiting for the turn or the Mission lock when draining begins answers 503 SERVICE_DRAINING and writes nothing; one already holding the lock finishes. The service finishes the writes it holds, removes its endpoint file while it still names this instance and exits 0. It answers 202 before it exits; a shutdown while it already drains is answered 202 and starts nothing new. Settled when command-cli was built (spec-kitty/spec-kitty-events#156).

Authorizations

Parameters

Header Parameters

Spec-Kitty-Write-Protocol
required
ProtocolVersion

A major version of the write-service protocol, a positive integer. The client sends the major it negotiated in the Spec-Kitty-Write-Protocol header; the handshake lists the majors the service speaks. This document describes major 1.

integer
>= 1

The protocol major the client negotiated through GET /handshake. A missing header, a value that is not an integer, or a major the service does not speak, is refused with PROTOCOL_VERSION_UNSUPPORTED.

Responses

202

The service drains and exits.

400

The request was refused before it was read (400): REQUEST_MALFORMED or PROTOCOL_VERSION_UNSUPPORTED.

Media type application/problem+json
WriteRefusal

The body of every refused write-service request: the shared Problem with a code from WriteRefusalCode and the status that code fixes. A guard refusal also carries type, a WriteRefusalReason URN; every other refusal omits type (about:blank). The body never echoes the bearer token, a host path or row content. A refused batch names the unit that failed in instance, as the JSON pointer #/units/ of the request. Consumers branch on code, never on title.

object
code
required

A stable machine-readable code for the problem, such as the name of a refusal reason. Consumers branch on it, never on the title.

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
instance

A URI reference that identifies this occurrence of the problem.

string
status
required

The HTTP status code of this occurrence.

integer
>= 400 <= 599
title
required

A short, human-readable summary of the kind of problem. It does not change between occurrences.

string
type

A URI reference that identifies the kind of problem. Absent means about:blank.

string
code
required
One of:
WriteRefusalCode
  1. The lane state machine or one of its guards refused the transition. The type names the reason, including stale_from_lane for a stale unit whose from_lane is not the work package’s current lane. The CLI’s orchestrator-api code for a TransitionError.
string
Allowed value: TRANSITION_REJECTED
type
One of:
WriteRefusalReason

The from or to status lane is not one of the 11 persisted Lane values.

string
Allowed value: urn:spec-kitty:write-refusal:unknown_lane

401

The bearer token is missing or wrong (401, WRITE_TOKEN_INVALID). The body never echoes the token.

Media type application/problem+json
WriteRefusal

The body of every refused write-service request: the shared Problem with a code from WriteRefusalCode and the status that code fixes. A guard refusal also carries type, a WriteRefusalReason URN; every other refusal omits type (about:blank). The body never echoes the bearer token, a host path or row content. A refused batch names the unit that failed in instance, as the JSON pointer #/units/ of the request. Consumers branch on code, never on title.

object
code
required

A stable machine-readable code for the problem, such as the name of a refusal reason. Consumers branch on it, never on the title.

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
instance

A URI reference that identifies this occurrence of the problem.

string
status
required

The HTTP status code of this occurrence.

integer
>= 400 <= 599
title
required

A short, human-readable summary of the kind of problem. It does not change between occurrences.

string
type

A URI reference that identifies the kind of problem. Absent means about:blank.

string
code
required
One of:
WriteRefusalCode
  1. The lane state machine or one of its guards refused the transition. The type names the reason, including stale_from_lane for a stale unit whose from_lane is not the work package’s current lane. The CLI’s orchestrator-api code for a TransitionError.
string
Allowed value: TRANSITION_REJECTED
type
One of:
WriteRefusalReason

The from or to status lane is not one of the 11 persisted Lane values.

string
Allowed value: urn:spec-kitty:write-refusal:unknown_lane

Headers

WWW-Authenticate
string

The bearer challenge (RFC 9110), Bearer with no parameters.

403

The Host, Origin or Sec-Fetch-Site guard refused the request (403, REQUEST_REFUSED).

Media type application/problem+json
WriteRefusal

The body of every refused write-service request: the shared Problem with a code from WriteRefusalCode and the status that code fixes. A guard refusal also carries type, a WriteRefusalReason URN; every other refusal omits type (about:blank). The body never echoes the bearer token, a host path or row content. A refused batch names the unit that failed in instance, as the JSON pointer #/units/ of the request. Consumers branch on code, never on title.

object
code
required

A stable machine-readable code for the problem, such as the name of a refusal reason. Consumers branch on it, never on the title.

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
instance

A URI reference that identifies this occurrence of the problem.

string
status
required

The HTTP status code of this occurrence.

integer
>= 400 <= 599
title
required

A short, human-readable summary of the kind of problem. It does not change between occurrences.

string
type

A URI reference that identifies the kind of problem. Absent means about:blank.

string
code
required
One of:
WriteRefusalCode
  1. The lane state machine or one of its guards refused the transition. The type names the reason, including stale_from_lane for a stale unit whose from_lane is not the work package’s current lane. The CLI’s orchestrator-api code for a TransitionError.
string
Allowed value: TRANSITION_REJECTED
type
One of:
WriteRefusalReason

The from or to status lane is not one of the 11 persisted Lane values.

string
Allowed value: urn:spec-kitty:write-refusal:unknown_lane