diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/prelert/action/GetJobsAction.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/prelert/action/GetJobsAction.java index 09336c29bca..abe785ec7c7 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/prelert/action/GetJobsAction.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/prelert/action/GetJobsAction.java @@ -68,11 +68,11 @@ public class GetJobsAction extends Action METRIC_WHITELIST = Arrays.asList(ALL, CONFIG, DATA_COUNTS, - MODEL_SIZE_STATS, SCHEDULER_STATE, STATUS); + MODEL_SIZE_STATS, SCHEDULER_STATUS, STATUS); private GetJobsAction() { super(NAME); @@ -195,7 +195,7 @@ public class GetJobsAction extends Action { try { Response getJobResponse = client.performRequest("get", PrelertPlugin.BASE_PATH + "jobs/" + jobId + "/_stats", - Collections.singletonMap("metric", "scheduler_state")); + Collections.singletonMap("metric", "scheduler_status")); assertThat(responseEntityToString(getJobResponse), containsString("\"status\":\"STOPPED\"")); } catch (Exception e) { throw new RuntimeException(e); diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_jobs.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_jobs.json index dce1f3ee5b1..a61c18873c9 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_jobs.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_jobs.json @@ -15,7 +15,7 @@ }, "metric" : { "type" : "list", - "options" : ["_all", "config", "data_counts", "model_size_stats", "scheduler_state", "status"], + "options" : ["_all", "config", "data_counts", "model_size_stats", "scheduler_status", "status"], "description" : "Limit the information returned to the specified statistics" } }, diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_stats.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_stats.yaml index 14810261c2b..95d9f3c9260 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_stats.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_stats.yaml @@ -67,7 +67,7 @@ setup: - is_true: jobs.0.config - is_false: jobs.0.data_counts - is_false: jobs.0.model_size_stats - - is_false: jobs.0.scheduler_state + - is_false: jobs.0.scheduler_status - do: @@ -101,7 +101,7 @@ setup: - is_false: jobs.0.config - is_true: jobs.0.data_counts - is_false: jobs.0.model_size_stats - - is_false: jobs.0.scheduler_state + - is_false: jobs.0.scheduler_status - do: xpack.prelert.get_jobs: @@ -109,13 +109,13 @@ setup: metric: "model_size_stats" - is_false: jobs.0.config - is_false: jobs.0.data_counts - - is_false: jobs.0.scheduler_state + - is_false: jobs.0.scheduler_status - match: { jobs.0.model_size_stats.model_bytes: 100 } - do: xpack.prelert.get_jobs: job_id: "job-stats-test" - metric: "scheduler_state" + metric: "scheduler_status" - is_false: jobs.0.config - is_false: jobs.0.data_counts @@ -126,7 +126,7 @@ setup: - is_false: jobs.0.config - is_false: jobs.0.data_counts - is_false: jobs.0.model_size_stats - - is_false: jobs.0.scheduler_state + - is_false: jobs.0.scheduler_status - match: { jobs.0.status: OPENED } - do: @@ -135,18 +135,18 @@ setup: metric: "_all" - is_true: jobs.0.config - is_true: jobs.0.data_counts - - is_false: jobs.0.scheduler_state + - is_false: jobs.0.scheduler_status - match: { jobs.0.job_id: job-stats-test } - match: { jobs.0.status: OPENED } - do: xpack.prelert.get_jobs: job_id: "scheduled-job" - metric: "scheduler_state" + metric: "scheduler_status" - is_false: jobs.0.config - is_false: jobs.0.data_counts - is_false: jobs.0.model_size_stats - - match: { jobs.0.scheduler_state: STOPPED } + - match: { jobs.0.scheduler_status: STOPPED } --- "Test bad metric":