diff --git a/api/allocations.go b/api/allocations.go index f8a3a0aee..b35e338c5 100644 --- a/api/allocations.go +++ b/api/allocations.go @@ -547,7 +547,10 @@ type AllocPauseRequest struct { } type AllocGetPauseResponse struct { - // ScheduleState will be one of "pause", "run", "scheduled". + // ScheduleState will be one of "" (run), "force_run", "scheduled_pause", + // "force_pause", or "schedule_resume". + // + // See nomad/structs/task_sched.go for details. ScheduleState string } diff --git a/website/content/api-docs/allocations.mdx b/website/content/api-docs/allocations.mdx index 65eded2e2..4590f2aeb 100644 --- a/website/content/api-docs/allocations.mdx +++ b/website/content/api-docs/allocations.mdx @@ -983,6 +983,19 @@ The table below shows this endpoint's support for must be the full UUID, not the short 8-character one. This is specified as part of the path. +- `Task` `(string: )` - Specifies the name of the task whose schedule + should be overridden. + +- `ScheduleState` `(string: )` - Specifies the pause state to force + the task into. One of: + + - `"pause"` - Forces the task to pause. + + - `"run"` - Forces the task to run. + + - `"scheduled"` - Removes any overrides and forces the task to adhere to + its schedule. + ### Sample Request ```shell-session @@ -1018,12 +1031,12 @@ The table below shows this endpoint's support for ### Parameters -- `:alloc_id` `(string: )`- Specifies the UUID of the allocation. This - must be the full UUID, not the short 8-character one. This is specified as - part of the path. +- `:alloc_id` `(string: )` - Specifies the UUID of the allocation. + This must be the full UUID, not the short 8-character one. This is + specified as part of the path. -- `task` - Specifies the task from which to retrieve the time based task - execution state. +- `task` `(string: )` - Specifies the name of the task from which to + retrieve the time-based task execution state. ### Sample Request @@ -1039,5 +1052,24 @@ $ nomad operator api /v1/client/allocation/23f520cc-629a-46ff-395f-0661e7aa939e/ } ``` +#### Field Reference + +- `ScheduleState` `(string)`: The task's current paused state. It can can have + one of the following values: + + - `""` - The task is running. The only state returned for tasks with no + schedule. + + - `force_run` - The task's schedule has been overridden to run. + + - `force_pause` - The task's schedule has been overridden to pause. + + - `scheduled_pause` - The task is paused according to its schedule. + + - `schedule_resume` - A schedule override is being removed. Subsequent calls + should return running (`""`) or paused (`scheduled_pause`) states. This + state is rarely possible to observe since it transitions immediately to + another state. + [`shutdown_delay`]: /nomad/docs/job-specification/group#shutdown_delay [schedule]: /nomad/docs/job-specification/schedule