forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jobs_get.yml
88 lines (78 loc) · 2.3 KB
/
jobs_get.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
setup:
- skip:
features: headers
- do:
headers:
Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser
xpack.ml.put_job:
job_id: jobs-get-1
body: >
{
"job_id":"jobs-get-1",
"description":"Job 1",
"analysis_config" : {
"bucket_span": "300s",
"detectors" :[{"function":"count"}]
},
"data_description" : {
"format":"xcontent",
"time_field":"time",
"time_format":"epoch"
}
}
- do:
headers:
Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser
xpack.ml.put_job:
job_id: jobs-get-2
body: >
{
"job_id":"jobs-get-2",
"description":"Job 2",
"analysis_config" : {
"bucket_span": "600s",
"detectors" :[{"function":"metric","field_name":"responsetime","by_field_name":"airline"}]
},
"data_description" : {
"format" : "xcontent",
"time_field":"time",
"time_format":"yyyy-MM-dd'T'HH:mm:ssX"
}
}
---
"Test get job given missing job_id":
- do:
catch: missing
xpack.ml.get_jobs:
job_id: missing-job
---
"Test get single job":
- do:
xpack.ml.get_jobs:
job_id: jobs-get-1
- match: { jobs.0.job_id: "jobs-get-1"}
- match: { jobs.0.description: "Job 1"}
- do:
xpack.ml.get_jobs:
job_id: jobs-get-2
- match: { jobs.0.job_id: "jobs-get-2"}
- match: { jobs.0.description: "Job 2"}
---
"Test explicit get all jobs":
- do:
xpack.ml.get_jobs:
job_id: _all
- match: { count: 2 }
- match: { jobs.0.job_id: "jobs-get-1"}
- match: { jobs.0.description: "Job 1"}
- match: { jobs.1.job_id: "jobs-get-2"}
- match: { jobs.1.description: "Job 2"}
---
"Test implicit get all jobs":
- do:
xpack.ml.get_jobs: {}
- match: { count: 2 }
- match: { jobs.0.job_id: "jobs-get-1"}
- match: { jobs.0.description: "Job 1"}
- match: { jobs.1.job_id: "jobs-get-2"}
- match: { jobs.1.description: "Job 2"}