1
1
[role="xpack"]
2
2
[testenv="basic"]
3
3
[[rollup-get-job]]
4
- === Get rollup jobs API
4
+ === Get { rollup- jobs} API
5
5
++++
6
6
<titleabbrev>Get job</titleabbrev>
7
7
++++
8
8
9
- experimental[]
10
-
11
- This API returns the configuration, stats and status of rollup jobs. The API can return the details for a single job,
12
- or for all jobs.
13
-
14
- Note: This API only returns active (both `STARTED` and `STOPPED`) jobs. If a job was created, ran for a while then deleted,
15
- this API will not return any details about that job.
9
+ Retrieves the configuration, stats, and status of {rollup-jobs}.
16
10
17
- For details about a historical job, the <<rollup-get-rollup-caps,Rollup Capabilities API>> may be more useful
11
+ experimental[]
18
12
19
- ==== Request
13
+ [[rollup-get-job-request]]
14
+ ==== {api-request-title}
20
15
21
16
`GET _rollup/job/<job_id>`
22
17
23
- //===== Description
18
+ [[rollup-get-job-prereqs]]
19
+ ==== {api-prereq-title}
20
+
21
+ * You must have `monitor`, `monitor_rollup`, `manage` or `manage_rollup` cluster
22
+ privileges to use this API. For more information, see
23
+ {stack-ov}/security-privileges.html[Security privileges].
24
24
25
- ==== Path Parameters
25
+ [[rollup-get-job-desc]]
26
+ ==== {api-description-title}
26
27
27
- `job_id`::
28
- (string) Identifier for the job to retrieve. If omitted (or `_all` is used) all jobs will be returned
28
+ The API can return the details for a single {rollup-job} or for all {rollup-jobs}.
29
29
30
+ NOTE: This API returns only active (both `STARTED` and `STOPPED`) jobs. If a job
31
+ was created, ran for a while then deleted, this API does not return any details
32
+ about that job.
30
33
31
- ==== Request Body
34
+ For details about a historical {rollup-job}, the
35
+ <<rollup-get-rollup-caps,rollup capabilities API>> may be more useful.
32
36
33
- There is no request body for the Get Jobs API.
37
+ [[rollup-get-job-path-params]]
38
+ ==== {api-path-parms-title}
34
39
35
- ==== Authorization
40
+ `<job_id>`::
41
+ (Optional, string) Identifier for the {rollup-job}. If it is `_all` or omitted,
42
+ the API returns all {rollup-jobs}.
43
+
44
+ [[rollup-get-job-response-body]]
45
+ ==== {api-response-body-title}
36
46
37
- You must have `monitor`, `monitor_rollup`, `manage` or `manage_rollup` cluster privileges to use this API.
38
- For more information, see
39
- {xpack-ref}/security-privileges.html[Security Privileges].
47
+ `jobs`::
48
+ (array) An array of {rollup-job} resources.
49
+ `config`:::
50
+ (object) Contains the configuration for the {rollup-job}. This information
51
+ is identical to the configuration that was supplied when creating the job
52
+ via the <<rollup-put-job,create job API>>.
53
+ `status`:::
54
+ (object) Contains the current status of the indexer for the {rollup-job}.
55
+ The possible values and their meanings are:
56
+ +
57
+ --
58
+ - `stopped` means the indexer is paused and will not process data, even if its
59
+ cron interval triggers.
60
+ - `started` means the indexer is running, but not actively indexing data. When
61
+ the cron interval triggers, the job's indexer will begin to process data.
62
+ - `indexing` means the indexer is actively processing data and creating new
63
+ rollup documents. When in this state, any subsequent cron interval triggers will
64
+ be ignored because the job is already active with the prior trigger.
65
+ - `abort` is a transient state, which is usually not witnessed by the user. It
66
+ is used if the task needs to be shut down for some reason (job has been deleted,
67
+ an unrecoverable error has been encountered, etc). Shortly after the `abort`
68
+ state is set, the job will remove itself from the cluster.
69
+ --
70
+ `stats`:::
71
+ (object) Contains transient statistics about the {rollup-job}, such as how
72
+ many documents have been processed and how many rollup summary docs have
73
+ been indexed. These stats are not persisted. If a node is restarted, these
74
+ stats will be reset.
40
75
41
- ==== Examples
76
+ [[rollup-get-job-example]]
77
+ ==== {api-examples-title}
42
78
43
- If we have already created a rollup job named `sensor`, the details about the job can be retrieved with:
79
+ If we have already created a rollup job named `sensor`, the details about the
80
+ job can be retrieved with:
44
81
45
82
[source,js]
46
83
--------------------------------------------------
@@ -49,7 +86,7 @@ GET _rollup/job/sensor
49
86
// CONSOLE
50
87
// TEST[setup:sensor_rollup_job]
51
88
52
- Which will yield the following response:
89
+ The API yields the following response:
53
90
54
91
[source,js]
55
92
----
@@ -115,27 +152,7 @@ Which will yield the following response:
115
152
----
116
153
// TESTRESPONSE
117
154
118
- The `jobs` array contains a single job (`id: sensor`) since we requested a single job in the endpoint's URL. The
119
- details for this job contain three top-level parameters: `config`, `status` and `stats`
120
-
121
- `config` holds the rollup job's configuration, which is identical to the configuration that was supplied when creating
122
- the job via the <<rollup-put-job,Create Job API>>.
123
-
124
- The `status` object holds the current status of the rollup job's indexer. The possible values and their meanings are:
125
-
126
- - `stopped` means the indexer is paused and will not process data, even if it's cron interval triggers
127
- - `started` means the indexer is running, but not actively indexing data. When the cron interval triggers, the job's
128
- indexer will begin to process data
129
- - `indexing` means the indexer is actively processing data and creating new rollup documents. When in this state, any
130
- subsequent cron interval triggers will be ignored because the job is already active with the prior trigger
131
- - `abort` a transient state, which is usually not witnessed by the user. The `abort` state is used if the task needs to
132
- be shut down for some reason (job has been deleted, an unrecoverable error has been encountered, etc). Shortly after
133
- the `abort` state is set, the job will remove itself from the cluster
134
-
135
- Finally, the `stats` object provides transient statistics about the rollup job, such as how many documents have been
136
- processed and how many rollup summary docs have been indexed. These stats are not persisted, so if a node is restarted
137
- these stats will be reset.
138
-
155
+ The `jobs` array contains a single job (`id: sensor`) since we requested a single job in the endpoint's URL.
139
156
If we add another job, we can see how multi-job responses are handled:
140
157
141
158
[source,js]
0 commit comments