Set Kill Switch

PUT
/v1/admin/kill-switches

Not available yet. This operation is part of the published contract and answers 501 not_implemented until it is built. The request and response shapes below are final for this contract version.

Stops new and running work for the target within 30 seconds; audited.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Bearer credential. API keys look like sqk_<geo>_<key_id>_<secret>: treat them as opaque and never put one in a browser. Older keys without the geo part stay valid until rotated. Find a geo's endpoints through GET /.well-known/sparq-discovery before sending a key.

Header Parameters

Sparq-Workspace?string

For a person signed in to a console with several workspaces: the workspace this call is for, one of their memberships (listMyMemberships). Without it such a person gets workspace_required (400); a workspace they are not a member of is forbidden. It never grants anything, and other callers' credentials ignore it.

Formatuuid
If-Match?string

The ETag you last read. A different current version is precondition_failed (412). Optional in 0.5.0.

Request Body

application/json
  1. body

Body of PUT /v1/admin/kill-switches. Stops new and running work for the target within 30 seconds; a stopped run ends as cancelled with code kill_switch_active.

target_type*KillSwitchTarget
Value in"agent""audience_tenant""credential""project"
target_id*Target Id

Id, or agent name.

Length1 <= length <= 200
project_id?|

Required for an agent target.

reason*Reason
Length1 <= length <= 2000
expires_at?|null

Response Body

Successful Response

application/json
  1. response
kill_switch_id*Kill Switch Id
Formatuuid
target_type*KillSwitchTarget
Value in"agent""audience_tenant""credential""project"
target_id*Target Id
project_id*|null
active*Active
reason*Reason
set_by_credential_id*Set By Credential Id
Formatuuid
set_at*Set At
Formatdate-time
expires_at*|null
cleared_at*|null
Example Request
curl -X PUT 'http://dev-sparq.centralindia.cloudapp.azure.com:8000/v1/admin/kill-switches' \  -H 'Content-Type: application/json' \  -d '{  "target_type": "agent",  "target_id": "string",  "reason": "string"}'
Example Response
{  "kill_switch_id": "a4722600-1a5a-4538-be3e-0d58f18ed790",  "target_type": "agent",  "target_id": "string",  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",  "active": true,  "reason": "string",  "set_by_credential_id": "aa04de38-abd9-4592-a7d5-71fc56046449",  "set_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "cleared_at": "2019-08-24T14:15:22Z"}