Renamed REST path parameters to snake case. (elastic/elasticsearch#367)

* Renamed REST path parameters to snake case.

And added missing parameter descriptions

* Document endpoint which accept body parameters

* Endpoints that support body parameters must also accept POST

Original commit: elastic/x-pack-elasticsearch@2cad2e8af6
This commit is contained in:
David Kyle 2016-11-29 16:04:08 +00:00 committed by GitHub
parent c99ee42f0e
commit 688b5cc202
26 changed files with 154 additions and 124 deletions

View File

@ -32,8 +32,10 @@ public class RestGetInfluencersAction extends BaseRestHandler {
super(settings); super(settings);
this.transportAction = transportAction; this.transportAction = transportAction;
controller.registerHandler(RestRequest.Method.GET, controller.registerHandler(RestRequest.Method.GET,
PrelertPlugin.BASE_PATH + "results/{" + Job.ID.getPreferredName() + "}/influencers", PrelertPlugin.BASE_PATH + "results/{" + Job.ID.getPreferredName() + "}/influencers", this);
this); // endpoints that support body parameters must also accept POST
controller.registerHandler(RestRequest.Method.POST,
PrelertPlugin.BASE_PATH + "results/{" + Job.ID.getPreferredName() + "}/influencers", this);
} }
@Override @Override

View File

@ -52,6 +52,8 @@ public class RestGetModelSnapshotsAction extends BaseRestHandler {
super(settings); super(settings);
this.transportGetModelSnapshotsAction = transportGetModelSnapshotsAction; this.transportGetModelSnapshotsAction = transportGetModelSnapshotsAction;
controller.registerHandler(RestRequest.Method.GET, PrelertPlugin.BASE_PATH + "modelsnapshots/{jobId}", this); controller.registerHandler(RestRequest.Method.GET, PrelertPlugin.BASE_PATH + "modelsnapshots/{jobId}", this);
// endpoints that support body parameters must also accept POST
controller.registerHandler(RestRequest.Method.POST, PrelertPlugin.BASE_PATH + "modelsnapshots/{jobId}", this);
} }
@Override @Override

View File

@ -2,10 +2,10 @@
"xpack.prelert.close_data": { "xpack.prelert.close_data": {
"methods": [ "POST" ], "methods": [ "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/data/{jobId}/_close", "path": "/_xpack/prelert/data/{job_id}/_close",
"paths": [ "/_xpack/prelert/data/{jobId}/_close" ], "paths": [ "/_xpack/prelert/data/{job_id}/_close" ],
"parts": { "parts": {
"jobId": { "job_id": {
"type": "string", "type": "string",
"required": true, "required": true,
"description": "The name of the job to close" "description": "The name of the job to close"

View File

@ -2,15 +2,15 @@
"xpack.prelert.delete_model_snapshot": { "xpack.prelert.delete_model_snapshot": {
"methods": [ "DELETE" ], "methods": [ "DELETE" ],
"url": { "url": {
"path": "/_xpack/prelert/modelsnapshots/{jobId}/{snapshotId}", "path": "/_xpack/prelert/modelsnapshots/{job_id}/{snapshot_id}",
"paths": [ "/_xpack/prelert/modelsnapshots/{jobId}/{snapshotId}" ], "paths": [ "/_xpack/prelert/modelsnapshots/{job_id}/{snapshot_id}" ],
"parts": { "parts": {
"jobId": { "job_id": {
"type": "string", "type": "string",
"required": true, "required": true,
"description": "The ID of the job to fetch" "description": "The ID of the job to fetch"
}, },
"snapshotId": { "snapshot_id": {
"type": "string", "type": "string",
"required": true, "required": true,
"description": "The Snapshot ID of the job to fetch" "description": "The Snapshot ID of the job to fetch"

View File

@ -4,12 +4,12 @@
"POST" "POST"
], ],
"url": { "url": {
"path": "/_xpack/prelert/data/{jobId}/_flush", "path": "/_xpack/prelert/data/{job_id}/_flush",
"paths": [ "paths": [
"/_xpack/prelert/data/{jobId}/_flush" "/_xpack/prelert/data/{job_id}/_flush"
], ],
"parts": { "parts": {
"jobId": { "job_id": {
"type": "string", "type": "string",
"required": true, "required": true,
"description": "The name of the job to flush" "description": "The name of the job to flush"
@ -33,6 +33,9 @@
"description": "Setting this tells the Engine API that no data prior to advanceTime is expected" "description": "Setting this tells the Engine API that no data prior to advanceTime is expected"
} }
} }
},
"body": {
"description": "Flush parameters"
} }
} }
} }

View File

@ -2,29 +2,34 @@
"xpack.prelert.get_buckets": { "xpack.prelert.get_buckets": {
"methods": [ "GET", "POST" ], "methods": [ "GET", "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/results/{jobId}/buckets/{timestamp}", "path": "/_xpack/prelert/results/{job_id}/buckets/{timestamp}",
"paths": [ "paths": [
"/_xpack/prelert/results/{jobId}/buckets/{timestamp}", "/_xpack/prelert/results/{job_id}/buckets/{timestamp}",
"/_xpack/prelert/results/{jobId}/buckets" "/_xpack/prelert/results/{job_id}/buckets"
], ],
"parts": { "parts": {
"jobId": { "job_id": {
"type" : "string", "type" : "string",
"required": true "required": true,
"description": "ID of the job to get bucket results from"
}, },
"timestamp": { "timestamp": {
"type" : "string" "type" : "string",
"description" : "The timestamp of the desired single bucket result"
} }
}, },
"params": { "params": {
"expand": { "expand": {
"type": "boolean" "type": "boolean",
"description" : "Include anomaly records"
}, },
"includeInterim": { "includeInterim": {
"type": "boolean" "type": "boolean",
"description" : "Include interim results"
}, },
"partitionValue": { "partitionValue": {
"type": "string" "type": "string",
"description": "If expand is true filter anomaly records by the partitionFieldValue"
}, },
"from": { "from": {
"type": "int", "type": "int",
@ -35,16 +40,20 @@
"description": "specifies a max number of buckets to get" "description": "specifies a max number of buckets to get"
}, },
"start": { "start": {
"type": "string" "type": "string",
"description" : "Start time filter for buckets"
}, },
"end": { "end": {
"type": "string" "type": "string",
"description" : "End time filter for buckets"
}, },
"anomalyScore": { "anomalyScore": {
"type": "double" "type": "double",
"description": "Filter for the most anomalous buckets"
}, },
"maxNormalizedProbability": { "maxNormalizedProbability": {
"type": "double" "type": "double",
"description": "Filter for buckets containing the most anomalous records"
} }
} }
}, },

View File

@ -2,18 +2,20 @@
"xpack.prelert.get_categories": { "xpack.prelert.get_categories": {
"methods": [ "GET" ], "methods": [ "GET" ],
"url": { "url": {
"path": "/_xpack/prelert/results/{jobId}/categorydefinitions/{categoryId}", "path": "/_xpack/prelert/results/{job_id}/categorydefinitions/{category_id}",
"paths": [ "paths": [
"/_xpack/prelert/results/{jobId}/categorydefinitions/{categoryId}", "/_xpack/prelert/results/{job_id}/categorydefinitions/{category_id}",
"/_xpack/prelert/results/{jobId}/categorydefinitions/" "/_xpack/prelert/results/{job_id}/categorydefinitions/"
], ],
"parts": { "parts": {
"jobId": { "job_id": {
"type" : "string", "type" : "string",
"required": true "required": true,
"description": "The name of the job"
}, },
"categoryId": { "category_id": {
"type" : "string" "type" : "string",
"description" : "The identifier of the category definition of interest"
} }
}, },
"params": { "params": {

View File

@ -1,18 +1,19 @@
{ {
"xpack.prelert.get_influencers": { "xpack.prelert.get_influencers": {
"methods": [ "GET" ], "methods": [ "GET", "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/results/{jobId}/influencers", "path": "/_xpack/prelert/results/{job_id}/influencers",
"paths": [ "/_xpack/prelert/results/{jobId}/influencers" ], "paths": [ "/_xpack/prelert/results/{job_id}/influencers" ],
"parts": { "parts": {
"jobId": { "job_id": {
"type" : "string", "type" : "string",
"required": true "required": true
} }
}, },
"params": { "params": {
"includeInterim": { "includeInterim": {
"type": "boolean" "type": "boolean",
"description" : "Include interim results"
}, },
"from": { "from": {
"type": "int", "type": "int",
@ -45,6 +46,9 @@
"description": "whether the results should be sorted in decending order" "description": "whether the results should be sorted in decending order"
} }
} }
},
"body": {
"description": "Influencer selection criteria"
} }
} }
} }

View File

@ -1,11 +1,11 @@
{ {
"xpack.prelert.get_model_snapshots": { "xpack.prelert.get_model_snapshots": {
"methods": [ "GET" ], "methods": [ "GET", "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/modelsnapshots/{jobId}", "path": "/_xpack/prelert/modelsnapshots/{job_id}",
"paths": [ "/_xpack/prelert/modelsnapshots/{jobId}" ], "paths": [ "/_xpack/prelert/modelsnapshots/{job_id}" ],
"parts": { "parts": {
"jobId": { "job_id": {
"type": "string", "type": "string",
"required": true, "required": true,
"description": "The ID of the job to fetch" "description": "The ID of the job to fetch"
@ -14,7 +14,7 @@
"params": { "params": {
"from": { "from": {
"type": "integer", "type": "integer",
"description": "" "description": "Skips a number of documents"
}, },
"size": { "size": {
"type": "integer", "type": "integer",
@ -42,6 +42,8 @@
} }
} }
}, },
"body": null "body": {
"description": "Model snapshot selection criteria"
}
} }
} }

View File

@ -2,10 +2,10 @@
"xpack.prelert.get_records": { "xpack.prelert.get_records": {
"methods": [ "GET" ], "methods": [ "GET" ],
"url": { "url": {
"path": "/_xpack/prelert/results/{jobId}/records", "path": "/_xpack/prelert/results/{job_id}/records",
"paths": [ "/_xpack/prelert/results/{jobId}/records" ], "paths": [ "/_xpack/prelert/results/{job_id}/records" ],
"parts": { "parts": {
"jobId": { "job_id": {
"type" : "string", "type" : "string",
"required": true "required": true
} }
@ -15,7 +15,8 @@
"type": "boolean" "type": "boolean"
}, },
"includeInterim": { "includeInterim": {
"type": "boolean" "type": "boolean",
"description" : "Include interim results"
}, },
"from": { "from": {
"type": "int", "type": "int",
@ -27,11 +28,13 @@
}, },
"start": { "start": {
"type": "string", "type": "string",
"required": true "required": true,
"description" : "Start time filter for records"
}, },
"end": { "end": {
"type": "string", "type": "string",
"required": true "required": true,
"description" : "End time filter for records"
}, },
"anomalyScore": { "anomalyScore": {
"type": "double" "type": "double"
@ -40,13 +43,16 @@
"type": "double" "type": "double"
}, },
"partitionValue": { "partitionValue": {
"type": "string" "type": "string",
"description": "Filter anomaly records by the partitionFieldValue"
}, },
"sort": { "sort": {
"type": "string" "type": "string",
"description": "Sort records by a particular field"
}, },
"desc": { "desc": {
"type": "boolean" "type": "boolean",
"description": "Set the sort direction"
} }
} }
} }

View File

@ -2,10 +2,10 @@
"xpack.prelert.post_data": { "xpack.prelert.post_data": {
"methods": [ "POST" ], "methods": [ "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/data/{jobId}", "path": "/_xpack/prelert/data/{job_id}",
"paths": [ "/_xpack/prelert/data/{jobId}" ], "paths": [ "/_xpack/prelert/data/{job_id}" ],
"parts": { "parts": {
"jobId": { "job_id": {
"type": "string", "type": "string",
"required": true, "required": true,
"description": "The name of the job receiving the data" "description": "The name of the job receiving the data"

View File

@ -7,7 +7,7 @@
"params": { "params": {
"overwrite": { "overwrite": {
"type": "boolean", "type": "boolean",
"description": "" "description": "Overwrite an existing job"
} }
} }
}, },

View File

@ -2,15 +2,15 @@
"xpack.prelert.put_model_snapshot_description": { "xpack.prelert.put_model_snapshot_description": {
"methods": [ "PUT" ], "methods": [ "PUT" ],
"url": { "url": {
"path": "/_xpack/prelert/modelsnapshots/{jobId}/{snapshotId}/description", "path": "/_xpack/prelert/modelsnapshots/{job_id}/{snapshot_id}/description",
"paths": [ "/_xpack/prelert/modelsnapshots/{jobId}/{snapshotId}/description" ], "paths": [ "/_xpack/prelert/modelsnapshots/{job_id}/{snapshot_id}/description" ],
"parts": { "parts": {
"jobId": { "job_id": {
"type": "string", "type": "string",
"required": true, "required": true,
"description": "The ID of the job to fetch" "description": "The ID of the job to fetch"
}, },
"snapshotId": { "snapshot_id": {
"type": "string", "type": "string",
"required": true, "required": true,
"description": "The ID of the snapshot whose description is to be updated" "description": "The ID of the snapshot whose description is to be updated"

View File

@ -2,20 +2,16 @@
"xpack.prelert.revert_model_snapshot": { "xpack.prelert.revert_model_snapshot": {
"methods": [ "POST" ], "methods": [ "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/modelsnapshots/{jobId}/_revert", "path": "/_xpack/prelert/modelsnapshots/{job_id}/_revert",
"paths": [ "/_xpack/prelert/modelsnapshots/{jobId}/_revert" ], "paths": [ "/_xpack/prelert/modelsnapshots/{job_id}/_revert" ],
"parts": { "parts": {
"jobId": { "job_id": {
"type": "string", "type": "string",
"required": true, "required": true,
"description": "The ID of the job to fetch" "description": "The ID of the job to fetch"
} }
}, },
"params": { "params": {
"from": {
"type": "integer",
"description": ""
},
"time": { "time": {
"type": "date", "type": "date",
"description": "revert to a snapshot with a timestamp no later than this time" "description": "revert to a snapshot with a timestamp no later than this time"
@ -34,6 +30,8 @@
} }
} }
}, },
"body": null "body": {
"description": "Model snapshot selection criteria"
}
} }
} }

View File

@ -24,6 +24,8 @@
} }
} }
}, },
"body": null "body": {
"description": "The start scheduler parameters"
}
} }
} }

View File

@ -78,10 +78,10 @@ setup:
- do: - do:
catch: param catch: param
xpack.prelert.delete_model_snapshot: xpack.prelert.delete_model_snapshot:
jobId: "foo" job_id: "foo"
--- ---
"Test delete snapshot missing jobId": "Test delete snapshot missing job_id":
- do: - do:
catch: param catch: param
xpack.prelert.delete_model_snapshot: xpack.prelert.delete_model_snapshot:
@ -91,7 +91,7 @@ setup:
"Test valid delete snapshot": "Test valid delete snapshot":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.prelert.get_model_snapshots:
jobId: "foo" job_id: "foo"
- match: { count: 2 } - match: { count: 2 }
- do: - do:
@ -103,8 +103,8 @@ setup:
- do: - do:
xpack.prelert.delete_model_snapshot: xpack.prelert.delete_model_snapshot:
jobId: "foo" job_id: "foo"
snapshotId: "foo1" snapshot_id: "foo1"
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
@ -113,7 +113,7 @@ setup:
- do: - do:
xpack.prelert.get_model_snapshots: xpack.prelert.get_model_snapshots:
jobId: "foo" job_id: "foo"
- match: { count: 1 } - match: { count: 1 }
- match: { modelSnapshots.0.snapshotId: "foo2"} - match: { modelSnapshots.0.snapshotId: "foo2"}
@ -128,11 +128,11 @@ setup:
"Test delete with in-use model": "Test delete with in-use model":
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.prelert.revert_model_snapshot:
jobId: "foo" job_id: "foo"
snapshotId: "foo2" snapshotId: "foo2"
- do: - do:
catch: request catch: request
xpack.prelert.delete_model_snapshot: xpack.prelert.delete_model_snapshot:
jobId: "foo" job_id: "foo"
snapshotId: "foo2" snapshot_id: "foo2"

View File

@ -32,7 +32,7 @@ setup:
"Test get model snapshots API with no params": "Test get model snapshots API with no params":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.prelert.get_model_snapshots:
jobId: "foo" job_id: "foo"
- match: { count: 2 } - match: { count: 2 }
@ -43,7 +43,7 @@ setup:
"Test get model snapshots API with start/end": "Test get model snapshots API with start/end":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.prelert.get_model_snapshots:
jobId: "foo" job_id: "foo"
start: "2016-05-01T00:00:00Z" start: "2016-05-01T00:00:00Z"
end: "2016-07-01T00:00:00Z" end: "2016-07-01T00:00:00Z"
@ -56,7 +56,7 @@ setup:
"Test get model snapshots API with ascending": "Test get model snapshots API with ascending":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.prelert.get_model_snapshots:
jobId: "foo" job_id: "foo"
desc: false desc: false
@ -68,7 +68,7 @@ setup:
"Test get model snapshots API with size": "Test get model snapshots API with size":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.prelert.get_model_snapshots:
jobId: "foo" job_id: "foo"
size: 1 size: 1
@ -81,7 +81,7 @@ setup:
"Test get model snapshots API with from": "Test get model snapshots API with from":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.prelert.get_model_snapshots:
jobId: "foo" job_id: "foo"
from: 1 from: 1

View File

@ -28,7 +28,7 @@ setup:
"Test result buckets api": "Test result buckets api":
- do: - do:
xpack.prelert.get_buckets: xpack.prelert.get_buckets:
jobId: "farequote" job_id: "farequote"
start: "2016-05-01T00:00:00Z" start: "2016-05-01T00:00:00Z"
end: "2016-07-01T00:00:00Z" end: "2016-07-01T00:00:00Z"
@ -41,7 +41,7 @@ setup:
"Test result single bucket api": "Test result single bucket api":
- do: - do:
xpack.prelert.get_buckets: xpack.prelert.get_buckets:
jobId: "farequote" job_id: "farequote"
timestamp: "2016-06-01T00:00:00Z" timestamp: "2016-06-01T00:00:00Z"
- match: { buckets.0.timestamp: 1464739200000} - match: { buckets.0.timestamp: 1464739200000}

View File

@ -26,7 +26,7 @@ setup:
"Test result categories api": "Test result categories api":
- do: - do:
xpack.prelert.get_categories: xpack.prelert.get_categories:
jobId: "farequote" job_id: "farequote"
- match: { count: 2 } - match: { count: 2 }
- match: { categories.0.jobId: farequote } - match: { categories.0.jobId: farequote }
@ -38,8 +38,8 @@ setup:
"Test result category api": "Test result category api":
- do: - do:
xpack.prelert.get_categories: xpack.prelert.get_categories:
jobId: "farequote" job_id: "farequote"
categoryId: "1" category_id: "1"
- match: { categories.0.jobId: farequote } - match: { categories.0.jobId: farequote }
- match: { categories.0.categoryId: 1 } - match: { categories.0.categoryId: 1 }

View File

@ -36,7 +36,7 @@ setup:
"Test result influencers api": "Test result influencers api":
- do: - do:
xpack.prelert.get_influencers: xpack.prelert.get_influencers:
jobId: "farequote" job_id: "farequote"
start: "2016-05-01T00:00:00Z" start: "2016-05-01T00:00:00Z"
end: "2016-07-01T00:00:00Z" end: "2016-07-01T00:00:00Z"

View File

@ -42,7 +42,7 @@ setup:
"Test result records api": "Test result records api":
- do: - do:
xpack.prelert.get_records: xpack.prelert.get_records:
jobId: "farequote" job_id: "farequote"
start: "2016-05-01T00:00:00Z" start: "2016-05-01T00:00:00Z"
end: "2016-07-01T00:00:00Z" end: "2016-07-01T00:00:00Z"

View File

@ -54,14 +54,14 @@ setup:
- do: - do:
xpack.prelert.post_data: xpack.prelert.post_data:
jobId: job-stats-test job_id: job-stats-test
body: > body: >
{"airline":"AAL","responsetime":"132.2046","time":"1403481600"} {"airline":"AAL","responsetime":"132.2046","time":"1403481600"}
{"airline":"JZA","responsetime":"990.4628","time":"1403481600"} {"airline":"JZA","responsetime":"990.4628","time":"1403481600"}
- do: - do:
xpack.prelert.flush_data: xpack.prelert.flush_data:
jobId: job-stats-test job_id: job-stats-test
- match: { acknowledged: true } - match: { acknowledged: true }

View File

@ -20,7 +20,7 @@ setup:
"Test POST data job api, flush, close and verify DataCounts doc": "Test POST data job api, flush, close and verify DataCounts doc":
- do: - do:
xpack.prelert.post_data: xpack.prelert.post_data:
jobId: farequote job_id: farequote
body: > body: >
{"airline":"AAL","responsetime":"132.2046","sourcetype":"farequote","time":"1403481600"} {"airline":"AAL","responsetime":"132.2046","sourcetype":"farequote","time":"1403481600"}
{"airline":"JZA","responsetime":"990.4628","sourcetype":"farequote","time":"1403481700"} {"airline":"JZA","responsetime":"990.4628","sourcetype":"farequote","time":"1403481700"}
@ -37,12 +37,12 @@ setup:
- do: - do:
xpack.prelert.flush_data: xpack.prelert.flush_data:
jobId: farequote job_id: farequote
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
xpack.prelert.close_data: xpack.prelert.close_data:
jobId: farequote job_id: farequote
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
@ -72,7 +72,7 @@ setup:
- do: - do:
catch: /parse_exception/ catch: /parse_exception/
xpack.prelert.post_data: xpack.prelert.post_data:
jobId: foo job_id: foo
resetStart: not_a_date resetStart: not_a_date
body: > body: >
{"airline":"AAL","responsetime":"132.2046","sourcetype":"farequote","time":"1403481600"} {"airline":"AAL","responsetime":"132.2046","sourcetype":"farequote","time":"1403481600"}
@ -81,7 +81,7 @@ setup:
- do: - do:
catch: /parse_exception/ catch: /parse_exception/
xpack.prelert.post_data: xpack.prelert.post_data:
jobId: foo job_id: foo
resetEnd: end_not_a_date resetEnd: end_not_a_date
body: > body: >
{"airline":"AAL","responsetime":"132.2046","sourcetype":"farequote","time":"1403481600"} {"airline":"AAL","responsetime":"132.2046","sourcetype":"farequote","time":"1403481600"}
@ -92,17 +92,17 @@ setup:
- do: - do:
catch: /parse_exception/ catch: /parse_exception/
xpack.prelert.flush_data: xpack.prelert.flush_data:
jobId: foo job_id: foo
start: not_a_date start: not_a_date
- do: - do:
catch: /parse_exception/ catch: /parse_exception/
xpack.prelert.flush_data: xpack.prelert.flush_data:
jobId: foo job_id: foo
end: end_not_a_date end: end_not_a_date
- do: - do:
catch: /parse_exception/ catch: /parse_exception/
xpack.prelert.flush_data: xpack.prelert.flush_data:
jobId: foo job_id: foo
advanceTime: advance_time_not_a_date advanceTime: advance_time_not_a_date

View File

@ -46,8 +46,8 @@ setup:
- do: - do:
catch: request catch: request
xpack.prelert.put_model_snapshot_description: xpack.prelert.put_model_snapshot_description:
jobId: "foo" job_id: "foo"
snapshotId: "foo" snapshot_id: "foo"
body: > body: >
{ {
"some_field": "foo" "some_field": "foo"
@ -57,7 +57,7 @@ setup:
"Test with valid description": "Test with valid description":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.prelert.get_model_snapshots:
jobId: "foo" job_id: "foo"
description: "new_description" description: "new_description"
- match: { count: 0 } - match: { count: 0 }
@ -65,8 +65,8 @@ setup:
- do: - do:
xpack.prelert.put_model_snapshot_description: xpack.prelert.put_model_snapshot_description:
jobId: "foo" job_id: "foo"
snapshotId: "foo" snapshot_id: "foo"
body: > body: >
{ {
"description": "new_description" "description": "new_description"
@ -78,7 +78,7 @@ setup:
- do: - do:
xpack.prelert.get_model_snapshots: xpack.prelert.get_model_snapshots:
jobId: "foo" job_id: "foo"
description: "new_description" description: "new_description"
- match: { count: 1 } - match: { count: 1 }
@ -89,7 +89,7 @@ setup:
"Test with conflict against existing description": "Test with conflict against existing description":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.prelert.get_model_snapshots:
jobId: "foo" job_id: "foo"
description: "bar" description: "bar"
- match: { count: 1 } - match: { count: 1 }
@ -100,8 +100,8 @@ setup:
- do: - do:
catch: request catch: request
xpack.prelert.put_model_snapshot_description: xpack.prelert.put_model_snapshot_description:
jobId: "foo" job_id: "foo"
snapshotId: "foo" snapshot_id: "foo"
body: > body: >
{ {
"description": "bar" "description": "bar"

View File

@ -73,18 +73,18 @@ setup:
index: prelertresults-foo index: prelertresults-foo
--- ---
"Test revert model with only jobId": "Test revert model with only job_id":
- do: - do:
catch: request catch: request
xpack.prelert.revert_model_snapshot: xpack.prelert.revert_model_snapshot:
jobId: "foo" job_id: "foo"
--- ---
"Test revert model with invalid time": "Test revert model with invalid time":
- do: - do:
catch: request catch: request
xpack.prelert.revert_model_snapshot: xpack.prelert.revert_model_snapshot:
jobId: "foo" job_id: "foo"
time: "foo" time: "foo"
--- ---
@ -92,7 +92,7 @@ setup:
- do: - do:
catch: /resource_not_found_exception/ catch: /resource_not_found_exception/
xpack.prelert.revert_model_snapshot: xpack.prelert.revert_model_snapshot:
jobId: "foo" job_id: "foo"
snapshotId: "not_exist" snapshotId: "not_exist"
--- ---
@ -100,14 +100,14 @@ setup:
- do: - do:
catch: /resource_not_found_exception/ catch: /resource_not_found_exception/
xpack.prelert.revert_model_snapshot: xpack.prelert.revert_model_snapshot:
jobId: "foo" job_id: "foo"
description: "foo" description: "foo"
--- ---
"Test revert model with valid snapshotId": "Test revert model with valid snapshotId":
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.prelert.revert_model_snapshot:
jobId: "foo" job_id: "foo"
snapshotId: "foo1" snapshotId: "foo1"
- match: { exists: true } - match: { exists: true }
@ -120,7 +120,7 @@ setup:
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.prelert.revert_model_snapshot:
jobId: "foo" job_id: "foo"
snapshotId: "foo2" snapshotId: "foo2"
- match: { exists: true } - match: { exists: true }
@ -135,7 +135,7 @@ setup:
"Test revert model with valid time": "Test revert model with valid time":
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.prelert.revert_model_snapshot:
jobId: "foo" job_id: "foo"
time: "2016-06-02T01:00:00Z" time: "2016-06-02T01:00:00Z"
- match: { exists: true } - match: { exists: true }
@ -148,7 +148,7 @@ setup:
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.prelert.revert_model_snapshot:
jobId: "foo" job_id: "foo"
time: "2016-06-01T01:00:00Z" time: "2016-06-01T01:00:00Z"
- match: { exists: true } - match: { exists: true }
@ -163,7 +163,7 @@ setup:
"Test revert model with valid description": "Test revert model with valid description":
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.prelert.revert_model_snapshot:
jobId: "foo" job_id: "foo"
description: "first" description: "first"
- match: { exists: true } - match: { exists: true }
@ -176,7 +176,7 @@ setup:
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.prelert.revert_model_snapshot:
jobId: "foo" job_id: "foo"
description: "second" description: "second"
- match: { exists: true } - match: { exists: true }
@ -191,7 +191,7 @@ setup:
"Test revert model with deleteInterveningResults": "Test revert model with deleteInterveningResults":
- do: - do:
xpack.prelert.get_buckets: xpack.prelert.get_buckets:
jobId: "foo" job_id: "foo"
start: "2016-01-01T00:00:00Z" start: "2016-01-01T00:00:00Z"
end: "2016-12-01T00:00:00Z" end: "2016-12-01T00:00:00Z"
@ -199,7 +199,7 @@ setup:
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.prelert.revert_model_snapshot:
jobId: "foo" job_id: "foo"
snapshotId: "foo2" snapshotId: "foo2"
deleteInterveningResults: true deleteInterveningResults: true
@ -209,7 +209,7 @@ setup:
- do: - do:
xpack.prelert.get_buckets: xpack.prelert.get_buckets:
jobId: "foo" job_id: "foo"
start: "2016-01-01T00:00:00Z" start: "2016-01-01T00:00:00Z"
end: "2016-12-01T00:00:00Z" end: "2016-12-01T00:00:00Z"