diff --git a/plugin/src/test/resources/rest-api-spec/test/ml/get_model_snapshots.yml b/plugin/src/test/resources/rest-api-spec/test/ml/get_model_snapshots.yml index de7221c501c..57cc80ae2fb 100644 --- a/plugin/src/test/resources/rest-api-spec/test/ml/get_model_snapshots.yml +++ b/plugin/src/test/resources/rest-api-spec/test/ml/get_model_snapshots.yml @@ -30,6 +30,17 @@ setup: "snapshot_doc_count": 1 } + - do: + headers: + Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser + index: + index: .ml-state + type: doc + id: "get-model-snapshots_model_state_1#1" + body: > + { + } + - do: headers: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser @@ -45,11 +56,33 @@ setup: "snapshot_doc_count": 2 } + - do: + headers: + Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser + index: + index: .ml-state + type: doc + id: "get-model-snapshots_model_state_2#1" + body: > + { + } + + - do: + headers: + Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser + index: + index: .ml-state + type: doc + id: "get-model-snapshots_model_state_2#2" + body: > + { + } + - do: headers: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser indices.refresh: - index: .ml-anomalies-get-model-snapshots + index: [.ml-anomalies-get-model-snapshots,.ml-state] --- "Test get model snapshots API with no params": diff --git a/plugin/src/test/resources/rest-api-spec/test/ml/revert_model_snapshot.yml b/plugin/src/test/resources/rest-api-spec/test/ml/revert_model_snapshot.yml index 0cb578fb75c..b50706dbec4 100644 --- a/plugin/src/test/resources/rest-api-spec/test/ml/revert_model_snapshot.yml +++ b/plugin/src/test/resources/rest-api-spec/test/ml/revert_model_snapshot.yml @@ -199,13 +199,7 @@ setup: headers: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser indices.refresh: - index: .ml-anomalies-revert-model-snapshot - - - do: - headers: - Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser - indices.refresh: - index: .ml-state + index: [.ml-anomalies-revert-model-snapshot,.ml-state] --- "Test revert model with invalid snapshotId": diff --git a/plugin/src/test/resources/rest-api-spec/test/ml/update_model_snapshot.yml b/plugin/src/test/resources/rest-api-spec/test/ml/update_model_snapshot.yml index 93933847e18..6a1d6e117e9 100644 --- a/plugin/src/test/resources/rest-api-spec/test/ml/update_model_snapshot.yml +++ b/plugin/src/test/resources/rest-api-spec/test/ml/update_model_snapshot.yml @@ -31,6 +31,39 @@ setup: "retain": false } + - do: + headers: + Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser + index: + index: .ml-state + type: doc + id: "update-model-snapshot_model_state_1#1" + body: > + { + } + + - do: + headers: + Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser + index: + index: .ml-state + type: doc + id: "update-model-snapshot_model_state_1#2" + body: > + { + } + + - do: + headers: + Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser + index: + index: .ml-state + type: doc + id: "update-model-snapshot_model_state_1#3" + body: > + { + } + - do: headers: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser @@ -48,11 +81,33 @@ setup: "retain": true } + - do: + headers: + Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser + index: + index: .ml-state + type: doc + id: "update-model-snapshot_model_state_2#1" + body: > + { + } + + - do: + headers: + Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser + index: + index: .ml-state + type: doc + id: "update-model-snapshot_model_state_2#2" + body: > + { + } + - do: headers: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser indices.refresh: - index: .ml-anomalies-update-model-snapshot + index: [.ml-anomalies-update-model-snapshot,.ml-state] --- "Test with valid description":