--- title: "Accept a partial apply" canonical: "https://admiral.io/docs/api/runs/RunAPI_AcceptRun" --- # Accept a partial apply `POST https://api.admiral.io/v1/runs/{run_id}/accept` Scope: `run:write` ### Path parameters - `run_id` (string, required): The run_id path parameter. Pattern `^run-[0-9a-z]+$`. ### Request body - `reason` (string, required): Length 1 to 1024. ### 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. - `id` (string): Pattern `^run-[0-9a-z]+$`. Read-only. - `environment_id` (string): 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, PARTIAL, NO_CHANGES, SUPERSEDED, FAILED or CANCELLED; a drift check ends CLEAN, DRIFTED, FAILED or CANCELLED. One of `STATUS_UNSPECIFIED`, `STATUS_PREPARING`, `STATUS_QUEUED`, `STATUS_PLANNING`, `STATUS_PLANNED`, `STATUS_NO_CHANGES`, `STATUS_APPLYING`, `STATUS_APPLIED`, `STATUS_PARTIAL`, `STATUS_SUPERSEDED`, `STATUS_FAILED`, `STATUS_CANCELLED`, `STATUS_CLEAN`, `STATUS_DRIFTED`. Read-only. - `trigger` (Trigger): Trigger is what started the run. One of `TRIGGER_UNSPECIFIED`, `TRIGGER_USER`, `TRIGGER_SCHEDULE`, `TRIGGER_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`, `WAIT_REASON_NO_AGENT_ASSIGNED`, `WAIT_REASON_AGENT_NOT_GRANTED`, `WAIT_REASON_AGENT_OFFLINE`, `WAIT_REASON_AGENT_AT_CAPACITY`, `WAIT_REASON_AGENT_TOO_OLD`, `WAIT_REASON_ENVIRONMENT_BUSY`, `WAIT_REASON_BACKOFF`, `WAIT_REASON_PROVIDER_PENDING`, `WAIT_REASON_PROFILE_MISSING`, `WAIT_REASON_COMPONENT_NOT_ALLOWED`. 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) - `assignment_id` (string): Pattern `^asg-[0-9a-z]+$`. Read-only. - `agent_id` (string): Pattern `^agt-[0-9a-z]+$`. Read-only. - `status` (JobStatus): Where the job stands, and why it waits while QUEUED. One of `JOB_STATUS_UNSPECIFIED`, `JOB_STATUS_QUEUED`, `JOB_STATUS_OFFERED`, `JOB_STATUS_RUNNING`, `JOB_STATUS_SUCCEEDED`, `JOB_STATUS_FAILED`, `JOB_STATUS_CANCELLED`. Read-only. - `wait_reason` (WaitReason): WaitReason says why a queued job is not running. One of `WAIT_REASON_UNSPECIFIED`, `WAIT_REASON_NO_AGENT_ASSIGNED`, `WAIT_REASON_AGENT_NOT_GRANTED`, `WAIT_REASON_AGENT_OFFLINE`, `WAIT_REASON_AGENT_AT_CAPACITY`, `WAIT_REASON_AGENT_TOO_OLD`, `WAIT_REASON_ENVIRONMENT_BUSY`, `WAIT_REASON_BACKOFF`, `WAIT_REASON_PROVIDER_PENDING`, `WAIT_REASON_PROFILE_MISSING`, `WAIT_REASON_COMPONENT_NOT_ALLOWED`. 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 Kubernetes object. - `api_version` (string): Length at most 253. - `kind` (string): Length at most 63. - `namespace` (string): Empty for a cluster-scoped object. Length at most 63. - `name` (string): Length at most 253. - `action` (Action): enum.defined_only = true One of `ACTION_NO_OP`, `ACTION_CREATE`, `ACTION_UPDATE`, `ACTION_REPLACE`, `ACTION_DESTROY`, `ACTION_ORPHAN`. - `diff_digest` (string): `sha256:` of this resource's diff in the PlanDiff. Empty for ACTION_NO_OP. Length at most 71. - `message` (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) - `assignment_id` (string): Pattern `^asg-[0-9a-z]+$`. Read-only. - `agent_id` (string): Pattern `^agt-[0-9a-z]+$`. Read-only. - `status` (JobStatus): Where the job stands, and why it waits while QUEUED. One of `JOB_STATUS_UNSPECIFIED`, `JOB_STATUS_QUEUED`, `JOB_STATUS_OFFERED`, `JOB_STATUS_RUNNING`, `JOB_STATUS_SUCCEEDED`, `JOB_STATUS_FAILED`, `JOB_STATUS_CANCELLED`. Read-only. - `wait_reason` (WaitReason): WaitReason says why a queued job is not running. One of `WAIT_REASON_UNSPECIFIED`, `WAIT_REASON_NO_AGENT_ASSIGNED`, `WAIT_REASON_AGENT_NOT_GRANTED`, `WAIT_REASON_AGENT_OFFLINE`, `WAIT_REASON_AGENT_AT_CAPACITY`, `WAIT_REASON_AGENT_TOO_OLD`, `WAIT_REASON_ENVIRONMENT_BUSY`, `WAIT_REASON_BACKOFF`, `WAIT_REASON_PROVIDER_PENDING`, `WAIT_REASON_PROFILE_MISSING`, `WAIT_REASON_COMPONENT_NOT_ALLOWED`. Read-only. - `components` (array of ComponentApply) - `component` (string) - `status` (Status): Status is where one component's apply stands. One of `STATUS_UNSPECIFIED`, `STATUS_QUEUED`, `STATUS_APPLYING`, `STATUS_SUCCEEDED`, `STATUS_FAILED`, `STATUS_SKIPPED`. - `message` (string) - `message` (string): Why the apply failed or stopped, when it did. - `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). - `generation` (string (int64)): The environment's generation this apply left; absent when it changed nothing. - `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. - `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. - `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) - `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). - `reason` (string) - `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. - `carried_from_run_id` (string): The run it was given on, when it was carried from an earlier run. - `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. - `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. - `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. - `desired` (Desired): What the environment desires. - `mode` (Mode): enum.defined_only = true One of `MODE_DRIFT_CHECK`, `MODE_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]+$`.