From d4262de83a7a3fffd35ebcdc73c1014fbac8f19d Mon Sep 17 00:00:00 2001 From: Zachary Tong Date: Wed, 13 Jun 2018 15:42:20 -0400 Subject: [PATCH 1/7] [Docs] All Rollup docs experimental, agg limitations, clarify DeleteJob (#31299) - All rollup pages should be marked as experimental instead of just the top page - While the job config docs state which aggregations are allowed, adding a section which specifically details this in one place is more convenient for the user - Add a clarification that the DeleteJob API does not delete the rollup data, just the rollup job. --- .../en/rest-api/rollup/delete-job.asciidoc | 28 +++++++++++++++++++ .../docs/en/rest-api/rollup/get-job.asciidoc | 2 ++ .../docs/en/rest-api/rollup/put-job.asciidoc | 2 ++ .../en/rest-api/rollup/rollup-caps.asciidoc | 2 ++ .../rollup/rollup-job-config.asciidoc | 2 ++ .../en/rest-api/rollup/rollup-search.asciidoc | 2 ++ .../en/rest-api/rollup/start-job.asciidoc | 2 ++ .../docs/en/rest-api/rollup/stop-job.asciidoc | 2 ++ x-pack/docs/en/rollup/api-quickref.asciidoc | 2 ++ x-pack/docs/en/rollup/index.asciidoc | 4 ++- x-pack/docs/en/rollup/overview.asciidoc | 2 ++ .../en/rollup/rollup-agg-limitations.asciidoc | 24 ++++++++++++++++ .../en/rollup/rollup-getting-started.asciidoc | 2 ++ .../rollup/rollup-search-limitations.asciidoc | 6 ++-- .../en/rollup/understanding-groups.asciidoc | 2 ++ 15 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 x-pack/docs/en/rollup/rollup-agg-limitations.asciidoc diff --git a/x-pack/docs/en/rest-api/rollup/delete-job.asciidoc b/x-pack/docs/en/rest-api/rollup/delete-job.asciidoc index 056a4470480..b795e0b28c7 100644 --- a/x-pack/docs/en/rest-api/rollup/delete-job.asciidoc +++ b/x-pack/docs/en/rest-api/rollup/delete-job.asciidoc @@ -5,9 +5,37 @@ Delete Job ++++ +experimental[] + This API deletes an existing rollup job. The job can be started or stopped, in both cases it will be deleted. Attempting to delete a non-existing job will throw an exception +.Deleting the job does not delete rolled up data +********************************** +When a job is deleted, that only removes the process that is actively monitoring and rolling up data. +It does not delete any previously rolled up data. This is by design; a user may wish to roll up a static dataset. Because +the dataset is static, once it has been fully rolled up there is no need to keep the indexing Rollup job around (as there +will be no new data). So the job may be deleted, leaving behind the rolled up data for analysis. + +If you wish to also remove the rollup data, and the rollup index only contains the data for a single job, you can simply +delete the whole rollup index. If the rollup index stores data from several jobs, you must issue a Delete-By-Query that +targets the Rollup job's ID in the rollup index: + + +[source,js] +-------------------------------------------------- +POST my_rollup_index/_delete_by_query +{ + "query": { + "term": { + "_rollup.id": "the_rollup_job_id" + } + } +} +-------------------------------------------------- +// NOTCONSOLE + +********************************** ==== Request `DELETE _xpack/rollup/job/` diff --git a/x-pack/docs/en/rest-api/rollup/get-job.asciidoc b/x-pack/docs/en/rest-api/rollup/get-job.asciidoc index 4482a875279..7a7db9258b8 100644 --- a/x-pack/docs/en/rest-api/rollup/get-job.asciidoc +++ b/x-pack/docs/en/rest-api/rollup/get-job.asciidoc @@ -5,6 +5,8 @@ Get Job ++++ +experimental[] + This API returns the configuration, stats and status of rollup jobs. The API can return the details for a single job, or for all jobs. diff --git a/x-pack/docs/en/rest-api/rollup/put-job.asciidoc b/x-pack/docs/en/rest-api/rollup/put-job.asciidoc index 2cc869e1e34..1449acadc63 100644 --- a/x-pack/docs/en/rest-api/rollup/put-job.asciidoc +++ b/x-pack/docs/en/rest-api/rollup/put-job.asciidoc @@ -5,6 +5,8 @@ Create Job ++++ +experimental[] + This API enables you to create a rollup job. The job will be created in a `STOPPED` state, and must be started with the <>. diff --git a/x-pack/docs/en/rest-api/rollup/rollup-caps.asciidoc b/x-pack/docs/en/rest-api/rollup/rollup-caps.asciidoc index 5a4dab69d93..270ad005144 100644 --- a/x-pack/docs/en/rest-api/rollup/rollup-caps.asciidoc +++ b/x-pack/docs/en/rest-api/rollup/rollup-caps.asciidoc @@ -5,6 +5,8 @@ Get Rollup Caps ++++ +experimental[] + This API returns the rollup capabilities that have been configured for an index or index pattern. This API is useful because a rollup job is often configured to rollup only a subset of fields from the source index. Furthermore, only certain aggregations can be configured for various fields, leading to a limited subset of functionality depending on diff --git a/x-pack/docs/en/rest-api/rollup/rollup-job-config.asciidoc b/x-pack/docs/en/rest-api/rollup/rollup-job-config.asciidoc index 85f1a57caa7..ef0ea6f00f7 100644 --- a/x-pack/docs/en/rest-api/rollup/rollup-job-config.asciidoc +++ b/x-pack/docs/en/rest-api/rollup/rollup-job-config.asciidoc @@ -2,6 +2,8 @@ [[rollup-job-config]] === Rollup Job Configuration +experimental[] + The Rollup Job Configuration contains all the details about how the rollup job should run, when it indexes documents, and what future queries will be able to execute against the rollup index. diff --git a/x-pack/docs/en/rest-api/rollup/rollup-search.asciidoc b/x-pack/docs/en/rest-api/rollup/rollup-search.asciidoc index 557953fefb2..470cbc4eaf5 100644 --- a/x-pack/docs/en/rest-api/rollup/rollup-search.asciidoc +++ b/x-pack/docs/en/rest-api/rollup/rollup-search.asciidoc @@ -5,6 +5,8 @@ Rollup Search ++++ +experimental[] + The Rollup Search endpoint allows searching rolled-up data using the standard query DSL. The Rollup Search endpoint is needed because, internally, rolled-up documents utilize a different document structure than the original data. The Rollup Search endpoint rewrites standard query DSL into a format that matches the rollup documents, then takes the response diff --git a/x-pack/docs/en/rest-api/rollup/start-job.asciidoc b/x-pack/docs/en/rest-api/rollup/start-job.asciidoc index b8eccd5fbce..9a0a0a7e4f0 100644 --- a/x-pack/docs/en/rest-api/rollup/start-job.asciidoc +++ b/x-pack/docs/en/rest-api/rollup/start-job.asciidoc @@ -5,6 +5,8 @@ Start Job ++++ +experimental[] + This API starts an existing, stopped rollup job. If the job does not exist an exception will be thrown. Starting an already started job has no action. diff --git a/x-pack/docs/en/rest-api/rollup/stop-job.asciidoc b/x-pack/docs/en/rest-api/rollup/stop-job.asciidoc index 9da3872a10b..60507402705 100644 --- a/x-pack/docs/en/rest-api/rollup/stop-job.asciidoc +++ b/x-pack/docs/en/rest-api/rollup/stop-job.asciidoc @@ -5,6 +5,8 @@ Stop Job ++++ +experimental[] + This API stops an existing, started rollup job. If the job does not exist an exception will be thrown. Stopping an already stopped job has no action. diff --git a/x-pack/docs/en/rollup/api-quickref.asciidoc b/x-pack/docs/en/rollup/api-quickref.asciidoc index 1ae6de4ee01..10aed1b572d 100644 --- a/x-pack/docs/en/rollup/api-quickref.asciidoc +++ b/x-pack/docs/en/rollup/api-quickref.asciidoc @@ -1,6 +1,8 @@ [[rollup-api-quickref]] == API Quick Reference +experimental[] + Most {rollup} endpoints have the following base: [source,js] diff --git a/x-pack/docs/en/rollup/index.asciidoc b/x-pack/docs/en/rollup/index.asciidoc index 69cd872e596..9ac89341bfe 100644 --- a/x-pack/docs/en/rollup/index.asciidoc +++ b/x-pack/docs/en/rollup/index.asciidoc @@ -18,7 +18,8 @@ for analysis, but at a fraction of the storage cost of raw data. * <> * <> * <> -* <> +* <> +* <> -- @@ -27,4 +28,5 @@ include::overview.asciidoc[] include::api-quickref.asciidoc[] include::rollup-getting-started.asciidoc[] include::understanding-groups.asciidoc[] +include::rollup-agg-limitations.asciidoc[] include::rollup-search-limitations.asciidoc[] \ No newline at end of file diff --git a/x-pack/docs/en/rollup/overview.asciidoc b/x-pack/docs/en/rollup/overview.asciidoc index cee244a2ec2..a3f29f23bd1 100644 --- a/x-pack/docs/en/rollup/overview.asciidoc +++ b/x-pack/docs/en/rollup/overview.asciidoc @@ -1,6 +1,8 @@ [[rollup-overview]] == Overview +experimental[] + Time-based data (documents that are predominantly identified by their timestamp) often have associated retention policies to manage data growth. For example, your system may be generating 500,000 documents every second. That will generate 43 million documents per day, and nearly 16 billion documents a year. diff --git a/x-pack/docs/en/rollup/rollup-agg-limitations.asciidoc b/x-pack/docs/en/rollup/rollup-agg-limitations.asciidoc new file mode 100644 index 00000000000..cd20622d93c --- /dev/null +++ b/x-pack/docs/en/rollup/rollup-agg-limitations.asciidoc @@ -0,0 +1,24 @@ +[[rollup-agg-limitations]] +== Rollup Aggregation Limitations + +experimental[] + +There are some limitations to how fields can be rolled up / aggregated. This page highlights the major limitations so that +you are aware of them. + +[float] +=== Limited aggregation components + +The Rollup functionality allows fields to be grouped with the following aggregations: + +- Date Histogram aggregation +- Histogram aggregation +- Terms aggregation + +And the following metrics are allowed to be specified for numeric fields: + +- Min aggregation +- Max aggregation +- Sum aggregation +- Average aggregation +- Value Count aggregation \ No newline at end of file diff --git a/x-pack/docs/en/rollup/rollup-getting-started.asciidoc b/x-pack/docs/en/rollup/rollup-getting-started.asciidoc index cf96d674540..24f68dddd81 100644 --- a/x-pack/docs/en/rollup/rollup-getting-started.asciidoc +++ b/x-pack/docs/en/rollup/rollup-getting-started.asciidoc @@ -1,6 +1,8 @@ [[rollup-getting-started]] == Getting Started +experimental[] + To use the Rollup feature, you need to create one or more "Rollup Jobs". These jobs run continuously in the background and rollup the index or indices that you specify, placing the rolled documents in a secondary index (also of your choosing). diff --git a/x-pack/docs/en/rollup/rollup-search-limitations.asciidoc b/x-pack/docs/en/rollup/rollup-search-limitations.asciidoc index de47404a29d..57ba23eebcc 100644 --- a/x-pack/docs/en/rollup/rollup-search-limitations.asciidoc +++ b/x-pack/docs/en/rollup/rollup-search-limitations.asciidoc @@ -1,6 +1,8 @@ [[rollup-search-limitations]] == Rollup Search Limitations +experimental[] + While we feel the Rollup function is extremely flexible, the nature of summarizing data means there will be some limitations. Once live data is thrown away, you will always lose some flexibility. @@ -100,8 +102,8 @@ The Rollup functionality allows `query`'s in the search request, but with a limi - MatchAll Query - Any compound query (Boolean, Boosting, ConstantScore, etc) -Furthermore, these queries can only use fields that were also saved in the rollup job. If you wish to filter on a keyword `hostname` field, -that field must have been configured in the rollup job under a `terms` grouping. +Furthermore, these queries can only use fields that were also saved in the rollup job as a `group`. +If you wish to filter on a keyword `hostname` field, that field must have been configured in the rollup job under a `terms` grouping. If you attempt to use an unsupported query, or the query references a field that wasn't configured in the rollup job, an exception will be thrown. We expect the list of support queries to grow over time as more are implemented. diff --git a/x-pack/docs/en/rollup/understanding-groups.asciidoc b/x-pack/docs/en/rollup/understanding-groups.asciidoc index d6eef54fab8..f57f905ae04 100644 --- a/x-pack/docs/en/rollup/understanding-groups.asciidoc +++ b/x-pack/docs/en/rollup/understanding-groups.asciidoc @@ -1,6 +1,8 @@ [[rollup-understanding-groups]] == Understanding Groups +experimental[] + To preserve flexibility, Rollup Jobs are defined based on how future queries may need to use the data. Traditionally, systems force the admin to make decisions about what metrics to rollup and on what interval. E.g. The average of `cpu_time` on an hourly basis. This is limiting; if, at a future date, the admin wishes to see the average of `cpu_time` on an hourly basis _and partitioned by `host_name`_, From 43cb24035e4267e22041732bb805a07be47760a8 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 13 Jun 2018 23:08:18 +0300 Subject: [PATCH 2/7] SQL: Whitelist SQL utility class for better scripting (#30681) Add SQL class for reusing code inside SQL functions within Painless Fix #29832 --- x-pack/plugin/sql/build.gradle | 3 +- .../licenses/antlr4-runtime-4.5.3.jar.sha1 | 1 - .../sql/licenses/antlr4-runtime-LICENSE.txt | 26 --------- .../sql/licenses/antlr4-runtime-NOTICE.txt | 0 .../scalar/datetime/DateTimeFunction.java | 57 +++++++------------ .../scalar/script/ScriptTemplate.java | 3 +- .../whitelist/InternalSqlScriptUtils.java | 22 +++++++ .../sql/plugin/SqlPainlessExtension.java | 35 ++++++++++++ ...asticsearch.painless.spi.PainlessExtension | 1 + .../xpack/sql/plugin/sql_whitelist.txt | 12 ++++ 10 files changed, 94 insertions(+), 66 deletions(-) delete mode 100644 x-pack/plugin/sql/licenses/antlr4-runtime-4.5.3.jar.sha1 delete mode 100644 x-pack/plugin/sql/licenses/antlr4-runtime-LICENSE.txt delete mode 100644 x-pack/plugin/sql/licenses/antlr4-runtime-NOTICE.txt create mode 100644 x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/whitelist/InternalSqlScriptUtils.java create mode 100644 x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPainlessExtension.java create mode 100644 x-pack/plugin/sql/src/main/resources/META-INF/services/org.elasticsearch.painless.spi.PainlessExtension create mode 100644 x-pack/plugin/sql/src/main/resources/org/elasticsearch/xpack/sql/plugin/sql_whitelist.txt diff --git a/x-pack/plugin/sql/build.gradle b/x-pack/plugin/sql/build.gradle index c52413aa4e1..8b406235985 100644 --- a/x-pack/plugin/sql/build.gradle +++ b/x-pack/plugin/sql/build.gradle @@ -5,7 +5,7 @@ esplugin { name 'x-pack-sql' description 'The Elasticsearch plugin that powers SQL for Elasticsearch' classname 'org.elasticsearch.xpack.sql.plugin.SqlPlugin' - extendedPlugins = ['x-pack-core'] + extendedPlugins = ['x-pack-core', 'lang-painless'] } configurations { @@ -20,6 +20,7 @@ integTest.enabled = false dependencies { compileOnly "org.elasticsearch.plugin:x-pack-core:${version}" + compileOnly project(':modules:lang-painless') compile project('sql-proto') compile "org.elasticsearch.plugin:aggs-matrix-stats-client:${version}" compile "org.antlr:antlr4-runtime:4.5.3" diff --git a/x-pack/plugin/sql/licenses/antlr4-runtime-4.5.3.jar.sha1 b/x-pack/plugin/sql/licenses/antlr4-runtime-4.5.3.jar.sha1 deleted file mode 100644 index 535955b7d68..00000000000 --- a/x-pack/plugin/sql/licenses/antlr4-runtime-4.5.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -2609e36f18f7e8d593cc1cddfb2ac776dc96b8e0 \ No newline at end of file diff --git a/x-pack/plugin/sql/licenses/antlr4-runtime-LICENSE.txt b/x-pack/plugin/sql/licenses/antlr4-runtime-LICENSE.txt deleted file mode 100644 index 95d0a2554f6..00000000000 --- a/x-pack/plugin/sql/licenses/antlr4-runtime-LICENSE.txt +++ /dev/null @@ -1,26 +0,0 @@ -[The "BSD license"] -Copyright (c) 2015 Terence Parr, Sam Harwell -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/x-pack/plugin/sql/licenses/antlr4-runtime-NOTICE.txt b/x-pack/plugin/sql/licenses/antlr4-runtime-NOTICE.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/datetime/DateTimeFunction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/datetime/DateTimeFunction.java index 77a6db3009d..60672822278 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/datetime/DateTimeFunction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/datetime/DateTimeFunction.java @@ -51,8 +51,18 @@ public abstract class DateTimeFunction extends UnaryScalarFunction { protected final NodeInfo info() { return NodeInfo.create(this, ctorForInfo(), field(), timeZone()); } + protected abstract NodeInfo.NodeCtor2 ctorForInfo(); + @Override + protected TypeResolution resolveType() { + if (field().dataType() == DataType.DATE) { + return TypeResolution.TYPE_RESOLVED; + } + return new TypeResolution("Function [" + functionName() + "] cannot be applied on a non-date expression ([" + + Expressions.name(field()) + "] of type [" + field().dataType().esType + "])"); + } + public TimeZone timeZone() { return timeZone; } @@ -69,18 +79,12 @@ public abstract class DateTimeFunction extends UnaryScalarFunction { return null; } - ZonedDateTime time = ZonedDateTime.ofInstant( - Instant.ofEpochMilli(folded.getMillis()), ZoneId.of(timeZone.getID())); - return time.get(chronoField()); + return dateTimeChrono(folded.getMillis(), timeZone.getID(), chronoField().name()); } - @Override - protected TypeResolution resolveType() { - if (field().dataType() == DataType.DATE) { - return TypeResolution.TYPE_RESOLVED; - } - return new TypeResolution("Function [" + functionName() + "] cannot be applied on a non-date expression ([" - + Expressions.name(field()) + "] of type [" + field().dataType().esType + "])"); + public static Integer dateTimeChrono(long millis, String tzId, String chronoName) { + ZonedDateTime time = ZonedDateTime.ofInstant(Instant.ofEpochMilli(millis), ZoneId.of(tzId)); + return Integer.valueOf(time.get(ChronoField.valueOf(chronoName))); } @Override @@ -88,28 +92,11 @@ public abstract class DateTimeFunction extends UnaryScalarFunction { ParamsBuilder params = paramsBuilder(); String template = null; - if (TimeZone.getTimeZone("UTC").equals(timeZone)) { - // TODO: it would be nice to be able to externalize the extract function and reuse the script across all extractors - template = formatTemplate("doc[{}].value.get" + extractFunction() + "()"); - params.variable(field.name()); - } else { - // TODO ewwww - /* - * This uses the Java 8 time API because Painless doesn't whitelist creation of new - * Joda classes. - * - * The actual script is - * ZonedDateTime.ofInstant(Instant.ofEpochMilli(.value.millis), - * ZoneId.of()).get(ChronoField.get(MONTH_OF_YEAR)) - */ - - template = formatTemplate("ZonedDateTime.ofInstant(Instant.ofEpochMilli(doc[{}].value.millis), " - + "ZoneId.of({})).get(ChronoField.valueOf({}))"); - params.variable(field.name()) - .variable(timeZone.getID()) - .variable(chronoField().name()); - } - + template = formatTemplate("{sql}.dateTimeChrono(doc[{}].value.millis, {}, {})"); + params.variable(field.name()) + .variable(timeZone.getID()) + .variable(chronoField().name()); + return new ScriptTemplate(template, params.build(), dataType()); } @@ -119,10 +106,6 @@ public abstract class DateTimeFunction extends UnaryScalarFunction { throw new UnsupportedOperationException(); } - protected String extractFunction() { - return getClass().getSimpleName(); - } - /** * Used for generating the painless script version of this function when the time zone is not UTC */ @@ -164,4 +147,4 @@ public abstract class DateTimeFunction extends UnaryScalarFunction { public int hashCode() { return Objects.hash(field(), timeZone); } -} +} \ No newline at end of file diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/script/ScriptTemplate.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/script/ScriptTemplate.java index 323ccc4e072..35b7680dcca 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/script/ScriptTemplate.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/script/ScriptTemplate.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.sql.expression.function.scalar.script; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; +import org.elasticsearch.xpack.sql.expression.function.scalar.whitelist.InternalSqlScriptUtils; import org.elasticsearch.xpack.sql.type.DataType; import org.elasticsearch.xpack.sql.util.StringUtils; @@ -92,6 +93,6 @@ public class ScriptTemplate { } public static String formatTemplate(String template) { - return template.replace("{}", "params.%s"); + return template.replace("{sql}", InternalSqlScriptUtils.class.getSimpleName()).replace("{}", "params.%s"); } } diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/whitelist/InternalSqlScriptUtils.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/whitelist/InternalSqlScriptUtils.java new file mode 100644 index 00000000000..802aa4a7c09 --- /dev/null +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/whitelist/InternalSqlScriptUtils.java @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +package org.elasticsearch.xpack.sql.expression.function.scalar.whitelist; + +import org.elasticsearch.xpack.sql.expression.function.scalar.datetime.DateTimeFunction; + +/** + * Whitelisted class for SQL scripts. + * Acts as a registry of the various static methods used internally by the scalar functions + * (to simplify the whitelist definition). + */ +public final class InternalSqlScriptUtils { + + private InternalSqlScriptUtils() {} + + public static Integer dateTimeChrono(long millis, String tzId, String chronoName) { + return DateTimeFunction.dateTimeChrono(millis, tzId, chronoName); + } +} diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPainlessExtension.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPainlessExtension.java new file mode 100644 index 00000000000..426d725ac79 --- /dev/null +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPainlessExtension.java @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +package org.elasticsearch.xpack.sql.plugin; + +import org.elasticsearch.painless.spi.PainlessExtension; +import org.elasticsearch.painless.spi.Whitelist; +import org.elasticsearch.painless.spi.WhitelistLoader; +import org.elasticsearch.script.FilterScript; +import org.elasticsearch.script.ScriptContext; +import org.elasticsearch.script.SearchScript; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static java.util.Collections.singletonList; + +public class SqlPainlessExtension implements PainlessExtension { + + private static final Whitelist WHITELIST = WhitelistLoader.loadFromResourceFiles(SqlPainlessExtension.class, "sql_whitelist.txt"); + + @Override + public Map, List> getContextWhitelists() { + Map, List> whitelist = new HashMap<>(); + List list = singletonList(WHITELIST); + whitelist.put(FilterScript.CONTEXT, list); + whitelist.put(SearchScript.AGGS_CONTEXT, list); + whitelist.put(SearchScript.CONTEXT, list); + whitelist.put(SearchScript.SCRIPT_SORT_CONTEXT, list); + return whitelist; + } +} diff --git a/x-pack/plugin/sql/src/main/resources/META-INF/services/org.elasticsearch.painless.spi.PainlessExtension b/x-pack/plugin/sql/src/main/resources/META-INF/services/org.elasticsearch.painless.spi.PainlessExtension new file mode 100644 index 00000000000..5f2f571f015 --- /dev/null +++ b/x-pack/plugin/sql/src/main/resources/META-INF/services/org.elasticsearch.painless.spi.PainlessExtension @@ -0,0 +1 @@ +org.elasticsearch.xpack.sql.plugin.SqlPainlessExtension \ No newline at end of file diff --git a/x-pack/plugin/sql/src/main/resources/org/elasticsearch/xpack/sql/plugin/sql_whitelist.txt b/x-pack/plugin/sql/src/main/resources/org/elasticsearch/xpack/sql/plugin/sql_whitelist.txt new file mode 100644 index 00000000000..8dae4f8c0d1 --- /dev/null +++ b/x-pack/plugin/sql/src/main/resources/org/elasticsearch/xpack/sql/plugin/sql_whitelist.txt @@ -0,0 +1,12 @@ +# +# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +# or more contributor license agreements. Licensed under the Elastic License; +# you may not use this file except in compliance with the Elastic License. +# + +# This file contains a whitelist for SQL specific utilities available inside SQL scripting + +class org.elasticsearch.xpack.sql.expression.function.scalar.whitelist.InternalSqlScriptUtils { + + Integer dateTimeChrono(long, String, String) +} \ No newline at end of file From 2c17ab7d2a9816a3cc9cc5f6d9adcfa21e396e71 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Wed, 13 Jun 2018 22:06:43 +0200 Subject: [PATCH 3/7] Fix version detection. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6517d0292ba..ec81047e3e6 100644 --- a/build.gradle +++ b/build.gradle @@ -131,7 +131,7 @@ task verifyVersions { new URL('https://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/maven-metadata.xml').openStream().withStream { s -> xml = new XmlParser().parse(s) } - Set knownVersions = new TreeSet<>(xml.versioning.versions.version.collect { it.text() }.findAll { it ==~ /\d\.\d\.\d/ }.collect { Version.fromString(it) }) + Set knownVersions = new TreeSet<>(xml.versioning.versions.version.collect { it.text() }.findAll { it ==~ /\d+\.\d+\.\d+/ }.collect { Version.fromString(it) }) // Limit the known versions to those that should be index compatible, and are not future versions knownVersions = knownVersions.findAll { it.major >= bwcVersions.currentVersion.major - 1 && it.before(VersionProperties.elasticsearch) } From af58dc56fefd88dba48d4fcca3246d468dd68bc9 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Wed, 13 Jun 2018 22:21:09 +0200 Subject: [PATCH 4/7] Add 5.6.11 version constant. --- server/src/main/java/org/elasticsearch/Version.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/main/java/org/elasticsearch/Version.java b/server/src/main/java/org/elasticsearch/Version.java index 848af37c70b..911614e0013 100644 --- a/server/src/main/java/org/elasticsearch/Version.java +++ b/server/src/main/java/org/elasticsearch/Version.java @@ -120,6 +120,8 @@ public class Version implements Comparable, ToXContentFragment { public static final Version V_5_6_9 = new Version(V_5_6_9_ID, org.apache.lucene.util.Version.LUCENE_6_6_1); public static final int V_5_6_10_ID = 5061099; public static final Version V_5_6_10 = new Version(V_5_6_10_ID, org.apache.lucene.util.Version.LUCENE_6_6_1); + public static final int V_5_6_11_ID = 5061199; + public static final Version V_5_6_11 = new Version(V_5_6_11_ID, org.apache.lucene.util.Version.LUCENE_6_6_1); public static final int V_6_0_0_alpha1_ID = 6000001; public static final Version V_6_0_0_alpha1 = new Version(V_6_0_0_alpha1_ID, org.apache.lucene.util.Version.LUCENE_7_0_0); @@ -232,6 +234,8 @@ public class Version implements Comparable, ToXContentFragment { return V_6_0_0_alpha2; case V_6_0_0_alpha1_ID: return V_6_0_0_alpha1; + case V_5_6_11_ID: + return V_5_6_11; case V_5_6_10_ID: return V_5_6_10; case V_5_6_9_ID: From bbb7889236324d4890e7b3a316cac59519473857 Mon Sep 17 00:00:00 2001 From: Tal Levy Date: Wed, 13 Jun 2018 13:35:41 -0700 Subject: [PATCH 5/7] move security ingest processors to a sub ingest directory (#31306) It makes sense to introduce new Security ingest processors (example: #31087), and this change would give them a good place to be written. --- .../main/java/org/elasticsearch/xpack/security/Security.java | 2 +- .../xpack/security/ingest}/SetSecurityUserProcessor.java | 2 +- .../ingest}/SetSecurityUserProcessorFactoryTests.java | 4 ++-- .../SetSecurityUserProcessorTests.java | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) rename x-pack/plugin/{core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol => security/src/main/java/org/elasticsearch/xpack/security/ingest}/SetSecurityUserProcessor.java (98%) rename x-pack/plugin/{core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol => security/src/test/java/org/elasticsearch/xpack/security/ingest}/SetSecurityUserProcessorFactoryTests.java (94%) rename x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/{authz/accesscontrol => ingest}/SetSecurityUserProcessorTests.java (97%) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java index d2e35999096..664745b1920 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java @@ -115,7 +115,6 @@ import org.elasticsearch.xpack.core.security.authz.AuthorizationServiceField; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import org.elasticsearch.xpack.core.security.authz.accesscontrol.IndicesAccessControl; import org.elasticsearch.xpack.core.security.authz.accesscontrol.SecurityIndexSearcherWrapper; -import org.elasticsearch.xpack.core.security.authz.accesscontrol.SetSecurityUserProcessor; import org.elasticsearch.xpack.core.security.authz.permission.FieldPermissions; import org.elasticsearch.xpack.core.security.authz.permission.FieldPermissionsCache; import org.elasticsearch.xpack.security.authz.store.FileRolesStore; @@ -174,6 +173,7 @@ import org.elasticsearch.xpack.security.authz.SecuritySearchOperationListener; import org.elasticsearch.xpack.security.authz.accesscontrol.OptOutQueryCache; import org.elasticsearch.xpack.security.authz.store.CompositeRolesStore; import org.elasticsearch.xpack.security.authz.store.NativeRolesStore; +import org.elasticsearch.xpack.security.ingest.SetSecurityUserProcessor; import org.elasticsearch.xpack.security.rest.SecurityRestFilter; import org.elasticsearch.xpack.security.rest.action.RestAuthenticateAction; import org.elasticsearch.xpack.security.rest.action.oauth2.RestGetTokenAction; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SetSecurityUserProcessor.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessor.java similarity index 98% rename from x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SetSecurityUserProcessor.java rename to x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessor.java index 051a0776463..15ac88b4d94 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SetSecurityUserProcessor.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessor.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.core.security.authz.accesscontrol; +package org.elasticsearch.xpack.security.ingest; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.ingest.AbstractProcessor; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SetSecurityUserProcessorFactoryTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorFactoryTests.java similarity index 94% rename from x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SetSecurityUserProcessorFactoryTests.java rename to x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorFactoryTests.java index 483d3de2bea..19da9b18ea6 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SetSecurityUserProcessorFactoryTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorFactoryTests.java @@ -3,11 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.core.security.authz.accesscontrol; +package org.elasticsearch.xpack.security.ingest; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.core.security.authz.accesscontrol.SetSecurityUserProcessor.Property; +import org.elasticsearch.xpack.security.ingest.SetSecurityUserProcessor.Property; import java.util.Arrays; import java.util.EnumSet; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SetSecurityUserProcessorTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorTests.java similarity index 97% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SetSecurityUserProcessorTests.java rename to x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorTests.java index c9ef169a375..26c59a1ef54 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SetSecurityUserProcessorTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.security.authz.accesscontrol; +package org.elasticsearch.xpack.security.ingest; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; @@ -11,9 +11,8 @@ import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.authc.Authentication; import org.elasticsearch.xpack.core.security.authc.AuthenticationField; -import org.elasticsearch.xpack.core.security.authz.accesscontrol.SetSecurityUserProcessor; -import org.elasticsearch.xpack.core.security.authz.accesscontrol.SetSecurityUserProcessor.Property; import org.elasticsearch.xpack.core.security.user.User; +import org.elasticsearch.xpack.security.ingest.SetSecurityUserProcessor.Property; import java.util.Collections; import java.util.EnumSet; From 93662c63855aa72ceb241acf2d4241bb02266cad Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 13 Jun 2018 23:37:51 +0300 Subject: [PATCH 6/7] Use quotes in the call invocation (#31249) Adding quotes around call invocation as paths can contain spaces that otherwise would cause the command to fail --- distribution/src/bin/elasticsearch-cli.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/src/bin/elasticsearch-cli.bat b/distribution/src/bin/elasticsearch-cli.bat index b668a7c06c2..e17ade3b74a 100644 --- a/distribution/src/bin/elasticsearch-cli.bat +++ b/distribution/src/bin/elasticsearch-cli.bat @@ -2,7 +2,7 @@ call "%~dp0elasticsearch-env.bat" || exit /b 1 if defined ES_ADDITIONAL_SOURCES ( for %%a in ("%ES_ADDITIONAL_SOURCES:;=","%") do ( - call %~dp0%%a + call "%~dp0%%a" ) ) From 509729f9c1a5c91dcbed6906990852a7e28522c9 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 13 Jun 2018 13:37:35 -0700 Subject: [PATCH 7/7] [DOCS] Shortens ML API intros --- x-pack/docs/en/rest-api/ml/close-job.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/delete-calendar-event.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/delete-calendar-job.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/delete-calendar.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/delete-datafeed.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/delete-job.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/delete-snapshot.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/flush-job.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/forecast.asciidoc | 3 +-- x-pack/docs/en/rest-api/ml/get-bucket.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/get-calendar-event.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/get-calendar.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/get-category.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/get-datafeed-stats.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/get-datafeed.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/get-influencer.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/get-job-stats.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/get-job.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/get-overall-buckets.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/get-record.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/get-snapshot.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/open-job.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/post-calendar-event.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/post-data.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/preview-datafeed.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/put-calendar-job.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/put-calendar.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/put-datafeed.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/put-job.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/revert-snapshot.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/start-datafeed.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/stop-datafeed.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/update-datafeed.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/update-job.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/update-snapshot.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/validate-detector.asciidoc | 2 +- x-pack/docs/en/rest-api/ml/validate-job.asciidoc | 2 +- 37 files changed, 37 insertions(+), 38 deletions(-) diff --git a/x-pack/docs/en/rest-api/ml/close-job.asciidoc b/x-pack/docs/en/rest-api/ml/close-job.asciidoc index 3e612f5171d..8e7e8eb0ce8 100644 --- a/x-pack/docs/en/rest-api/ml/close-job.asciidoc +++ b/x-pack/docs/en/rest-api/ml/close-job.asciidoc @@ -5,7 +5,7 @@ Close Jobs ++++ -This API enables you to close one or more jobs. +Closes one or more jobs. A job can be opened and closed multiple times throughout its lifecycle. A closed job cannot receive data or perform analysis diff --git a/x-pack/docs/en/rest-api/ml/delete-calendar-event.asciidoc b/x-pack/docs/en/rest-api/ml/delete-calendar-event.asciidoc index b6f3c644acf..73458f31791 100644 --- a/x-pack/docs/en/rest-api/ml/delete-calendar-event.asciidoc +++ b/x-pack/docs/en/rest-api/ml/delete-calendar-event.asciidoc @@ -5,7 +5,7 @@ Delete Events from Calendar ++++ -This API enables you to delete scheduled events from a calendar. +Deletes scheduled events from a calendar. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/delete-calendar-job.asciidoc b/x-pack/docs/en/rest-api/ml/delete-calendar-job.asciidoc index 54fe9ebdaba..94388c0c4b6 100644 --- a/x-pack/docs/en/rest-api/ml/delete-calendar-job.asciidoc +++ b/x-pack/docs/en/rest-api/ml/delete-calendar-job.asciidoc @@ -5,7 +5,7 @@ Delete Jobs from Calendar ++++ -This API enables you to delete jobs from a calendar. +Deletes jobs from a calendar. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/delete-calendar.asciidoc b/x-pack/docs/en/rest-api/ml/delete-calendar.asciidoc index 37b3ae3c87b..f7673b54574 100644 --- a/x-pack/docs/en/rest-api/ml/delete-calendar.asciidoc +++ b/x-pack/docs/en/rest-api/ml/delete-calendar.asciidoc @@ -5,7 +5,7 @@ Delete Calendar ++++ -This API enables you to delete a calendar. +Deletes a calendar. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/delete-datafeed.asciidoc b/x-pack/docs/en/rest-api/ml/delete-datafeed.asciidoc index de529267f4f..db4fd5c177a 100644 --- a/x-pack/docs/en/rest-api/ml/delete-datafeed.asciidoc +++ b/x-pack/docs/en/rest-api/ml/delete-datafeed.asciidoc @@ -5,7 +5,7 @@ Delete {dfeeds-cap} ++++ -This API enables you to delete an existing {dfeed}. +Deletes an existing {dfeed}. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/delete-job.asciidoc b/x-pack/docs/en/rest-api/ml/delete-job.asciidoc index 7aaba59e122..c01b08545b6 100644 --- a/x-pack/docs/en/rest-api/ml/delete-job.asciidoc +++ b/x-pack/docs/en/rest-api/ml/delete-job.asciidoc @@ -5,7 +5,7 @@ Delete Jobs ++++ -This API enables you to delete an existing anomaly detection job. +Deletes an existing anomaly detection job. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/delete-snapshot.asciidoc b/x-pack/docs/en/rest-api/ml/delete-snapshot.asciidoc index b63e37a1b45..2ab0116fe74 100644 --- a/x-pack/docs/en/rest-api/ml/delete-snapshot.asciidoc +++ b/x-pack/docs/en/rest-api/ml/delete-snapshot.asciidoc @@ -5,7 +5,7 @@ Delete Model Snapshots ++++ -This API enables you to delete an existing model snapshot. +Deletes an existing model snapshot. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/flush-job.asciidoc b/x-pack/docs/en/rest-api/ml/flush-job.asciidoc index 2a65c5284fc..934a2d81b17 100644 --- a/x-pack/docs/en/rest-api/ml/flush-job.asciidoc +++ b/x-pack/docs/en/rest-api/ml/flush-job.asciidoc @@ -5,7 +5,7 @@ Flush Jobs ++++ -This API forces any buffered data to be processed by the job. +Forces any buffered data to be processed by the job. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/forecast.asciidoc b/x-pack/docs/en/rest-api/ml/forecast.asciidoc index 9e3e48a2e7b..169debef7b6 100644 --- a/x-pack/docs/en/rest-api/ml/forecast.asciidoc +++ b/x-pack/docs/en/rest-api/ml/forecast.asciidoc @@ -5,8 +5,7 @@ Forecast Jobs ++++ -This API uses historical behavior to predict the future behavior of a time -series. +Predict the future behavior of a time series by using historical behavior. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/get-bucket.asciidoc b/x-pack/docs/en/rest-api/ml/get-bucket.asciidoc index 9a20d4fc15e..95b05ff7f5d 100644 --- a/x-pack/docs/en/rest-api/ml/get-bucket.asciidoc +++ b/x-pack/docs/en/rest-api/ml/get-bucket.asciidoc @@ -5,7 +5,7 @@ Get Buckets ++++ -This API enables you to retrieve job results for one or more buckets. +Retrieves job results for one or more buckets. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/get-calendar-event.asciidoc b/x-pack/docs/en/rest-api/ml/get-calendar-event.asciidoc index 1a10ad68d7f..e89173c3382 100644 --- a/x-pack/docs/en/rest-api/ml/get-calendar-event.asciidoc +++ b/x-pack/docs/en/rest-api/ml/get-calendar-event.asciidoc @@ -5,7 +5,7 @@ Get Scheduled Events ++++ -This API enables you to retrieve information about the scheduled events in +Retrieves information about the scheduled events in calendars. diff --git a/x-pack/docs/en/rest-api/ml/get-calendar.asciidoc b/x-pack/docs/en/rest-api/ml/get-calendar.asciidoc index 245d5709472..ae95fd99688 100644 --- a/x-pack/docs/en/rest-api/ml/get-calendar.asciidoc +++ b/x-pack/docs/en/rest-api/ml/get-calendar.asciidoc @@ -5,7 +5,7 @@ Get Calendars ++++ -This API enables you to retrieve configuration information for calendars. +Retrieves configuration information for calendars. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/get-category.asciidoc b/x-pack/docs/en/rest-api/ml/get-category.asciidoc index 9e69083355b..13f274133c0 100644 --- a/x-pack/docs/en/rest-api/ml/get-category.asciidoc +++ b/x-pack/docs/en/rest-api/ml/get-category.asciidoc @@ -5,7 +5,7 @@ Get Categories ++++ -This API enables you to retrieve job results for one or more categories. +Retrieves job results for one or more categories. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/get-datafeed-stats.asciidoc b/x-pack/docs/en/rest-api/ml/get-datafeed-stats.asciidoc index 6c5b3af650b..2869e8222f8 100644 --- a/x-pack/docs/en/rest-api/ml/get-datafeed-stats.asciidoc +++ b/x-pack/docs/en/rest-api/ml/get-datafeed-stats.asciidoc @@ -5,7 +5,7 @@ Get {dfeed-cap} Statistics ++++ -This API enables you to retrieve usage information for {dfeeds}. +Retrieves usage information for {dfeeds}. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/get-datafeed.asciidoc b/x-pack/docs/en/rest-api/ml/get-datafeed.asciidoc index 8d582ed672a..0fa51773fd1 100644 --- a/x-pack/docs/en/rest-api/ml/get-datafeed.asciidoc +++ b/x-pack/docs/en/rest-api/ml/get-datafeed.asciidoc @@ -5,7 +5,7 @@ Get {dfeeds-cap} ++++ -This API enables you to retrieve configuration information for {dfeeds}. +Retrieves configuration information for {dfeeds}. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/get-influencer.asciidoc b/x-pack/docs/en/rest-api/ml/get-influencer.asciidoc index 6c49e66e944..bffd2b8e096 100644 --- a/x-pack/docs/en/rest-api/ml/get-influencer.asciidoc +++ b/x-pack/docs/en/rest-api/ml/get-influencer.asciidoc @@ -5,7 +5,7 @@ Get Influencers ++++ -This API enables you to retrieve job results for one or more influencers. +Retrieves job results for one or more influencers. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/get-job-stats.asciidoc b/x-pack/docs/en/rest-api/ml/get-job-stats.asciidoc index 48ebac280aa..bd59ee8b258 100644 --- a/x-pack/docs/en/rest-api/ml/get-job-stats.asciidoc +++ b/x-pack/docs/en/rest-api/ml/get-job-stats.asciidoc @@ -5,7 +5,7 @@ Get Job Statistics ++++ -This API enables you to retrieve usage information for jobs. +Retrieves usage information for jobs. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/get-job.asciidoc b/x-pack/docs/en/rest-api/ml/get-job.asciidoc index c606cc5ad40..2e95d8e01bb 100644 --- a/x-pack/docs/en/rest-api/ml/get-job.asciidoc +++ b/x-pack/docs/en/rest-api/ml/get-job.asciidoc @@ -5,7 +5,7 @@ Get Jobs ++++ -This API enables you to retrieve configuration information for jobs. +Retrieves configuration information for jobs. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/get-overall-buckets.asciidoc b/x-pack/docs/en/rest-api/ml/get-overall-buckets.asciidoc index d0e8c1f214b..f2581f4904e 100644 --- a/x-pack/docs/en/rest-api/ml/get-overall-buckets.asciidoc +++ b/x-pack/docs/en/rest-api/ml/get-overall-buckets.asciidoc @@ -5,7 +5,7 @@ Get Overall Buckets ++++ -This API enables you to retrieve overall bucket results that summarize the +Retrieves overall bucket results that summarize the bucket results of multiple jobs. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/get-record.asciidoc b/x-pack/docs/en/rest-api/ml/get-record.asciidoc index 6cd222027e6..1870b441597 100644 --- a/x-pack/docs/en/rest-api/ml/get-record.asciidoc +++ b/x-pack/docs/en/rest-api/ml/get-record.asciidoc @@ -5,7 +5,7 @@ Get Records ++++ -This API enables you to retrieve anomaly records for a job. +Retrieves anomaly records for a job. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/get-snapshot.asciidoc b/x-pack/docs/en/rest-api/ml/get-snapshot.asciidoc index b992f5be7df..24e82af1f19 100644 --- a/x-pack/docs/en/rest-api/ml/get-snapshot.asciidoc +++ b/x-pack/docs/en/rest-api/ml/get-snapshot.asciidoc @@ -5,7 +5,7 @@ Get Model Snapshots ++++ -This API enables you to retrieve information about model snapshots. +Retrieves information about model snapshots. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/open-job.asciidoc b/x-pack/docs/en/rest-api/ml/open-job.asciidoc index 37d201ed226..59d5568ac77 100644 --- a/x-pack/docs/en/rest-api/ml/open-job.asciidoc +++ b/x-pack/docs/en/rest-api/ml/open-job.asciidoc @@ -5,7 +5,7 @@ Open Jobs ++++ -This API enables you to open one or more jobs. +Opens one or more jobs. A job must be opened in order for it to be ready to receive and analyze data. A job can be opened and closed multiple times throughout its lifecycle. diff --git a/x-pack/docs/en/rest-api/ml/post-calendar-event.asciidoc b/x-pack/docs/en/rest-api/ml/post-calendar-event.asciidoc index ab0c1ebef64..41af0841d2e 100644 --- a/x-pack/docs/en/rest-api/ml/post-calendar-event.asciidoc +++ b/x-pack/docs/en/rest-api/ml/post-calendar-event.asciidoc @@ -5,7 +5,7 @@ Add Events to Calendar ++++ -This API enables you to post scheduled events in a calendar. +Posts scheduled events in a calendar. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/post-data.asciidoc b/x-pack/docs/en/rest-api/ml/post-data.asciidoc index ec20be5dadb..40354d7f6f7 100644 --- a/x-pack/docs/en/rest-api/ml/post-data.asciidoc +++ b/x-pack/docs/en/rest-api/ml/post-data.asciidoc @@ -5,7 +5,7 @@ Post Data to Jobs ++++ -This API enables you to send data to an anomaly detection job for analysis. +Sends data to an anomaly detection job for analysis. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/preview-datafeed.asciidoc b/x-pack/docs/en/rest-api/ml/preview-datafeed.asciidoc index 5f3bc5054e3..e6b51f8ef06 100644 --- a/x-pack/docs/en/rest-api/ml/preview-datafeed.asciidoc +++ b/x-pack/docs/en/rest-api/ml/preview-datafeed.asciidoc @@ -5,7 +5,7 @@ Preview {dfeeds-cap} ++++ -This API enables you to preview a {dfeed}. +Previews a {dfeed}. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/put-calendar-job.asciidoc b/x-pack/docs/en/rest-api/ml/put-calendar-job.asciidoc index 5d2c012a919..6940957b159 100644 --- a/x-pack/docs/en/rest-api/ml/put-calendar-job.asciidoc +++ b/x-pack/docs/en/rest-api/ml/put-calendar-job.asciidoc @@ -5,7 +5,7 @@ Add Jobs to Calendar ++++ -This API enables you to add a job to a calendar. +Adds a job to a calendar. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/put-calendar.asciidoc b/x-pack/docs/en/rest-api/ml/put-calendar.asciidoc index 23997906cb7..a82da5a2c0c 100644 --- a/x-pack/docs/en/rest-api/ml/put-calendar.asciidoc +++ b/x-pack/docs/en/rest-api/ml/put-calendar.asciidoc @@ -5,7 +5,7 @@ Create Calendar ++++ -This API enables you to instantiate a calendar. +Instantiates a calendar. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/put-datafeed.asciidoc b/x-pack/docs/en/rest-api/ml/put-datafeed.asciidoc index f1e41cad8b3..6b8ad932a1d 100644 --- a/x-pack/docs/en/rest-api/ml/put-datafeed.asciidoc +++ b/x-pack/docs/en/rest-api/ml/put-datafeed.asciidoc @@ -5,7 +5,7 @@ Create {dfeeds-cap} ++++ -This API enables you to instantiate a {dfeed}. +Instantiates a {dfeed}. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/put-job.asciidoc b/x-pack/docs/en/rest-api/ml/put-job.asciidoc index 62d15acf053..1c436f53d32 100644 --- a/x-pack/docs/en/rest-api/ml/put-job.asciidoc +++ b/x-pack/docs/en/rest-api/ml/put-job.asciidoc @@ -5,7 +5,7 @@ Create Jobs ++++ -This API enables you to instantiate a job. +Instantiates a job. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/revert-snapshot.asciidoc b/x-pack/docs/en/rest-api/ml/revert-snapshot.asciidoc index 72b934a56b7..1dc3046ac4f 100644 --- a/x-pack/docs/en/rest-api/ml/revert-snapshot.asciidoc +++ b/x-pack/docs/en/rest-api/ml/revert-snapshot.asciidoc @@ -5,7 +5,7 @@ Revert Model Snapshots ++++ -This API enables you to revert to a specific snapshot. +Reverts to a specific snapshot. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/start-datafeed.asciidoc b/x-pack/docs/en/rest-api/ml/start-datafeed.asciidoc index 865ca4ae997..fa3ea35a751 100644 --- a/x-pack/docs/en/rest-api/ml/start-datafeed.asciidoc +++ b/x-pack/docs/en/rest-api/ml/start-datafeed.asciidoc @@ -5,7 +5,7 @@ Start {dfeeds-cap} ++++ -This API enables you to start one or more {dfeeds}. +Starts one or more {dfeeds}. A {dfeed} must be started in order to retrieve data from {es}. A {dfeed} can be started and stopped multiple times throughout its lifecycle. diff --git a/x-pack/docs/en/rest-api/ml/stop-datafeed.asciidoc b/x-pack/docs/en/rest-api/ml/stop-datafeed.asciidoc index 3511c9362c3..27872ff5a20 100644 --- a/x-pack/docs/en/rest-api/ml/stop-datafeed.asciidoc +++ b/x-pack/docs/en/rest-api/ml/stop-datafeed.asciidoc @@ -5,7 +5,7 @@ Stop {dfeeds-cap} ++++ -This API enables you to stop one or more {dfeeds}. +Stops one or more {dfeeds}. A {dfeed} that is stopped ceases to retrieve data from {es}. A {dfeed} can be started and stopped multiple times throughout its lifecycle. diff --git a/x-pack/docs/en/rest-api/ml/update-datafeed.asciidoc b/x-pack/docs/en/rest-api/ml/update-datafeed.asciidoc index 277a9ce3177..bc9462347c1 100644 --- a/x-pack/docs/en/rest-api/ml/update-datafeed.asciidoc +++ b/x-pack/docs/en/rest-api/ml/update-datafeed.asciidoc @@ -5,7 +5,7 @@ Update {dfeeds-cap} ++++ -This API enables you to update certain properties of a {dfeed}. +Updates certain properties of a {dfeed}. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/update-job.asciidoc b/x-pack/docs/en/rest-api/ml/update-job.asciidoc index ebb41523de0..23046febc2e 100644 --- a/x-pack/docs/en/rest-api/ml/update-job.asciidoc +++ b/x-pack/docs/en/rest-api/ml/update-job.asciidoc @@ -5,7 +5,7 @@ Update Jobs ++++ -This API enables you to update certain properties of a job. +Updates certain properties of a job. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/update-snapshot.asciidoc b/x-pack/docs/en/rest-api/ml/update-snapshot.asciidoc index 74a684619c4..8c98a7b7321 100644 --- a/x-pack/docs/en/rest-api/ml/update-snapshot.asciidoc +++ b/x-pack/docs/en/rest-api/ml/update-snapshot.asciidoc @@ -5,7 +5,7 @@ Update Model Snapshots ++++ -This API enables you to update certain properties of a snapshot. +Updates certain properties of a snapshot. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/validate-detector.asciidoc b/x-pack/docs/en/rest-api/ml/validate-detector.asciidoc index 6fc5fea6fbb..f688ef91cfe 100644 --- a/x-pack/docs/en/rest-api/ml/validate-detector.asciidoc +++ b/x-pack/docs/en/rest-api/ml/validate-detector.asciidoc @@ -5,7 +5,7 @@ Validate Detectors ++++ -This API validates detector configuration information. +Validates detector configuration information. ==== Request diff --git a/x-pack/docs/en/rest-api/ml/validate-job.asciidoc b/x-pack/docs/en/rest-api/ml/validate-job.asciidoc index b206734bc03..61d0c70514e 100644 --- a/x-pack/docs/en/rest-api/ml/validate-job.asciidoc +++ b/x-pack/docs/en/rest-api/ml/validate-job.asciidoc @@ -5,7 +5,7 @@ Validate Jobs ++++ -This API validates job configuration information. +Validates job configuration information. ==== Request