From 1f57a53b3e14830b67dfbece7c626a7c26140d0a Mon Sep 17 00:00:00 2001 From: Dimitris Athanasiou Date: Wed, 26 Apr 2017 18:17:06 +0100 Subject: [PATCH] [ML] Correct error message for invalid job_id (elastic/x-pack-elasticsearch#1218) relates elastic/x-pack-elasticsearch#1211 Original commit: elastic/x-pack-elasticsearch@5389a4370649e3bf3f326c5cd9961e81f9b46685 --- .../org/elasticsearch/xpack/ml/job/messages/Messages.java | 4 ++-- plugin/src/test/resources/rest-api-spec/test/ml/validate.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/messages/Messages.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/messages/Messages.java index f98b32198b1..19ebc3efbce 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/messages/Messages.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/messages/Messages.java @@ -31,8 +31,8 @@ public final class Messages { public static final String INCONSISTENT_ID = "Inconsistent {0}; ''{1}'' specified in the body differs from ''{2}'' specified as a URL argument"; - public static final String INVALID_ID = - "Invalid {0}; ''{1}'' must be lowercase alphanumeric, may contain hyphens or underscores, may not start with underscore"; + public static final String INVALID_ID = "Invalid {0}; ''{1}'' can contain lowercase alphanumeric (a-z and 0-9), hyphens or " + + "underscores; must start and end with alphanumeric"; public static final String JOB_AUDIR_DATAFEED_DATA_SEEN_AGAIN = "Datafeed has started retrieving data again"; public static final String JOB_AUDIT_CREATED = "Job created"; diff --git a/plugin/src/test/resources/rest-api-spec/test/ml/validate.yaml b/plugin/src/test/resources/rest-api-spec/test/ml/validate.yaml index 1e6918fdb1c..5a917c6d58c 100644 --- a/plugin/src/test/resources/rest-api-spec/test/ml/validate.yaml +++ b/plugin/src/test/resources/rest-api-spec/test/ml/validate.yaml @@ -59,7 +59,7 @@ --- "Test job config that is invalid only because of the job ID": - do: - catch: /Invalid job_id; '_' must be lowercase alphanumeric, may contain hyphens or underscores, may not start with underscore/ + catch: /Invalid job_id; '_' can contain lowercase alphanumeric \(a-z and 0-9\), hyphens or underscores; must start and end with alphanumeric/ xpack.ml.validate: body: > {