Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add machine learning API examples #2452

Merged
merged 4 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
}
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
}
}
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"
}
}
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"
}
}
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"
}
}
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
}
}
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"
}
}
}
Loading