--- title: "Retrieve a run" canonical: "https://admiral.io/docs/api/projects/RunAPI_GetRun" --- # Retrieve a run `GET https://api.admiral.io/v1/projects/{project}/environments/{environment}/runs/{run}` - NOT_FOUND when no run has that resource name. Scope: `run:read` ### Path parameters - `project` (string, required): The project id. - `environment` (string, required): The environment id. - `run` (string, required): The run id. ### Response 200 Success - `run` (Run): Run is one plan of an environment, and the apply of that plan when it is approved and applied. - At most one of `desired`, `revision_id` is set. - `uid` (string): `run-` and twelve base36 characters. Never changes and is never reused, so it is what a reference to the run holds. Pattern `^run-[0-9a-z]+$`. Read-only. - `resource_name` (string): (IDENTIFIER) The resource name, `projects/{project}/environments/{environment}/runs/{run}`, such as `projects/payments-api/environments/dev/runs/run-01jh2c8v5n4r`. The last segment is the run's uid, and the others carry the project's and the environment's current names, so it changes when either is renamed; refer to a run by `uid` to keep a reference stable. Pattern `^projects/[a-z]([a-z0-9-]{0,61}[a-z0-9])?/environments/[a-z]([a-z0-9-]{0,61}[a-z0-9])?/runs/run-[0-9a-z]+$`. - `environment_id` (string): The uid of the environment the run belongs to, which survives a rename of the environment. Pattern `^env-[0-9a-z]+$`. Read-only. - `change_set_id` (string): The change set of `revision_id`. Absent for a desired run. Read-only. - `status` (Status): Status is where the run is. A change set run or a reapply ends APPLIED, UNHEALTHY, PARTIAL, UNKNOWN, NO_CHANGES, SUPERSEDED, FAILED or CANCELLED; a drift check ends CLEAN, DRIFTED, FAILED or CANCELLED. One of `STATUS_UNSPECIFIED`, `PREPARING`, `QUEUED`, `PLANNING`, `PLANNED`, `NO_CHANGES`, `APPLYING`, `APPLIED`, `PARTIAL`, `SUPERSEDED`, `FAILED`, `CANCELLED`, `CLEAN`, `DRIFTED`, `UNKNOWN`, `UNHEALTHY`. Read-only. - `trigger` (Trigger): Trigger is what started the run. One of `TRIGGER_UNSPECIFIED`, `USER`, `SCHEDULE`, `GATE`. Read-only. - `wait_reason` (WaitReason): While QUEUED, the reason of the first job still waiting; each job in the phases carries its own. One of `WAIT_REASON_UNSPECIFIED`, `NO_AGENT_ASSIGNED`, `AGENT_NOT_GRANTED`, `AGENT_OFFLINE`, `AGENT_AT_CAPACITY`, `AGENT_TOO_OLD`, `ENVIRONMENT_BUSY`, `BACKOFF`, `AGENT_NOT_ENROLLED`, `COMPONENT_NOT_ALLOWED`, `ENGINE_MISSING`. Read-only. - `plan` (PlanPhase): PlanPhase is a run's plan. Read-only. - `jobs` (array of RunJob): One per agent job; a change set touching an IAM component and an ordinary one plans on two. - `job_id` (string): Pattern `^job-[0-9a-z]+$`. Read-only. - `components` (array of string) - `agent_id` (string): Pattern `^agt-[0-9a-z]+$`. Read-only. - `assignment_id` (string): Pattern `^asg-[0-9a-z]+$`. Read-only. - `status` (JobStatus): Where the job stands, and why it waits while QUEUED. One of `JOB_STATUS_UNSPECIFIED`, `QUEUED`, `OFFERED`, `RUNNING`, `SUCCEEDED`, `FAILED`, `CANCELLED`. Read-only. - `wait_reason` (WaitReason): WaitReason says why a queued job is not running. One of `WAIT_REASON_UNSPECIFIED`, `NO_AGENT_ASSIGNED`, `AGENT_NOT_GRANTED`, `AGENT_OFFLINE`, `AGENT_AT_CAPACITY`, `AGENT_TOO_OLD`, `ENVIRONMENT_BUSY`, `BACKOFF`, `AGENT_NOT_ENROLLED`, `COMPONENT_NOT_ALLOWED`, `ENGINE_MISSING`. Read-only. - `plan_digest` (string): `sha256:` of the changes: identical plans have identical digests. - `components` (array of ComponentPlan) - `component` (string): Length at most 63. - `changes` (array of ResourceChange): Items at most 5000. - `resource` (ResourceRef): ResourceRef names one thing a component manages. - Exactly one of `kubernetes`, `terraform` is set. - `kubernetes` (KubernetesResourceRef): KubernetesResourceRef names one Kubernetes object. - `terraform` (TerraformResourceRef): TerraformResourceRef names one Terraform resource instance. - `action` (Action): enum.defined_only = true One of `NO_OP`, `CREATE`, `UPDATE`, `REPLACE`, `DESTROY`, `ORPHAN`, `TAKE_OVER`. - `diff_digest` (string): `sha256:` of what the apply changes in this Kubernetes object: the action and each changed path with its before and after value, so a field the apply does not touch, such as replicas an autoscaler moved, leaves it unchanged. Empty for a Terraform resource, whose saved plan file pins what the apply changes, and for NO_OP. Length at most 71. - `plan_file_digest` (string): `sha256:` of a Terraform component's saved plan file. The apply refuses a file that does not match. Length at most 71. - `deferred` (DeferredPlan): Set when the component could not be planned yet: an input of its references an output another component in the same run only knows once it applies. `changes` and `plan_file_digest` are then empty. The apply plans it after what it waits on has applied, under the run's approval, and applies that plan. - `pending_inputs` (array of PendingInput): Items 1 to 1000. - `path` (string): The path in the component's values, `a.b[0].c`. Length at most 1024. - `component` (string): The component whose apply makes it known. Length at most 63. - `output` (string): Its output the path references. Length at most 256. - `status_reason` (string): Why the plan failed, when it did. - `started_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. - `finished_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. - `apply` (ApplyPhase): Absent until the run is applied. Read-only. - `jobs` (array of RunJob) - `job_id` (string): Pattern `^job-[0-9a-z]+$`. Read-only. - `components` (array of string) - `agent_id` (string): Pattern `^agt-[0-9a-z]+$`. Read-only. - `assignment_id` (string): Pattern `^asg-[0-9a-z]+$`. Read-only. - `status` (JobStatus): Where the job stands, and why it waits while QUEUED. One of `JOB_STATUS_UNSPECIFIED`, `QUEUED`, `OFFERED`, `RUNNING`, `SUCCEEDED`, `FAILED`, `CANCELLED`. Read-only. - `wait_reason` (WaitReason): WaitReason says why a queued job is not running. One of `WAIT_REASON_UNSPECIFIED`, `NO_AGENT_ASSIGNED`, `AGENT_NOT_GRANTED`, `AGENT_OFFLINE`, `AGENT_AT_CAPACITY`, `AGENT_TOO_OLD`, `ENVIRONMENT_BUSY`, `BACKOFF`, `AGENT_NOT_ENROLLED`, `COMPONENT_NOT_ALLOWED`, `ENGINE_MISSING`. Read-only. - `components` (array of ComponentApply) - `component` (string) - `status` (Status): Status is where one component's apply stands. One of `STATUS_UNSPECIFIED`, `QUEUED`, `APPLYING`, `SUCCEEDED`, `FAILED`, `SKIPPED`, `UNKNOWN`, `UNHEALTHY`. - `status_reason` (string): Why the component's apply failed, when it did. - `planned_components` (array of ComponentPlan): The components the reviewed plan deferred, planned by the apply once what each waited on had applied. Each names its changes and plan file as a plan does; `GetRunPlanDiff` carries their diffs beside the reviewed ones. - `component` (string): Length at most 63. - `changes` (array of ResourceChange): Items at most 5000. - `resource` (ResourceRef): ResourceRef names one thing a component manages. - Exactly one of `kubernetes`, `terraform` is set. - `kubernetes` (KubernetesResourceRef): KubernetesResourceRef names one Kubernetes object. - `terraform` (TerraformResourceRef): TerraformResourceRef names one Terraform resource instance. - `action` (Action): enum.defined_only = true One of `NO_OP`, `CREATE`, `UPDATE`, `REPLACE`, `DESTROY`, `ORPHAN`, `TAKE_OVER`. - `diff_digest` (string): `sha256:` of what the apply changes in this Kubernetes object: the action and each changed path with its before and after value, so a field the apply does not touch, such as replicas an autoscaler moved, leaves it unchanged. Empty for a Terraform resource, whose saved plan file pins what the apply changes, and for NO_OP. Length at most 71. - `plan_file_digest` (string): `sha256:` of a Terraform component's saved plan file. The apply refuses a file that does not match. Length at most 71. - `deferred` (DeferredPlan): Set when the component could not be planned yet: an input of its references an output another component in the same run only knows once it applies. `changes` and `plan_file_digest` are then empty. The apply plans it after what it waits on has applied, under the run's approval, and applies that plan. - `pending_inputs` (array of PendingInput): Items 1 to 1000. - `path` (string): The path in the component's values, `a.b[0].c`. Length at most 1024. - `component` (string): The component whose apply makes it known. Length at most 63. - `output` (string): Its output the path references. Length at most 256. - `generation` (string (int64)): The environment's generation this apply left; absent when it changed nothing. - `status_reason` (string): Why the apply failed or stopped, when it did. - `started_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. - `finished_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. - `applied_by` (ActorRef): ActorRef is a lightweight reference to the user or agent that performed an action. Server-populated on all resource responses. Clients should never send this. - `id` (string): The actor's typed id: a `usr-` user id or an `sa-` service account id. - `display_name` (string): Human-readable name (e.g., "John Smith", "deploy-bot"). - `email` (string): Email address (empty for non-human actors). - `accepted_by` (ActorRef): Set when a partial apply was accepted as the environment's new state. - `id` (string): The actor's typed id: a `usr-` user id or an `sa-` service account id. - `display_name` (string): Human-readable name (e.g., "John Smith", "deploy-bot"). - `email` (string): Email address (empty for non-human actors). - `accepted_reason` (string) - `accepted_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. - `required_approval` (ApprovalRule): What an apply needs from people: the environment's rule combined with the rule of every agent the run touches, fixed when the plan finishes so an edited rule never changes a run under its reviewers. Absent before then, and when nothing is required. Read-only. - `required_approvals` (integer (int32)): Distinct people who must approve the planned revision, from anyone allowed to. 0 needs none. Value at least 0. - `groups` (array of GroupApproval): Groups that must each approve, all of them. One person's approval counts for every group they belong to; to need two people, also set required_approvals to 2. approval_rule.unique_groups // a group appears at most once Items at most 16. - `group_id` (string, required): Pattern `^grp-[0-9a-z]+$`. - `approvals` (integer (int32)): Value at least 1. - `approvals` (array of Approval): Approvals of this run's plan, including ones carried from an earlier run of the same revision. Read-only. - `plan_digest` (string) - `reason` (string) - `carried_from_run_id` (string): The uid of the run it was given on, when it was carried from an earlier run. - `approved_by` (ActorRef): ActorRef is a lightweight reference to the user or agent that performed an action. Server-populated on all resource responses. Clients should never send this. - `id` (string): The actor's typed id: a `usr-` user id or an `sa-` service account id. - `display_name` (string): Human-readable name (e.g., "John Smith", "deploy-bot"). - `email` (string): Email address (empty for non-human actors). - `approved_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. - `finished_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. Read-only. - `created_by` (ActorRef): ActorRef is a lightweight reference to the user or agent that performed an action. Server-populated on all resource responses. Clients should never send this. Read-only. - `id` (string): The actor's typed id: a `usr-` user id or an `sa-` service account id. - `display_name` (string): Human-readable name (e.g., "John Smith", "deploy-bot"). - `email` (string): Email address (empty for non-human actors). - `created_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. Read-only. - `desired` (Desired): What the environment desires. - `mode` (Mode): enum.defined_only = true One of `DRIFT_CHECK`, `REAPPLY`. - `components` (array of string): For a reapply, the components to reapply. A drift check covers every component and ignores this. Items at most 256. - `generation` (string (int64)): The environment's generation when the run started. Read-only. - `desired_components` (array of DesiredComponent): Each component and the revision that last applied it, frozen when the run started. Read-only. - `component` (string) - `revision_id` (string): The change set revision that last applied it. - `revision_id` (string): A change set revision. Pattern `^rev-[0-9a-z]+$`.