Docs

Commands

List Commands

GET
/v1/commands

Retrieve commands. Use for dashboard analytics and command history.

Authorization

AuthorizationBearer <token>

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?string

Workspace name or ID. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must identify the key's workspace.

Match^(?:ws_[0-9a-zA-Z]{24}|(?!ws[-_])[a-z0-9](-?[a-z0-9])*)$
Length4 <= length <= 100
project?string

Filter by project ID or name.

Lengthlength <= 100
deploymentId?string

Filter by deployment ID

Matchdep_[0-9a-z]{28}$
state?string

Filter by command state

Value in

  • "PENDING_UPLOAD"
  • "PENDING"
  • "DISPATCHED"
  • "SUCCEEDED"
  • "FAILED"
  • "EXPIRED"
name?string

Filter by command name

Lengthlength <= 255
search?string

Search commands by name

Lengthlength <= 256
createdAfter?|

Filter commands created after this date (ISO 8601)

Formatdate-time
createdBefore?|

Filter commands created before this date (ISO 8601)

Formatdate-time
include?array<>

Optional fields to include: deployment, project

limit?integer

Maximum number of items to return per page

Range1 <= value <= 100
Default20
cursor?string

Cursor for pagination - omit for first page

Response Body

application/json

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      },      "accessRequestId": "string",      "verification": {        "state": "not-required",        "reason": "string"      },      "result": null,      "resultAvailability": "available",      "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"}

Resolve Command Target

GET
/v1/commands/target

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

AuthorizationBearer <token>

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?string

Workspace name or ID. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must identify the key's workspace.

Match^(?:ws_[0-9a-zA-Z]{24}|(?!ws[-_])[a-z0-9](-?[a-z0-9])*)$
Length4 <= length <= 100
deploymentId*string

Deployment to resolve the target for

Matchdep_[0-9a-z]{28}$
target?string

Explicit resource id to resolve; must be a command-capable resource

Lengthlength <= 255
command?string

Command name being invoked. A name that is an operation enabled for the deployment fails with COMMAND_IS_OPERATION, which gives the alien operations invoke command to run instead.

Length1 <= length <= 255

Response Body

application/json

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

Get Command

GET
/v1/commands/{id}

Retrieve a command by ID.

Authorization

AuthorizationBearer <token>

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

id*string

Unique identifier for the command.

Matchcmd_[0-9a-zA-Z]{28}$

Query Parameters

workspace?string

Workspace name or ID. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must identify the key's workspace.

Match^(?:ws_[0-9a-zA-Z]{24}|(?!ws[-_])[a-z0-9](-?[a-z0-9])*)$
Length4 <= length <= 100
confirmSensitiveOutput?"true"

Explicitly confirm access to an operation result marked sensitive.

Value in

  • "true"

Response Body

application/json

application/json

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  },  "accessRequestId": "string",  "verification": {    "state": "not-required",    "reason": "string"  },  "result": null,  "resultAvailability": "available"}