Skip to content

Commit 585b985

Browse files
lcawlswallez
authored andcommitted
Add descriptions to pending cluster tasks API (#2150)
1 parent 397e4c3 commit 585b985

File tree

3 files changed

+48
-6
lines changed

3 files changed

+48
-6
lines changed

output/schema/schema.json

Lines changed: 17 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/cluster/pending_tasks/ClusterPendingTasksRequest.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,28 @@ import { RequestBase } from '@_types/Base'
2121
import { Duration } from '@_types/Time'
2222

2323
/**
24+
* Returns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed.
25+
* NOTE: This API returns a list of any pending updates to the cluster state.
26+
* These are distinct from the tasks reported by the Task Management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests.
27+
* However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API.
2428
* @rest_spec_name cluster.pending_tasks
2529
* @availability stack since=0.0.0 stability=stable
2630
* @availability serverless stability=stable visibility=public
31+
* @cluster_privileges monitor
2732
* @doc_id cluster-pending
2833
*/
2934
export interface Request extends RequestBase {
3035
query_parameters: {
36+
/**
37+
* If `true`, the request retrieves information from the local node only.
38+
* If `false`, information is retrieved from the master node.
39+
* @server_default false
40+
*/
3141
local?: boolean
32-
/** @server_default 30s */
42+
/**
43+
* Period to wait for a connection to the master node.
44+
* If no response is received before the timeout expires, the request fails and returns an error.
45+
* @server_default 30s */
3346
master_timeout?: Duration
3447
}
3548
}

specification/cluster/pending_tasks/types.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,27 @@ import { integer, long } from '@_types/Numeric'
2121
import { DateTime, Duration, DurationValue, UnitMillis } from '@_types/Time'
2222

2323
export class PendingTask {
24+
/** Indicates whether the pending tasks are currently executing or not. */
2425
executing: boolean
26+
/**
27+
* The number that represents when the task has been inserted into the task queue.
28+
*/
2529
insert_order: integer
30+
/**
31+
* The priority of the pending task.
32+
* The valid priorities in descending priority order are: `IMMEDIATE` > `URGENT` > `HIGH` > `NORMAL` > `LOW` > `LANGUID`.
33+
*/
2634
priority: string
35+
/**
36+
* A general description of the cluster task that may include a reason and origin.
37+
*/
2738
source: string
39+
/**
40+
* The time since the task is waiting for being performed.
41+
*/
2842
time_in_queue?: Duration
43+
/**
44+
* The time expressed in milliseconds since the task is waiting for being performed.
45+
*/
2946
time_in_queue_millis: DurationValue<UnitMillis>
3047
}

0 commit comments

Comments
 (0)