-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add machine learning API examples (#2452)
- Loading branch information
Showing
7 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
specification/ml/close_job/examples/200_response/MlCloseJobResponseExample1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"summary": "A successful response when closing anomaly detection jobs.", | ||
"value": { | ||
"closed": true | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
specification/ml/delete_job/examples/200_response/MlDeleteJobResponseExample1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"summary": "A successful response when deleting an anomaly detection job.", | ||
"value": { | ||
"acknowledged": true | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
specification/ml/delete_job/examples/200_response/MlDeleteJobResponseExample2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"summary": "A successful response when deleting an anomaly detection job asynchronously.", | ||
"description": "When the `wait_for_completion` query parameter is set to `false`, the response contains an identifier for the job deletion task.", | ||
"value": { | ||
"task": "oTUltX4IQMOUUVeiohTt8A:39" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
specification/ml/open_job/examples/200_response/MlOpenJobResponseExample1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"summary": "A successful response when opening an anomaly detection job.", | ||
"value": { | ||
"opened": true, | ||
"node": "node-1" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
specification/ml/open_job/examples/request/MlOpenJobRequestExample1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"summary": "A request to open anomaly detection jobs.", | ||
"description": "The timeout specifies to wait 35 minutes for the job to open.", | ||
"value": { | ||
"timeout": "35m" | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
specification/ml/put_job/examples/200_response/MlPutJobResponseExample1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"summary": "A successful response when creating an anomaly detection job and datafeed.", | ||
"value": { | ||
"job_id": "test-job1", | ||
"job_type": "anomaly_detector", | ||
"job_version": "8.4.0", | ||
"create_time": 1656087283340, | ||
"datafeed_config": { | ||
"datafeed_id": "datafeed-test-job1", | ||
"job_id": "test-job1", | ||
"authorization": { | ||
"roles": ["superuser"] | ||
}, | ||
"query_delay": "61499ms", | ||
"chunking_config": { | ||
"mode": "auto" | ||
}, | ||
"indices_options": { | ||
"expand_wildcards": ["open"], | ||
"ignore_unavailable": false, | ||
"allow_no_indices": true, | ||
"ignore_throttled": true | ||
}, | ||
"query": { | ||
"bool": { | ||
"must": [ | ||
{ | ||
"match_all": {} | ||
} | ||
] | ||
} | ||
}, | ||
"indices": ["kibana_sample_data_logs"], | ||
"scroll_size": 1000, | ||
"delayed_data_check_config": { | ||
"enabled": true | ||
}, | ||
"runtime_mappings": { | ||
"hour_of_day": { | ||
"type": "long", | ||
"script": { | ||
"source": "emit(doc['timestamp'].value.getHour());" | ||
} | ||
} | ||
} | ||
}, | ||
"analysis_config": { | ||
"bucket_span": "15m", | ||
"detectors": [ | ||
{ | ||
"detector_description": "Sum of bytes", | ||
"function": "sum", | ||
"field_name": "bytes", | ||
"detector_index": 0 | ||
} | ||
], | ||
"influencers": [], | ||
"model_prune_window": "30d" | ||
}, | ||
"analysis_limits": { | ||
"model_memory_limit": "11mb", | ||
"categorization_examples_limit": 4 | ||
}, | ||
"data_description": { | ||
"time_field": "timestamp", | ||
"time_format": "epoch_ms" | ||
}, | ||
"model_plot_config": { | ||
"enabled": true, | ||
"annotations_enabled": true | ||
}, | ||
"model_snapshot_retention_days": 10, | ||
"daily_model_snapshot_retention_after_days": 1, | ||
"results_index_name": "custom-test-job1", | ||
"allow_lazy_open": false | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
specification/ml/put_job/examples/request/MlPutJobRequestExample1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"summary": "A request to create an anomaly detection job and datafeed.", | ||
"value": { | ||
"analysis_config": { | ||
"bucket_span": "15m", | ||
"detectors": [ | ||
{ | ||
"detector_description": "Sum of bytes", | ||
"function": "sum", | ||
"field_name": "bytes" | ||
} | ||
] | ||
}, | ||
"data_description": { | ||
"time_field": "timestamp", | ||
"time_format": "epoch_ms" | ||
}, | ||
"analysis_limits": { | ||
"model_memory_limit": "11MB" | ||
}, | ||
"model_plot_config": { | ||
"enabled": true, | ||
"annotations_enabled": true | ||
}, | ||
"results_index_name": "test-job1", | ||
"datafeed_config": { | ||
"indices": ["kibana_sample_data_logs"], | ||
"query": { | ||
"bool": { | ||
"must": [ | ||
{ | ||
"match_all": {} | ||
} | ||
] | ||
} | ||
}, | ||
"runtime_mappings": { | ||
"hour_of_day": { | ||
"type": "long", | ||
"script": { | ||
"source": "emit(doc['timestamp'].value.getHour());" | ||
} | ||
} | ||
}, | ||
"datafeed_id": "datafeed-test-job1" | ||
} | ||
} | ||
} |