Commands
Resolve a deployment's current manager and mint a five-minute command capability. Sender tokens can dispatch and observe commands only for this deployment. Receiver tokens can lease and complete commands only for the resolved Container or Daemon target.
Authorization
apiKey API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/commands/bootstrap" \ -H "Content-Type: application/json" \ -d '{ "deploymentId": "dep_0c29fq4a2yjb7kx3smwdgxlc", "role": "sender" }'{ "managerUrl": "http://example.com", "token": "string", "expiresAt": "2019-08-24T14:15:22Z", "target": { "resourceId": "string", "resourceType": "container" }}Retrieve commands. Use for dashboard analytics and command history.
Authorization
apiKey API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys
In: header
Query Parameters
Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.
^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$4 <= length <= 100Filter by project ID or name.
length <= 100Filter by deployment ID
dep_[0-9a-z]{28}$Filter by command state
Value in
- "PENDING_UPLOAD"
- "PENDING"
- "DISPATCHED"
- "SUCCEEDED"
- "FAILED"
- "EXPIRED"
Filter by command name
length <= 255Search commands by name
length <= 256Filter commands created after this date (ISO 8601)
date-timeFilter commands created before this date (ISO 8601)
date-timeOptional fields to include: deployment, project
Maximum number of items to return per page
1 <= value <= 10020Cursor for pagination - omit for first page
Response Body
application/json
application/json
curl -X GET "https://example.com/v1/commands?project=my-project"{ "items": [ { "id": "cmd_2sxjXxvOYct7IohT3ukliAzf", "deploymentId": "dep_0c29fq4a2yjb7kx3smwdgxlc", "projectId": "prj_mcytp6z3j91f7tn5ryqsfwtr", "workspaceId": "ws_It13CUaGEhLLAB87simX0", "name": "string", "state": "PENDING_UPLOAD", "deploymentModel": "push", "target": { "resourceId": "string", "resourceType": "worker" }, "attempt": 0, "deadline": "2019-08-24T14:15:22Z", "requestSizeBytes": 0, "responseSizeBytes": 0, "createdAt": "2019-08-24T14:15:22Z", "dispatchedAt": "2019-08-24T14:15:22Z", "completedAt": "2019-08-24T14:15:22Z", "error": { "property1": null, "property2": null }, "result": null, "deployment": { "id": "dep_0c29fq4a2yjb7kx3smwdgxlc", "name": "string", "deploymentGroup": { "id": "string", "name": "string" }, "platform": "aws", "environmentInfo": { "accountId": "string", "region": "string", "platform": "aws" }, "managerId": "string", "managerUrl": "http://example.com", "managerName": "string", "managerIsSystem": true }, "project": { "id": "prj_mcytp6z3j91f7tn5ryqsfwtr", "name": "string" } } ], "nextCursor": "string"}Create command metadata. Called by manager when processing commands. Returns project info for routing decisions.
Authorization
apiKey API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys
In: header
Query Parameters
Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.
^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$4 <= length <= 100Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/commands" \ -H "Content-Type: application/json" \ -d '{ "deploymentId": "dep_0c29fq4a2yjb7kx3smwdgxlc", "name": "string" }'{ "id": "cmd_2sxjXxvOYct7IohT3ukliAzf", "projectId": "string", "deploymentModel": "push", "target": { "resourceId": "string", "resourceType": "worker" }, "deliveryMode": "push"}List distinct command names. Use for filter dropdowns in the dashboard.
Authorization
apiKey API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys
In: header
Query Parameters
Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.
^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$4 <= length <= 100Filter by project ID or name.
length <= 100Search command names (prefix match)
length <= 255Response Body
application/json
application/json
curl -X GET "https://example.com/v1/commands/names?project=my-project"{ "names": [ "string" ]}List distinct deployments that have commands, including deployment group info. Use for filter dropdowns in the dashboard.
Authorization
apiKey API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys
In: header
Query Parameters
Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.
^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$4 <= length <= 100Filter by project ID or name.
length <= 100Search deployment or deployment group names
length <= 255Response Body
application/json
application/json
curl -X GET "https://example.com/v1/commands/deployments?project=my-project"{ "deployments": [ { "id": "dep_0c29fq4a2yjb7kx3smwdgxlc", "name": "string", "deploymentGroup": { "id": "string", "name": "string" } } ]}Resolve which resource a command for this deployment would be addressed to, and how it would be delivered. Fails when the deployment has no command-capable resources, or more than one and no explicit target was named.
Authorization
apiKey API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys
In: header
Query Parameters
Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.
^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$4 <= length <= 100Deployment to resolve the target for
dep_[0-9a-z]{28}$Explicit resource id to resolve; must be a command-capable resource
length <= 255Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/commands/target?deploymentId=dep_0c29fq4a2yjb7kx3smwdgxlc"{ "target": { "resourceId": "string", "resourceType": "worker" }, "deliveryMode": "push"}Retrieve a command by ID.
Authorization
apiKey API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys
In: header
Path Parameters
Unique identifier for the command.
cmd_[0-9a-zA-Z]{28}$Query Parameters
Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.
^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$4 <= length <= 100Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/v1/commands/cmd_2sxjXxvOYct7IohT3ukliAzf"{ "id": "cmd_2sxjXxvOYct7IohT3ukliAzf", "deploymentId": "dep_0c29fq4a2yjb7kx3smwdgxlc", "projectId": "prj_mcytp6z3j91f7tn5ryqsfwtr", "workspaceId": "ws_It13CUaGEhLLAB87simX0", "name": "string", "state": "PENDING_UPLOAD", "deploymentModel": "push", "target": { "resourceId": "string", "resourceType": "worker" }, "attempt": 0, "deadline": "2019-08-24T14:15:22Z", "requestSizeBytes": 0, "responseSizeBytes": 0, "createdAt": "2019-08-24T14:15:22Z", "dispatchedAt": "2019-08-24T14:15:22Z", "completedAt": "2019-08-24T14:15:22Z", "error": { "property1": null, "property2": null }, "result": null}Update command state. Called by manager when command is dispatched or completes.
Authorization
apiKey API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys
In: header
Path Parameters
Unique identifier for the command.
cmd_[0-9a-zA-Z]{28}$Query Parameters
Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.
^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$4 <= length <= 100Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X PATCH "https://example.com/v1/commands/cmd_2sxjXxvOYct7IohT3ukliAzf" \ -H "Content-Type: application/json" \ -d '{}'{ "id": "cmd_2sxjXxvOYct7IohT3ukliAzf", "deploymentId": "dep_0c29fq4a2yjb7kx3smwdgxlc", "projectId": "prj_mcytp6z3j91f7tn5ryqsfwtr", "workspaceId": "ws_It13CUaGEhLLAB87simX0", "name": "string", "state": "PENDING_UPLOAD", "deploymentModel": "push", "target": { "resourceId": "string", "resourceType": "worker" }, "attempt": 0, "deadline": "2019-08-24T14:15:22Z", "requestSizeBytes": 0, "responseSizeBytes": 0, "createdAt": "2019-08-24T14:15:22Z", "dispatchedAt": "2019-08-24T14:15:22Z", "completedAt": "2019-08-24T14:15:22Z", "error": { "property1": null, "property2": null }, "result": null}Atomically mark a command DISPATCHED unless it is already terminal. Returns whether the transition was applied.
Authorization
apiKey API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys
In: header
Path Parameters
Unique identifier for the command.
cmd_[0-9a-zA-Z]{28}$Query Parameters
Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.
^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$4 <= length <= 100Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/commands/cmd_2sxjXxvOYct7IohT3ukliAzf/dispatch" \ -H "Content-Type: application/json" \ -d '{ "dispatchedAt": "2019-08-24T14:15:22Z" }'{ "updated": true}Atomically transition a command to a terminal state (SUCCEEDED, FAILED, or EXPIRED) unless it is already terminal. Returns whether the transition was applied.
Authorization
apiKey API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys
In: header
Path Parameters
Unique identifier for the command.
cmd_[0-9a-zA-Z]{28}$Query Parameters
Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.
^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$4 <= length <= 100Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/commands/cmd_2sxjXxvOYct7IohT3ukliAzf/complete" \ -H "Content-Type: application/json" \ -d '{ "state": "SUCCEEDED", "completedAt": "2019-08-24T14:15:22Z" }'{ "updated": true}Atomically increment the command's attempt counter and return the new value.
Authorization
apiKey API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys
In: header
Path Parameters
Unique identifier for the command.
cmd_[0-9a-zA-Z]{28}$Query Parameters
Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.
^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$4 <= length <= 100Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/commands/cmd_2sxjXxvOYct7IohT3ukliAzf/increment-attempt"{ "attempt": 0}