-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjobs_crud.yml
88 lines (80 loc) · 2.06 KB
/
jobs_crud.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
---
requires:
serverless: true
stack: true
---
teardown:
- do:
ml.delete_job:
job_id: "job-crud-test-apis"
force: true
ignore: 404
---
"Jobs crud, get, stats, open, flush, close":
- do:
ml.get_jobs:
job_id: "_all"
- match: { count: 0 }
- match: { jobs: [] }
- do:
ml.get_job_stats:
job_id: "_all"
- match: { count: 0 }
- match: { jobs: [] }
- do:
ml.put_job:
job_id: job-crud-test-apis
body: >
{
"description":"Analysis of response time by airline",
"analysis_config" : {
"bucket_span": "1h",
"detectors" :[{"function":"metric","field_name":"responsetime","by_field_name":"airline"}]
},
"data_description" : {
"time_field":"time",
"time_format":"yyyy-MM-dd HH:mm:ssX"
}
}
- match: { job_id: "job-crud-test-apis" }
- match: { analysis_limits.model_memory_limit: "1024mb" }
- match: { analysis_limits.categorization_examples_limit: 4 }
- is_true: create_time
- do:
ml.open_job:
job_id: "job-crud-test-apis"
timeout: "30s"
- is_true: "opened"
- do:
ml.get_job_stats:
job_id: "job-crud-test-apis"
- match: { jobs.0.job_id : "job-crud-test-apis" }
- do:
ml.get_jobs:
job_id: "job-crud-test-apis"
- match: { count: 1 }
- match: { jobs.0.job_id: "job-crud-test-apis" }
- match: { jobs.0.analysis_limits.model_memory_limit: "1024mb" }
- do:
ml.flush_job:
job_id: "job-crud-test-apis"
- match: { flushed: true }
- do:
ml.close_job:
job_id: "job-crud-test-apis"
force: true
- is_true: closed
- do:
ml.update_job:
job_id: "job-crud-test-apis"
body: >
{
"analysis_limits": {
"model_memory_limit": "20mb"
}
}
- match: { analysis_limits.model_memory_limit: "20mb" }
- do:
ml.delete_job:
job_id: "job-crud-test-apis"
- match: { acknowledged: true }