[Transform] move root endpoint to _transform with BWC layer (#47127) (#47682)

move the main endpoint to /_transform/ from /_data_frame/transforms/ with providing backwards compatibility and deprecation warnings
This commit is contained in:
Hendrik Muhs 2019-10-08 08:59:01 +02:00 committed by GitHub
parent 91988c7c26
commit 5e0e54f455
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
94 changed files with 1580 additions and 276 deletions

View File

@ -48,7 +48,7 @@ final class TransformRequestConverters {
static Request putTransform(PutTransformRequest putRequest) throws IOException { static Request putTransform(PutTransformRequest putRequest) throws IOException {
String endpoint = new RequestConverters.EndpointBuilder() String endpoint = new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_data_frame", "transforms") .addPathPartAsIs("_transform")
.addPathPart(putRequest.getConfig().getId()) .addPathPart(putRequest.getConfig().getId())
.build(); .build();
Request request = new Request(HttpPut.METHOD_NAME, endpoint); Request request = new Request(HttpPut.METHOD_NAME, endpoint);
@ -61,7 +61,7 @@ final class TransformRequestConverters {
static Request updateTransform(UpdateTransformRequest updateDataFrameTransformRequest) throws IOException { static Request updateTransform(UpdateTransformRequest updateDataFrameTransformRequest) throws IOException {
String endpoint = new RequestConverters.EndpointBuilder() String endpoint = new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_data_frame", "transforms") .addPathPartAsIs("_transform")
.addPathPart(updateDataFrameTransformRequest.getId()) .addPathPart(updateDataFrameTransformRequest.getId())
.addPathPart("_update") .addPathPart("_update")
.build(); .build();
@ -75,7 +75,7 @@ final class TransformRequestConverters {
static Request getTransform(GetTransformRequest getRequest) { static Request getTransform(GetTransformRequest getRequest) {
String endpoint = new RequestConverters.EndpointBuilder() String endpoint = new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_data_frame", "transforms") .addPathPartAsIs("_transform")
.addPathPart(Strings.collectionToCommaDelimitedString(getRequest.getId())) .addPathPart(Strings.collectionToCommaDelimitedString(getRequest.getId()))
.build(); .build();
Request request = new Request(HttpGet.METHOD_NAME, endpoint); Request request = new Request(HttpGet.METHOD_NAME, endpoint);
@ -93,7 +93,7 @@ final class TransformRequestConverters {
static Request deleteTransform(DeleteTransformRequest deleteRequest) { static Request deleteTransform(DeleteTransformRequest deleteRequest) {
String endpoint = new RequestConverters.EndpointBuilder() String endpoint = new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_data_frame", "transforms") .addPathPartAsIs("_transform")
.addPathPart(deleteRequest.getId()) .addPathPart(deleteRequest.getId())
.build(); .build();
Request request = new Request(HttpDelete.METHOD_NAME, endpoint); Request request = new Request(HttpDelete.METHOD_NAME, endpoint);
@ -105,7 +105,7 @@ final class TransformRequestConverters {
static Request startTransform(StartTransformRequest startRequest) { static Request startTransform(StartTransformRequest startRequest) {
String endpoint = new RequestConverters.EndpointBuilder() String endpoint = new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_data_frame", "transforms") .addPathPartAsIs("_transform")
.addPathPart(startRequest.getId()) .addPathPart(startRequest.getId())
.addPathPartAsIs("_start") .addPathPartAsIs("_start")
.build(); .build();
@ -120,7 +120,7 @@ final class TransformRequestConverters {
static Request stopTransform(StopTransformRequest stopRequest) { static Request stopTransform(StopTransformRequest stopRequest) {
String endpoint = new RequestConverters.EndpointBuilder() String endpoint = new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_data_frame", "transforms") .addPathPartAsIs("_transform")
.addPathPart(stopRequest.getId()) .addPathPart(stopRequest.getId())
.addPathPartAsIs("_stop") .addPathPartAsIs("_stop")
.build(); .build();
@ -141,7 +141,7 @@ final class TransformRequestConverters {
static Request previewTransform(PreviewTransformRequest previewRequest) throws IOException { static Request previewTransform(PreviewTransformRequest previewRequest) throws IOException {
String endpoint = new RequestConverters.EndpointBuilder() String endpoint = new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_data_frame", "transforms", "_preview") .addPathPartAsIs("_transform", "_preview")
.build(); .build();
Request request = new Request(HttpPost.METHOD_NAME, endpoint); Request request = new Request(HttpPost.METHOD_NAME, endpoint);
request.setEntity(createEntity(previewRequest, REQUEST_BODY_CONTENT_TYPE)); request.setEntity(createEntity(previewRequest, REQUEST_BODY_CONTENT_TYPE));
@ -150,7 +150,7 @@ final class TransformRequestConverters {
static Request getTransformStats(GetTransformStatsRequest statsRequest) { static Request getTransformStats(GetTransformStatsRequest statsRequest) {
String endpoint = new RequestConverters.EndpointBuilder() String endpoint = new RequestConverters.EndpointBuilder()
.addPathPartAsIs("_data_frame", "transforms") .addPathPartAsIs("_transform")
.addPathPart(statsRequest.getId()) .addPathPart(statsRequest.getId())
.addPathPartAsIs("_stats") .addPathPartAsIs("_stats")
.build(); .build();

View File

@ -24,7 +24,6 @@ import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpPut;
import org.elasticsearch.client.core.PageParams; import org.elasticsearch.client.core.PageParams;
import org.elasticsearch.client.transform.TransformNamedXContentProvider;
import org.elasticsearch.client.transform.DeleteTransformRequest; import org.elasticsearch.client.transform.DeleteTransformRequest;
import org.elasticsearch.client.transform.GetTransformRequest; import org.elasticsearch.client.transform.GetTransformRequest;
import org.elasticsearch.client.transform.GetTransformStatsRequest; import org.elasticsearch.client.transform.GetTransformStatsRequest;
@ -32,6 +31,7 @@ import org.elasticsearch.client.transform.PreviewTransformRequest;
import org.elasticsearch.client.transform.PutTransformRequest; import org.elasticsearch.client.transform.PutTransformRequest;
import org.elasticsearch.client.transform.StartTransformRequest; import org.elasticsearch.client.transform.StartTransformRequest;
import org.elasticsearch.client.transform.StopTransformRequest; import org.elasticsearch.client.transform.StopTransformRequest;
import org.elasticsearch.client.transform.TransformNamedXContentProvider;
import org.elasticsearch.client.transform.UpdateTransformRequest; import org.elasticsearch.client.transform.UpdateTransformRequest;
import org.elasticsearch.client.transform.transforms.TransformConfig; import org.elasticsearch.client.transform.transforms.TransformConfig;
import org.elasticsearch.client.transform.transforms.TransformConfigTests; import org.elasticsearch.client.transform.transforms.TransformConfigTests;
@ -56,7 +56,7 @@ import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.hasKey;
import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.not;
public class DataFrameRequestConvertersTests extends ESTestCase { public class TransformRequestConvertersTests extends ESTestCase {
@Override @Override
protected NamedXContentRegistry xContentRegistry() { protected NamedXContentRegistry xContentRegistry() {
@ -72,7 +72,7 @@ public class DataFrameRequestConvertersTests extends ESTestCase {
Request request = TransformRequestConverters.putTransform(putRequest); Request request = TransformRequestConverters.putTransform(putRequest);
assertThat(request.getParameters(), not(hasKey("defer_validation"))); assertThat(request.getParameters(), not(hasKey("defer_validation")));
assertEquals(HttpPut.METHOD_NAME, request.getMethod()); assertEquals(HttpPut.METHOD_NAME, request.getMethod());
assertThat(request.getEndpoint(), equalTo("/_data_frame/transforms/" + putRequest.getConfig().getId())); assertThat(request.getEndpoint(), equalTo("/_transform/" + putRequest.getConfig().getId()));
try (XContentParser parser = createParser(JsonXContent.jsonXContent, request.getEntity().getContent())) { try (XContentParser parser = createParser(JsonXContent.jsonXContent, request.getEntity().getContent())) {
TransformConfig parsedConfig = TransformConfig.PARSER.apply(parser, null); TransformConfig parsedConfig = TransformConfig.PARSER.apply(parser, null);
@ -91,7 +91,7 @@ public class DataFrameRequestConvertersTests extends ESTestCase {
Request request = TransformRequestConverters.updateTransform(updateDataFrameTransformRequest); Request request = TransformRequestConverters.updateTransform(updateDataFrameTransformRequest);
assertThat(request.getParameters(), not(hasKey("defer_validation"))); assertThat(request.getParameters(), not(hasKey("defer_validation")));
assertEquals(HttpPost.METHOD_NAME, request.getMethod()); assertEquals(HttpPost.METHOD_NAME, request.getMethod());
assertThat(request.getEndpoint(), equalTo("/_data_frame/transforms/" + transformId + "/_update")); assertThat(request.getEndpoint(), equalTo("/_transform/" + transformId + "/_update"));
try (XContentParser parser = createParser(JsonXContent.jsonXContent, request.getEntity().getContent())) { try (XContentParser parser = createParser(JsonXContent.jsonXContent, request.getEntity().getContent())) {
TransformConfigUpdate parsedConfig = TransformConfigUpdate.fromXContent(parser); TransformConfigUpdate parsedConfig = TransformConfigUpdate.fromXContent(parser);
@ -108,7 +108,7 @@ public class DataFrameRequestConvertersTests extends ESTestCase {
Request request = TransformRequestConverters.deleteTransform(deleteRequest); Request request = TransformRequestConverters.deleteTransform(deleteRequest);
assertEquals(HttpDelete.METHOD_NAME, request.getMethod()); assertEquals(HttpDelete.METHOD_NAME, request.getMethod());
assertThat(request.getEndpoint(), equalTo("/_data_frame/transforms/foo")); assertThat(request.getEndpoint(), equalTo("/_transform/foo"));
assertThat(request.getParameters(), not(hasKey("force"))); assertThat(request.getParameters(), not(hasKey("force")));
@ -128,7 +128,7 @@ public class DataFrameRequestConvertersTests extends ESTestCase {
Request request = TransformRequestConverters.startTransform(startRequest); Request request = TransformRequestConverters.startTransform(startRequest);
assertEquals(HttpPost.METHOD_NAME, request.getMethod()); assertEquals(HttpPost.METHOD_NAME, request.getMethod());
assertThat(request.getEndpoint(), equalTo("/_data_frame/transforms/" + startRequest.getId() + "/_start")); assertThat(request.getEndpoint(), equalTo("/_transform/" + startRequest.getId() + "/_start"));
if (timeValue != null) { if (timeValue != null) {
assertTrue(request.getParameters().containsKey("timeout")); assertTrue(request.getParameters().containsKey("timeout"));
@ -152,7 +152,7 @@ public class DataFrameRequestConvertersTests extends ESTestCase {
Request request = TransformRequestConverters.stopTransform(stopRequest); Request request = TransformRequestConverters.stopTransform(stopRequest);
assertEquals(HttpPost.METHOD_NAME, request.getMethod()); assertEquals(HttpPost.METHOD_NAME, request.getMethod());
assertThat(request.getEndpoint(), equalTo("/_data_frame/transforms/" + stopRequest.getId() + "/_stop")); assertThat(request.getEndpoint(), equalTo("/_transform/" + stopRequest.getId() + "/_stop"));
if (waitForCompletion != null) { if (waitForCompletion != null) {
assertTrue(request.getParameters().containsKey("wait_for_completion")); assertTrue(request.getParameters().containsKey("wait_for_completion"));
@ -180,7 +180,7 @@ public class DataFrameRequestConvertersTests extends ESTestCase {
Request request = TransformRequestConverters.previewTransform(previewRequest); Request request = TransformRequestConverters.previewTransform(previewRequest);
assertEquals(HttpPost.METHOD_NAME, request.getMethod()); assertEquals(HttpPost.METHOD_NAME, request.getMethod());
assertThat(request.getEndpoint(), equalTo("/_data_frame/transforms/_preview")); assertThat(request.getEndpoint(), equalTo("/_transform/_preview"));
try (XContentParser parser = createParser(JsonXContent.jsonXContent, request.getEntity().getContent())) { try (XContentParser parser = createParser(JsonXContent.jsonXContent, request.getEntity().getContent())) {
TransformConfig parsedConfig = TransformConfig.PARSER.apply(parser, null); TransformConfig parsedConfig = TransformConfig.PARSER.apply(parser, null);
@ -193,7 +193,7 @@ public class DataFrameRequestConvertersTests extends ESTestCase {
Request request = TransformRequestConverters.getTransformStats(getStatsRequest); Request request = TransformRequestConverters.getTransformStats(getStatsRequest);
assertEquals(HttpGet.METHOD_NAME, request.getMethod()); assertEquals(HttpGet.METHOD_NAME, request.getMethod());
assertThat(request.getEndpoint(), equalTo("/_data_frame/transforms/foo/_stats")); assertThat(request.getEndpoint(), equalTo("/_transform/foo/_stats"));
assertFalse(request.getParameters().containsKey("from")); assertFalse(request.getParameters().containsKey("from"));
assertFalse(request.getParameters().containsKey("size")); assertFalse(request.getParameters().containsKey("size"));
@ -223,7 +223,7 @@ public class DataFrameRequestConvertersTests extends ESTestCase {
Request request = TransformRequestConverters.getTransform(getRequest); Request request = TransformRequestConverters.getTransform(getRequest);
assertEquals(HttpGet.METHOD_NAME, request.getMethod()); assertEquals(HttpGet.METHOD_NAME, request.getMethod());
assertThat(request.getEndpoint(), equalTo("/_data_frame/transforms/bar")); assertThat(request.getEndpoint(), equalTo("/_transform/bar"));
assertFalse(request.getParameters().containsKey("from")); assertFalse(request.getParameters().containsKey("from"));
assertFalse(request.getParameters().containsKey("size")); assertFalse(request.getParameters().containsKey("size"));
@ -253,6 +253,6 @@ public class DataFrameRequestConvertersTests extends ESTestCase {
Request request = TransformRequestConverters.getTransform(getRequest); Request request = TransformRequestConverters.getTransform(getRequest);
assertEquals(HttpGet.METHOD_NAME, request.getMethod()); assertEquals(HttpGet.METHOD_NAME, request.getMethod());
assertThat(request.getEndpoint(), equalTo("/_data_frame/transforms/foo,bar,baz")); assertThat(request.getEndpoint(), equalTo("/_transform/foo,bar,baz"));
} }
} }

View File

@ -42,16 +42,16 @@ import org.elasticsearch.client.transform.StopTransformRequest;
import org.elasticsearch.client.transform.StopTransformResponse; import org.elasticsearch.client.transform.StopTransformResponse;
import org.elasticsearch.client.transform.UpdateTransformRequest; import org.elasticsearch.client.transform.UpdateTransformRequest;
import org.elasticsearch.client.transform.UpdateTransformResponse; import org.elasticsearch.client.transform.UpdateTransformResponse;
import org.elasticsearch.client.transform.transforms.TransformIndexerStats;
import org.elasticsearch.client.transform.transforms.TransformConfig;
import org.elasticsearch.client.transform.transforms.TransformConfigUpdate;
import org.elasticsearch.client.transform.transforms.TransformProgress;
import org.elasticsearch.client.transform.transforms.TransformStats;
import org.elasticsearch.client.transform.transforms.DestConfig; import org.elasticsearch.client.transform.transforms.DestConfig;
import org.elasticsearch.client.transform.transforms.NodeAttributes; import org.elasticsearch.client.transform.transforms.NodeAttributes;
import org.elasticsearch.client.transform.transforms.QueryConfig; import org.elasticsearch.client.transform.transforms.QueryConfig;
import org.elasticsearch.client.transform.transforms.SourceConfig; import org.elasticsearch.client.transform.transforms.SourceConfig;
import org.elasticsearch.client.transform.transforms.TimeSyncConfig; import org.elasticsearch.client.transform.transforms.TimeSyncConfig;
import org.elasticsearch.client.transform.transforms.TransformConfig;
import org.elasticsearch.client.transform.transforms.TransformConfigUpdate;
import org.elasticsearch.client.transform.transforms.TransformIndexerStats;
import org.elasticsearch.client.transform.transforms.TransformProgress;
import org.elasticsearch.client.transform.transforms.TransformStats;
import org.elasticsearch.client.transform.transforms.pivot.AggregationConfig; import org.elasticsearch.client.transform.transforms.pivot.AggregationConfig;
import org.elasticsearch.client.transform.transforms.pivot.GroupConfig; import org.elasticsearch.client.transform.transforms.pivot.GroupConfig;
import org.elasticsearch.client.transform.transforms.pivot.PivotConfig; import org.elasticsearch.client.transform.transforms.pivot.PivotConfig;
@ -219,7 +219,7 @@ public class TransformDocumentationIT extends ESRestHighLevelClientTestCase {
} }
} }
public void testUpdateDataFrameTransform() throws IOException, InterruptedException { public void testUpdateTransform() throws IOException, InterruptedException {
createIndex("source-data"); createIndex("source-data");
RestHighLevelClient client = highLevelClient(); RestHighLevelClient client = highLevelClient();

View File

@ -1189,7 +1189,7 @@ buildRestTests.setups['simple_kibana_continuous_pivot'] = buildRestTests.setups[
- do: - do:
raw: raw:
method: PUT method: PUT
path: _data_frame/transforms/simple-kibana-ecomm-pivot path: _transform/simple-kibana-ecomm-pivot
body: > body: >
{ {
"source": { "source": {

View File

@ -6,7 +6,7 @@ All {transform} endpoints have the following base:
[source,js] [source,js]
---- ----
/_data_frame/transforms/ _transform/
---- ----
// NOTCONSOLE // NOTCONSOLE

View File

@ -15,7 +15,7 @@ beta[]
[[delete-transform-request]] [[delete-transform-request]]
==== {api-request-title} ==== {api-request-title}
`DELETE _data_frame/transforms/<transform_id>` `DELETE _transform/<transform_id>`
[[delete-transform-prereqs]] [[delete-transform-prereqs]]
==== {api-prereq-title} ==== {api-prereq-title}
@ -46,7 +46,7 @@ current state. The default value is `false`, meaning that the {transform} must b
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
DELETE _data_frame/transforms/ecommerce_transform DELETE _transform/ecommerce_transform
-------------------------------------------------- --------------------------------------------------
// TEST[skip:setup kibana sample data] // TEST[skip:setup kibana sample data]

View File

@ -16,15 +16,15 @@ beta[]
[[get-transform-stats-request]] [[get-transform-stats-request]]
==== {api-request-title} ==== {api-request-title}
`GET _data_frame/transforms/<transform_id>/_stats` `GET _transform/<transform_id>/_stats`
`GET _data_frame/transforms/<transform_id>,<transform_id>/_stats` + `GET _transform/<transform_id>,<transform_id>/_stats` +
`GET _data_frame/transforms/_stats` + `GET _transform/_stats` +
`GET _data_frame/transforms/_all/_stats` + `GET _transform/_all/_stats` +
`GET _data_frame/transforms/*/_stats` + `GET _transform/*/_stats` +
[[get-transform-stats-prereqs]] [[get-transform-stats-prereqs]]
@ -102,7 +102,7 @@ gets usage information for a maximum of ten results:
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
GET _data_frame/transforms/_stats?from=5&size=10 GET _transform/_stats?from=5&size=10
-------------------------------------------------- --------------------------------------------------
// TEST[skip:todo] // TEST[skip:todo]
@ -111,7 +111,7 @@ The following example gets usage information for the `ecommerce_transform`
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
GET _data_frame/transforms/ecommerce_transform/_stats GET _transform/ecommerce_transform/_stats
-------------------------------------------------- --------------------------------------------------
// TEST[skip:todo] // TEST[skip:todo]

View File

@ -15,15 +15,15 @@ beta[]
[[get-transform-request]] [[get-transform-request]]
==== {api-request-title} ==== {api-request-title}
`GET _data_frame/transforms/<transform_id>` + `GET _transform/<transform_id>` +
`GET _data_frame/transforms/<transform_id>,<transform_id>` + `GET _transform/<transform_id>,<transform_id>` +
`GET _data_frame/transforms/` + `GET _transform/` +
`GET _data_frame/transforms/_all` + `GET _transform/_all` +
`GET _data_frame/transforms/*` `GET _transform/*`
[[get-transform-prereqs]] [[get-transform-prereqs]]
==== {api-prereq-title} ==== {api-prereq-title}
@ -95,7 +95,7 @@ The following example retrieves information about a maximum of ten {transforms}:
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
GET _data_frame/transforms?size=10 GET _transform?size=10
-------------------------------------------------- --------------------------------------------------
// TEST[skip:setup kibana sample data] // TEST[skip:setup kibana sample data]
@ -104,7 +104,7 @@ The following example gets configuration information for the
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
GET _data_frame/transforms/ecommerce_transform GET _transform/ecommerce_transform
-------------------------------------------------- --------------------------------------------------
// TEST[skip:setup kibana sample data] // TEST[skip:setup kibana sample data]

View File

@ -15,7 +15,7 @@ beta[]
[[preview-transform-request]] [[preview-transform-request]]
==== {api-request-title} ==== {api-request-title}
`POST _data_frame/transforms/_preview` `POST _transform/_preview`
[[preview-transform-prereq]] [[preview-transform-prereq]]
==== {api-prereq-title} ==== {api-prereq-title}
@ -68,7 +68,7 @@ on all the current data in the source index.
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
POST _data_frame/transforms/_preview POST _transform/_preview
{ {
"source": { "source": {
"index": "kibana_sample_data_ecommerce" "index": "kibana_sample_data_ecommerce"

View File

@ -15,7 +15,7 @@ beta[]
[[put-transform-request]] [[put-transform-request]]
==== {api-request-title} ==== {api-request-title}
`PUT _data_frame/transforms/<transform_id>` `PUT _transform/<transform_id>`
[[put-transform-prereqs]] [[put-transform-prereqs]]
==== {api-prereq-title} ==== {api-prereq-title}
@ -139,7 +139,7 @@ delays.
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
PUT _data_frame/transforms/ecommerce_transform PUT _transform/ecommerce_transform
{ {
"source": { "source": {
"index": "kibana_sample_data_ecommerce", "index": "kibana_sample_data_ecommerce",

View File

@ -15,7 +15,7 @@ beta[]
[[start-transform-request]] [[start-transform-request]]
==== {api-request-title} ==== {api-request-title}
`POST _data_frame/transforms/<transform_id>/_start` `POST _transform/<transform_id>/_start`
[[start-transform-prereqs]] [[start-transform-prereqs]]
==== {api-prereq-title} ==== {api-prereq-title}
@ -62,7 +62,7 @@ required privileges on the source and destination indices, the
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
POST _data_frame/transforms/ecommerce_transform/_start POST _transform/ecommerce_transform/_start
-------------------------------------------------- --------------------------------------------------
// TEST[skip:set up kibana samples] // TEST[skip:set up kibana samples]

View File

@ -16,11 +16,11 @@ beta[]
[[stop-transform-request]] [[stop-transform-request]]
==== {api-request-title} ==== {api-request-title}
`POST _data_frame/transforms/<transform_id>/_stop` + `POST _transform/<transform_id>/_stop` +
`POST _data_frame/transforms/<transform_id1>,<transform_id2>/_stop` + `POST _transform/<transform_id1>,<transform_id2>/_stop` +
`POST _data_frame/transforms/_all/_stop` `POST _transform/_all/_stop`
[[stop-transform-prereq]] [[stop-transform-prereq]]
@ -104,7 +104,7 @@ are no matches or only partial matches.
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
POST _data_frame/transforms/ecommerce_transform/_stop POST _transform/ecommerce_transform/_stop
-------------------------------------------------- --------------------------------------------------
// TEST[skip:set up kibana samples] // TEST[skip:set up kibana samples]

View File

@ -15,7 +15,7 @@ beta[]
[[update-transform-request]] [[update-transform-request]]
==== {api-request-title} ==== {api-request-title}
`POST _data_frame/transforms/<transform_id>/_update` `POST _transform/<transform_id>/_update`
[[update-transform-prereqs]] [[update-transform-prereqs]]
==== {api-prereq-title} ==== {api-prereq-title}
@ -122,7 +122,7 @@ delays.
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
POST _data_frame/transforms/simple-kibana-ecomm-pivot/_update POST _transform/simple-kibana-ecomm-pivot/_update
{ {
"source": { "source": {
"index": "kibana_sample_data_ecommerce", "index": "kibana_sample_data_ecommerce",

View File

@ -85,7 +85,7 @@ If you prefer, you can use the
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
POST _data_frame/transforms/_preview POST _transform/_preview
{ {
"source": { "source": {
"index": "kibana_sample_data_ecommerce", "index": "kibana_sample_data_ecommerce",
@ -161,7 +161,7 @@ example:
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
PUT _data_frame/transforms/ecommerce-customer-transform PUT _transform/ecommerce-customer-transform
{ {
"source": { "source": {
"index": [ "index": [
@ -237,7 +237,7 @@ example:
[source,console] [source,console]
-------------------------------------------------- --------------------------------------------------
POST _data_frame/transforms/ecommerce-customer-transform/_start POST _transform/ecommerce-customer-transform/_start
-------------------------------------------------- --------------------------------------------------
// TEST[skip:setup kibana sample data] // TEST[skip:setup kibana sample data]

View File

@ -29,7 +29,7 @@ order, and the total amount of ordered products for each customer.
[source,console] [source,console]
---------------------------------- ----------------------------------
POST _data_frame/transforms/_preview POST _transform/_preview
{ {
"source": { "source": {
"index": "kibana_sample_data_ecommerce" "index": "kibana_sample_data_ecommerce"
@ -115,7 +115,7 @@ to determine what percentage of the flight time was actually delay.
[source,console] [source,console]
---------------------------------- ----------------------------------
POST _data_frame/transforms/_preview POST _transform/_preview
{ {
"source": { "source": {
"index": "kibana_sample_data_flights", "index": "kibana_sample_data_flights",
@ -207,7 +207,7 @@ entity is `clientip`.
[source,console] [source,console]
---------------------------------- ----------------------------------
POST _data_frame/transforms/_preview POST _transform/_preview
{ {
"source": { "source": {
"index": "kibana_sample_data_logs", "index": "kibana_sample_data_logs",

View File

@ -120,7 +120,7 @@ viewing the destination index.
[[transform-deletion-limitations]] [[transform-deletion-limitations]]
==== Deleting a {transform} does not delete the destination index or {kib} index pattern ==== Deleting a {transform} does not delete the destination index or {kib} index pattern
When deleting a {transform} using `DELETE _data_frame/transforms/index` When deleting a {transform} using `DELETE _transform/index`
neither the destination index nor the {kib} index pattern, should one have been neither the destination index nor the {kib} index pattern, should one have been
created, are deleted. These objects must be deleted separately. created, are deleted. These objects must be deleted separately.

View File

@ -302,9 +302,9 @@ public class DoSection implements ExecutableSection {
* older master. Rather than rewrite our tests to assert this warning header, we assume that it is expected. * older master. Rather than rewrite our tests to assert this warning header, we assume that it is expected.
*/ */
} else // noinspection StatementWithEmptyBody } else // noinspection StatementWithEmptyBody
if (message.startsWith("[types removal]")) { if (message.startsWith("[types removal]") || message.startsWith("[_data_frame/transforms/] is deprecated")) {
/* /*
* We skip warnings related to types deprecation so that we can continue to run the many * We skip warnings related to types deprecation and transform rename so that we can continue to run the many
* mixed-version tests that used typed APIs. * mixed-version tests that used typed APIs.
*/ */
} else if (expected.remove(message) == false) { } else if (expected.remove(message) == false) {

View File

@ -50,8 +50,9 @@ public class ClusterPrivilegeResolver {
private static final Set<String> MANAGE_TOKEN_PATTERN = Collections.singleton("cluster:admin/xpack/security/token/*"); private static final Set<String> MANAGE_TOKEN_PATTERN = Collections.singleton("cluster:admin/xpack/security/token/*");
private static final Set<String> MANAGE_API_KEY_PATTERN = Collections.singleton("cluster:admin/xpack/security/api_key/*"); private static final Set<String> MANAGE_API_KEY_PATTERN = Collections.singleton("cluster:admin/xpack/security/api_key/*");
private static final Set<String> MONITOR_PATTERN = Collections.singleton("cluster:monitor/*"); private static final Set<String> MONITOR_PATTERN = Collections.singleton("cluster:monitor/*");
private static final Set<String> MONITOR_DATA_FRAME_PATTERN = Collections.unmodifiableSet(
Sets.newHashSet("cluster:monitor/data_frame/*", "cluster:monitor/transform/*"));
private static final Set<String> MONITOR_ML_PATTERN = Collections.singleton("cluster:monitor/xpack/ml/*"); private static final Set<String> MONITOR_ML_PATTERN = Collections.singleton("cluster:monitor/xpack/ml/*");
private static final Set<String> MONITOR_DATA_FRAME_PATTERN = Collections.singleton("cluster:monitor/data_frame/*");
private static final Set<String> MONITOR_WATCHER_PATTERN = Collections.singleton("cluster:monitor/xpack/watcher/*"); private static final Set<String> MONITOR_WATCHER_PATTERN = Collections.singleton("cluster:monitor/xpack/watcher/*");
private static final Set<String> MONITOR_ROLLUP_PATTERN = Collections.singleton("cluster:monitor/xpack/rollup/*"); private static final Set<String> MONITOR_ROLLUP_PATTERN = Collections.singleton("cluster:monitor/xpack/rollup/*");
private static final Set<String> ALL_CLUSTER_PATTERN = Collections.unmodifiableSet( private static final Set<String> ALL_CLUSTER_PATTERN = Collections.unmodifiableSet(
@ -59,7 +60,8 @@ public class ClusterPrivilegeResolver {
private static final Set<String> MANAGE_ML_PATTERN = Collections.unmodifiableSet( private static final Set<String> MANAGE_ML_PATTERN = Collections.unmodifiableSet(
Sets.newHashSet("cluster:admin/xpack/ml/*", "cluster:monitor/xpack/ml/*")); Sets.newHashSet("cluster:admin/xpack/ml/*", "cluster:monitor/xpack/ml/*"));
private static final Set<String> MANAGE_DATA_FRAME_PATTERN = Collections.unmodifiableSet( private static final Set<String> MANAGE_DATA_FRAME_PATTERN = Collections.unmodifiableSet(
Sets.newHashSet("cluster:admin/data_frame/*", "cluster:monitor/data_frame/*")); Sets.newHashSet("cluster:admin/data_frame/*", "cluster:monitor/data_frame/*",
"cluster:monitor/transform/*", "cluster:admin/transform/*"));
private static final Set<String> MANAGE_WATCHER_PATTERN = Collections.unmodifiableSet( private static final Set<String> MANAGE_WATCHER_PATTERN = Collections.unmodifiableSet(
Sets.newHashSet("cluster:admin/xpack/watcher/*", "cluster:monitor/xpack/watcher/*")); Sets.newHashSet("cluster:admin/xpack/watcher/*", "cluster:monitor/xpack/watcher/*"));
private static final Set<String> TRANSPORT_CLIENT_PATTERN = Collections.unmodifiableSet( private static final Set<String> TRANSPORT_CLIENT_PATTERN = Collections.unmodifiableSet(

View File

@ -56,9 +56,13 @@ public final class TransformField {
// common strings // common strings
public static final String TASK_NAME = "data_frame/transforms"; public static final String TASK_NAME = "data_frame/transforms";
public static final String REST_BASE_PATH = "/_data_frame/"; public static final String REST_BASE_PATH_TRANSFORMS = "/_transform/";
public static final String REST_BASE_PATH_TRANSFORMS = REST_BASE_PATH + "transforms/";
public static final String REST_BASE_PATH_TRANSFORMS_BY_ID = REST_BASE_PATH_TRANSFORMS + "{id}/"; public static final String REST_BASE_PATH_TRANSFORMS_BY_ID = REST_BASE_PATH_TRANSFORMS + "{id}/";
// deprecated REST API, to be removed for 8.0.0
public static final String REST_BASE_PATH_TRANSFORMS_DEPRECATED = "/_data_frame/transforms/";
public static final String REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED = REST_BASE_PATH_TRANSFORMS_DEPRECATED + "{id}/";
public static final String TRANSFORM_ID = "transform_id"; public static final String TRANSFORM_ID = "transform_id";
// note: this is used to match tasks // note: this is used to match tasks

View File

@ -31,6 +31,8 @@ public class TransformMessages {
public static final String TRANSFORM_FAILED_TO_PERSIST_STATS = "Failed to persist transform statistics for transform [{0}]"; public static final String TRANSFORM_FAILED_TO_PERSIST_STATS = "Failed to persist transform statistics for transform [{0}]";
public static final String UNKNOWN_TRANSFORM_STATS = "Statistics for transform [{0}] could not be found"; public static final String UNKNOWN_TRANSFORM_STATS = "Statistics for transform [{0}] could not be found";
public static final String REST_DEPRECATED_ENDPOINT = "[_data_frame/transforms/] is deprecated, use [_transform/] in the future.";
public static final String CANNOT_STOP_FAILED_TRANSFORM = public static final String CANNOT_STOP_FAILED_TRANSFORM =
"Unable to stop transform [{0}] as it is in a failed state with reason [{1}]." + "Unable to stop transform [{0}] as it is in a failed state with reason [{1}]." +
" Use force stop to stop the transform."; " Use force stop to stop the transform.";

View File

@ -21,7 +21,7 @@ import java.util.Objects;
public class DeleteTransformAction extends ActionType<AcknowledgedResponse> { public class DeleteTransformAction extends ActionType<AcknowledgedResponse> {
public static final DeleteTransformAction INSTANCE = new DeleteTransformAction(); public static final DeleteTransformAction INSTANCE = new DeleteTransformAction();
public static final String NAME = "cluster:admin/data_frame/delete"; public static final String NAME = "cluster:admin/transform/delete";
private DeleteTransformAction() { private DeleteTransformAction() {
super(NAME, AcknowledgedResponse::new); super(NAME, AcknowledgedResponse::new);

View File

@ -7,8 +7,8 @@
package org.elasticsearch.xpack.core.transform.action; package org.elasticsearch.xpack.core.transform.action;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.common.ParseField; import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.io.stream.Writeable;
@ -31,7 +31,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
public class GetTransformAction extends ActionType<GetTransformAction.Response> { public class GetTransformAction extends ActionType<GetTransformAction.Response> {
public static final GetTransformAction INSTANCE = new GetTransformAction(); public static final GetTransformAction INSTANCE = new GetTransformAction();
public static final String NAME = "cluster:monitor/data_frame/get"; public static final String NAME = "cluster:monitor/transform/get";
private static final DeprecationLogger deprecationLogger = new DeprecationLogger( private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(GetTransformAction.class)); LogManager.getLogger(GetTransformAction.class));

View File

@ -37,7 +37,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
public class GetTransformStatsAction extends ActionType<GetTransformStatsAction.Response> { public class GetTransformStatsAction extends ActionType<GetTransformStatsAction.Response> {
public static final GetTransformStatsAction INSTANCE = new GetTransformStatsAction(); public static final GetTransformStatsAction INSTANCE = new GetTransformStatsAction();
public static final String NAME = "cluster:monitor/data_frame/stats/get"; public static final String NAME = "cluster:monitor/transform/stats/get";
public GetTransformStatsAction() { public GetTransformStatsAction() {
super(NAME, GetTransformStatsAction.Response::new); super(NAME, GetTransformStatsAction.Response::new);
} }

View File

@ -23,8 +23,8 @@ import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.transforms.TransformConfig;
import org.elasticsearch.xpack.core.transform.transforms.DestConfig; import org.elasticsearch.xpack.core.transform.transforms.DestConfig;
import org.elasticsearch.xpack.core.transform.transforms.TransformConfig;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -39,7 +39,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
public class PreviewTransformAction extends ActionType<PreviewTransformAction.Response> { public class PreviewTransformAction extends ActionType<PreviewTransformAction.Response> {
public static final PreviewTransformAction INSTANCE = new PreviewTransformAction(); public static final PreviewTransformAction INSTANCE = new PreviewTransformAction();
public static final String NAME = "cluster:admin/data_frame/preview"; public static final String NAME = "cluster:admin/transform/preview";
private PreviewTransformAction() { private PreviewTransformAction() {
super(NAME, PreviewTransformAction.Response::new); super(NAME, PreviewTransformAction.Response::new);

View File

@ -31,7 +31,7 @@ import static org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.vali
public class PutTransformAction extends ActionType<AcknowledgedResponse> { public class PutTransformAction extends ActionType<AcknowledgedResponse> {
public static final PutTransformAction INSTANCE = new PutTransformAction(); public static final PutTransformAction INSTANCE = new PutTransformAction();
public static final String NAME = "cluster:admin/data_frame/put"; public static final String NAME = "cluster:admin/transform/put";
private static final TimeValue MIN_FREQUENCY = TimeValue.timeValueSeconds(1); private static final TimeValue MIN_FREQUENCY = TimeValue.timeValueSeconds(1);
private static final TimeValue MAX_FREQUENCY = TimeValue.timeValueHours(1); private static final TimeValue MAX_FREQUENCY = TimeValue.timeValueHours(1);

View File

@ -25,7 +25,7 @@ import java.util.Objects;
public class StartTransformAction extends ActionType<StartTransformAction.Response> { public class StartTransformAction extends ActionType<StartTransformAction.Response> {
public static final StartTransformAction INSTANCE = new StartTransformAction(); public static final StartTransformAction INSTANCE = new StartTransformAction();
public static final String NAME = "cluster:admin/data_frame/start"; public static final String NAME = "cluster:admin/transform/start";
private StartTransformAction() { private StartTransformAction() {
super(NAME, StartTransformAction.Response::new); super(NAME, StartTransformAction.Response::new);

View File

@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.transform.action;
import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.TaskOperationFailure; import org.elasticsearch.action.TaskOperationFailure;
import org.elasticsearch.action.support.tasks.BaseTasksRequest; import org.elasticsearch.action.support.tasks.BaseTasksRequest;
import org.elasticsearch.action.support.tasks.BaseTasksResponse; import org.elasticsearch.action.support.tasks.BaseTasksResponse;
@ -35,7 +35,7 @@ import java.util.concurrent.TimeUnit;
public class StopTransformAction extends ActionType<StopTransformAction.Response> { public class StopTransformAction extends ActionType<StopTransformAction.Response> {
public static final StopTransformAction INSTANCE = new StopTransformAction(); public static final StopTransformAction INSTANCE = new StopTransformAction();
public static final String NAME = "cluster:admin/data_frame/stop"; public static final String NAME = "cluster:admin/transform/stop";
public static final TimeValue DEFAULT_TIMEOUT = new TimeValue(30, TimeUnit.SECONDS); public static final TimeValue DEFAULT_TIMEOUT = new TimeValue(30, TimeUnit.SECONDS);

View File

@ -31,7 +31,7 @@ import static org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.vali
public class UpdateTransformAction extends ActionType<UpdateTransformAction.Response> { public class UpdateTransformAction extends ActionType<UpdateTransformAction.Response> {
public static final UpdateTransformAction INSTANCE = new UpdateTransformAction(); public static final UpdateTransformAction INSTANCE = new UpdateTransformAction();
public static final String NAME = "cluster:admin/data_frame/update"; public static final String NAME = "cluster:admin/transform/update";
private static final TimeValue MIN_FREQUENCY = TimeValue.timeValueSeconds(1); private static final TimeValue MIN_FREQUENCY = TimeValue.timeValueSeconds(1);
private static final TimeValue MAX_FREQUENCY = TimeValue.timeValueHours(1); private static final TimeValue MAX_FREQUENCY = TimeValue.timeValueHours(1);

View File

@ -0,0 +1,20 @@
/*
* 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.core.transform.action.compat;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class DeleteTransformActionDeprecated extends ActionType<AcknowledgedResponse> {
public static final DeleteTransformActionDeprecated INSTANCE = new DeleteTransformActionDeprecated();
public static final String NAME = "cluster:admin/data_frame/delete";
private DeleteTransformActionDeprecated() {
super(NAME, AcknowledgedResponse::new);
}
}

View File

@ -0,0 +1,20 @@
/*
* 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.core.transform.action.compat;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.xpack.core.transform.action.GetTransformAction;
public class GetTransformActionDeprecated extends ActionType<GetTransformAction.Response> {
public static final GetTransformActionDeprecated INSTANCE = new GetTransformActionDeprecated();
public static final String NAME = "cluster:monitor/data_frame/get";
private GetTransformActionDeprecated() {
super(NAME, GetTransformAction.Response::new);
}
}

View File

@ -0,0 +1,21 @@
/*
* 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.core.transform.action.compat;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.xpack.core.transform.action.GetTransformStatsAction;
public class GetTransformStatsActionDeprecated extends ActionType<GetTransformStatsAction.Response> {
public static final GetTransformStatsActionDeprecated INSTANCE = new GetTransformStatsActionDeprecated();
public static final String NAME = "cluster:monitor/data_frame/stats/get";
private GetTransformStatsActionDeprecated() {
super(NAME, GetTransformStatsAction.Response::new);
}
}

View File

@ -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.core.transform.action.compat;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.xpack.core.transform.action.PreviewTransformAction;
public class PreviewTransformActionDeprecated extends ActionType<PreviewTransformAction.Response> {
public static final PreviewTransformActionDeprecated INSTANCE = new PreviewTransformActionDeprecated();
public static final String NAME = "cluster:admin/data_frame/preview";
private PreviewTransformActionDeprecated() {
super(NAME, PreviewTransformAction.Response::new);
}
}

View File

@ -0,0 +1,21 @@
/*
* 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.core.transform.action.compat;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class PutTransformActionDeprecated extends ActionType<AcknowledgedResponse> {
public static final PutTransformActionDeprecated INSTANCE = new PutTransformActionDeprecated();
public static final String NAME = "cluster:admin/data_frame/put";
private PutTransformActionDeprecated() {
super(NAME, AcknowledgedResponse::new);
}
}

View File

@ -0,0 +1,21 @@
/*
* 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.core.transform.action.compat;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.xpack.core.transform.action.StartTransformAction;
public class StartTransformActionDeprecated extends ActionType<StartTransformAction.Response> {
public static final StartTransformActionDeprecated INSTANCE = new StartTransformActionDeprecated();
public static final String NAME = "cluster:admin/data_frame/start";
private StartTransformActionDeprecated() {
super(NAME, StartTransformAction.Response::new);
}
}

View File

@ -0,0 +1,21 @@
/*
* 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.core.transform.action.compat;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.xpack.core.transform.action.StopTransformAction;
public class StopTransformActionDeprecated extends ActionType<StopTransformAction.Response> {
public static final StopTransformActionDeprecated INSTANCE = new StopTransformActionDeprecated();
public static final String NAME = "cluster:admin/data_frame/stop";
private StopTransformActionDeprecated() {
super(NAME, StopTransformAction.Response::new);
}
}

View File

@ -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.core.transform.action.compat;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.xpack.core.transform.action.UpdateTransformAction;
import org.elasticsearch.xpack.core.transform.action.UpdateTransformAction.Response;
public class UpdateTransformActionDeprecated extends ActionType<UpdateTransformAction.Response> {
public static final UpdateTransformActionDeprecated INSTANCE = new UpdateTransformActionDeprecated();
public static final String NAME = "cluster:admin/data_frame/update";
private UpdateTransformActionDeprecated() {
super(NAME, Response::new);
}
}

View File

@ -0,0 +1,35 @@
{
"data_frame_transform_deprecated.delete_transform":{
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html"
},
"stability":"beta",
"url":{
"paths":[
{
"path":"/_data_frame/transforms/{transform_id}",
"methods":[
"DELETE"
],
"parts":{
"transform_id":{
"type":"string",
"description":"The id of the transform to delete"
}
},
"deprecated":{
"version":"7.5.0",
"description":"[_data_frame/transforms/] is deprecated, use [_transform/] in the future."
}
}
]
},
"params":{
"force":{
"type":"boolean",
"required":false,
"description":"When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted."
}
}
}
}

View File

@ -0,0 +1,55 @@
{
"data_frame_transform_deprecated.get_transform":{
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html"
},
"stability":"beta",
"url":{
"paths":[
{
"path":"/_data_frame/transforms/{transform_id}",
"methods":[
"GET"
],
"parts":{
"transform_id":{
"type":"string",
"description":"The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms"
}
},
"deprecated":{
"version":"7.5.0",
"description":"[_data_frame/transforms/] is deprecated, use [_transform/] in the future."
}
},
{
"path":"/_data_frame/transforms",
"methods":[
"GET"
],
"deprecated":{
"version":"7.5.0",
"description":"[_data_frame/transforms/] is deprecated, use [_transform/] in the future."
}
}
]
},
"params":{
"from":{
"type":"int",
"required":false,
"description":"skips a number of transform configs, defaults to 0"
},
"size":{
"type":"int",
"required":false,
"description":"specifies a max number of transforms to get, defaults to 100"
},
"allow_no_match":{
"type":"boolean",
"required":false,
"description":"Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)"
}
}
}
}

View File

@ -0,0 +1,45 @@
{
"data_frame_transform_deprecated.get_transform_stats":{
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html"
},
"stability":"beta",
"url":{
"paths":[
{
"path":"/_data_frame/transforms/{transform_id}/_stats",
"methods":[
"GET"
],
"parts":{
"transform_id":{
"type":"string",
"description":"The id of the transform for which to get stats. '_all' or '*' implies all transforms"
}
},
"deprecated":{
"version":"7.5.0",
"description":"[_data_frame/transforms/] is deprecated, use [_transform/] in the future."
}
}
]
},
"params":{
"from":{
"type":"number",
"required":false,
"description":"skips a number of transform stats, defaults to 0"
},
"size":{
"type":"number",
"required":false,
"description":"specifies a max number of transform stats to get, defaults to 100"
},
"allow_no_match":{
"type":"boolean",
"required":false,
"description":"Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)"
}
}
}
}

View File

@ -0,0 +1,26 @@
{
"data_frame_transform_deprecated.preview_transform":{
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html"
},
"stability":"beta",
"url":{
"paths":[
{
"path":"/_data_frame/transforms/_preview",
"methods":[
"POST"
],
"deprecated":{
"version":"7.5.0",
"description":"[_data_frame/transforms/] is deprecated, use [_transform/] in the future."
}
}
]
},
"body":{
"description":"The definition for the transform to preview",
"required":true
}
}
}

View File

@ -0,0 +1,39 @@
{
"data_frame_transform_deprecated.put_transform":{
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html"
},
"stability":"beta",
"url":{
"paths":[
{
"path":"/_data_frame/transforms/{transform_id}",
"methods":[
"PUT"
],
"parts":{
"transform_id":{
"type":"string",
"description":"The id of the new transform."
}
},
"deprecated":{
"version":"7.5.0",
"description":"[_data_frame/transforms/] is deprecated, use [_transform/] in the future."
}
}
]
},
"params": {
"defer_validation": {
"type": "boolean",
"required": false,
"description": "If validations should be deferred until transform starts, defaults to false."
}
},
"body":{
"description":"The transform definition",
"required":true
}
}
}

View File

@ -0,0 +1,35 @@
{
"data_frame_transform_deprecated.start_transform":{
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html"
},
"stability":"beta",
"url":{
"paths":[
{
"path":"/_data_frame/transforms/{transform_id}/_start",
"methods":[
"POST"
],
"parts":{
"transform_id":{
"type":"string",
"description":"The id of the transform to start"
}
},
"deprecated":{
"version":"7.5.0",
"description":"[_data_frame/transforms/] is deprecated, use [_transform/] in the future."
}
}
]
},
"params":{
"timeout":{
"type":"time",
"required":false,
"description":"Controls the time to wait for the transform to start"
}
}
}
}

View File

@ -0,0 +1,45 @@
{
"data_frame_transform_deprecated.stop_transform":{
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html"
},
"stability":"beta",
"url":{
"paths":[
{
"path":"/_data_frame/transforms/{transform_id}/_stop",
"methods":[
"POST"
],
"parts":{
"transform_id":{
"type":"string",
"description":"The id of the transform to stop"
}
},
"deprecated":{
"version":"7.5.0",
"description":"[_data_frame/transforms/] is deprecated, use [_transform/] in the future."
}
}
]
},
"params":{
"wait_for_completion":{
"type":"boolean",
"required":false,
"description":"Whether to wait for the transform to fully stop before returning or not. Default to false"
},
"timeout":{
"type":"time",
"required":false,
"description":"Controls the time to wait until the transform has stopped. Default to 30 seconds"
},
"allow_no_match":{
"type":"boolean",
"required":false,
"description":"Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)"
}
}
}
}

View File

@ -0,0 +1,38 @@
{
"data_frame_transform_deprecated.update_transform": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html"
},
"stability": "beta",
"url": {
"paths": [
{
"path": "/_data_frame/transforms/{transform_id}/_update",
"methods": [ "POST" ],
"parts": {
"transform_id": {
"type": "string",
"required": true,
"description": "The id of the transform."
}
},
"deprecated":{
"version":"7.5.0",
"description":"[_data_frame/transforms/] is deprecated, use [_transform/] in the future."
}
}
]
},
"params": {
"defer_validation": {
"type": "boolean",
"required": false,
"description": "If validations should be deferred until transform starts, defaults to false."
}
},
"body": {
"description" : "The update transform definition",
"required": true
}
}
}

View File

@ -7,7 +7,7 @@
"url":{ "url":{
"paths":[ "paths":[
{ {
"path":"/_data_frame/transforms/{transform_id}", "path":"/_transform/{transform_id}",
"methods":[ "methods":[
"DELETE" "DELETE"
], ],

View File

@ -7,7 +7,7 @@
"url":{ "url":{
"paths":[ "paths":[
{ {
"path":"/_data_frame/transforms/{transform_id}", "path":"/_transform/{transform_id}",
"methods":[ "methods":[
"GET" "GET"
], ],
@ -19,7 +19,7 @@
} }
}, },
{ {
"path":"/_data_frame/transforms", "path":"/_transform",
"methods":[ "methods":[
"GET" "GET"
] ]

View File

@ -7,7 +7,7 @@
"url":{ "url":{
"paths":[ "paths":[
{ {
"path":"/_data_frame/transforms/{transform_id}/_stats", "path":"/_transform/{transform_id}/_stats",
"methods":[ "methods":[
"GET" "GET"
], ],

View File

@ -7,7 +7,7 @@
"url":{ "url":{
"paths":[ "paths":[
{ {
"path":"/_data_frame/transforms/_preview", "path":"/_transform/_preview",
"methods":[ "methods":[
"POST" "POST"
] ]

View File

@ -7,7 +7,7 @@
"url":{ "url":{
"paths":[ "paths":[
{ {
"path":"/_data_frame/transforms/{transform_id}", "path":"/_transform/{transform_id}",
"methods":[ "methods":[
"PUT" "PUT"
], ],

View File

@ -7,7 +7,7 @@
"url":{ "url":{
"paths":[ "paths":[
{ {
"path":"/_data_frame/transforms/{transform_id}/_start", "path":"/_transform/{transform_id}/_start",
"methods":[ "methods":[
"POST" "POST"
], ],

View File

@ -7,7 +7,7 @@
"url":{ "url":{
"paths":[ "paths":[
{ {
"path":"/_data_frame/transforms/{transform_id}/_stop", "path":"/_transform/{transform_id}/_stop",
"methods":[ "methods":[
"POST" "POST"
], ],

View File

@ -7,7 +7,7 @@
"url": { "url": {
"paths": [ "paths": [
{ {
"path": "/_data_frame/transforms/{transform_id}/_update", "path": "/_transform/{transform_id}/_update",
"methods": [ "POST" ], "methods": [ "POST" ],
"parts": { "parts": {
"transform_id": { "transform_id": {

View File

@ -50,7 +50,7 @@ public class TransformConfigurationIndexIT extends TransformRestTestCase {
// refresh the index // refresh the index
assertOK(client().performRequest(new Request("POST", TransformInternalIndexConstants.LATEST_INDEX_NAME + "/_refresh"))); assertOK(client().performRequest(new Request("POST", TransformInternalIndexConstants.LATEST_INDEX_NAME + "/_refresh")));
Request deleteRequest = new Request("DELETE", TRANSFORM_ENDPOINT + fakeTransformName); Request deleteRequest = new Request("DELETE", getTransformEndpoint() + fakeTransformName);
Response deleteResponse = client().performRequest(deleteRequest); Response deleteResponse = client().performRequest(deleteRequest);
assertOK(deleteResponse); assertOK(deleteResponse);
assertTrue((boolean)XContentMapValues.extractValue("acknowledged", entityAsMap(deleteResponse))); assertTrue((boolean)XContentMapValues.extractValue("acknowledged", entityAsMap(deleteResponse)));

View File

@ -78,19 +78,19 @@ public class TransformGetAndGetStatsIT extends TransformRestTestCase {
String authHeader = randomFrom(BASIC_AUTH_VALUE_TRANSFORM_USER, BASIC_AUTH_VALUE_TRANSFORM_ADMIN); String authHeader = randomFrom(BASIC_AUTH_VALUE_TRANSFORM_USER, BASIC_AUTH_VALUE_TRANSFORM_ADMIN);
// check all the different ways to retrieve all stats // check all the different ways to retrieve all stats
Request getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + "_stats", authHeader); Request getRequest = createRequestWithAuth("GET", getTransformEndpoint() + "_stats", authHeader);
Map<String, Object> stats = entityAsMap(client().performRequest(getRequest)); Map<String, Object> stats = entityAsMap(client().performRequest(getRequest));
assertEquals(3, XContentMapValues.extractValue("count", stats)); assertEquals(3, XContentMapValues.extractValue("count", stats));
getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + "_all/_stats", authHeader); getRequest = createRequestWithAuth("GET", getTransformEndpoint() + "_all/_stats", authHeader);
stats = entityAsMap(client().performRequest(getRequest)); stats = entityAsMap(client().performRequest(getRequest));
assertEquals(3, XContentMapValues.extractValue("count", stats)); assertEquals(3, XContentMapValues.extractValue("count", stats));
getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + "*/_stats", authHeader); getRequest = createRequestWithAuth("GET", getTransformEndpoint() + "*/_stats", authHeader);
stats = entityAsMap(client().performRequest(getRequest)); stats = entityAsMap(client().performRequest(getRequest));
assertEquals(3, XContentMapValues.extractValue("count", stats)); assertEquals(3, XContentMapValues.extractValue("count", stats));
getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + "pivot_1,pivot_2/_stats", authHeader); getRequest = createRequestWithAuth("GET", getTransformEndpoint() + "pivot_1,pivot_2/_stats", authHeader);
stats = entityAsMap(client().performRequest(getRequest)); stats = entityAsMap(client().performRequest(getRequest));
assertEquals(2, XContentMapValues.extractValue("count", stats)); assertEquals(2, XContentMapValues.extractValue("count", stats));
getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + "pivot_*/_stats", authHeader); getRequest = createRequestWithAuth("GET", getTransformEndpoint() + "pivot_*/_stats", authHeader);
stats = entityAsMap(client().performRequest(getRequest)); stats = entityAsMap(client().performRequest(getRequest));
assertEquals(3, XContentMapValues.extractValue("count", stats)); assertEquals(3, XContentMapValues.extractValue("count", stats));
@ -111,7 +111,7 @@ public class TransformGetAndGetStatsIT extends TransformRestTestCase {
} }
// only pivot_1 // only pivot_1
getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + "pivot_1/_stats", authHeader); getRequest = createRequestWithAuth("GET", getTransformEndpoint() + "pivot_1/_stats", authHeader);
stats = entityAsMap(client().performRequest(getRequest)); stats = entityAsMap(client().performRequest(getRequest));
assertEquals(1, XContentMapValues.extractValue("count", stats)); assertEquals(1, XContentMapValues.extractValue("count", stats));
@ -122,7 +122,7 @@ public class TransformGetAndGetStatsIT extends TransformRestTestCase {
assertEquals(1, XContentMapValues.extractValue("checkpointing.last.checkpoint", transformsStats.get(0))); assertEquals(1, XContentMapValues.extractValue("checkpointing.last.checkpoint", transformsStats.get(0)));
// only continuous // only continuous
getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + "pivot_continuous/_stats", authHeader); getRequest = createRequestWithAuth("GET", getTransformEndpoint() + "pivot_continuous/_stats", authHeader);
stats = entityAsMap(client().performRequest(getRequest)); stats = entityAsMap(client().performRequest(getRequest));
assertEquals(1, XContentMapValues.extractValue("count", stats)); assertEquals(1, XContentMapValues.extractValue("count", stats));
@ -133,18 +133,18 @@ public class TransformGetAndGetStatsIT extends TransformRestTestCase {
// check all the different ways to retrieve all transforms // check all the different ways to retrieve all transforms
getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT, authHeader); getRequest = createRequestWithAuth("GET", getTransformEndpoint(), authHeader);
Map<String, Object> transforms = entityAsMap(client().performRequest(getRequest)); Map<String, Object> transforms = entityAsMap(client().performRequest(getRequest));
assertEquals(3, XContentMapValues.extractValue("count", transforms)); assertEquals(3, XContentMapValues.extractValue("count", transforms));
getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + "_all", authHeader); getRequest = createRequestWithAuth("GET", getTransformEndpoint() + "_all", authHeader);
transforms = entityAsMap(client().performRequest(getRequest)); transforms = entityAsMap(client().performRequest(getRequest));
assertEquals(3, XContentMapValues.extractValue("count", transforms)); assertEquals(3, XContentMapValues.extractValue("count", transforms));
getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + "*", authHeader); getRequest = createRequestWithAuth("GET", getTransformEndpoint() + "*", authHeader);
transforms = entityAsMap(client().performRequest(getRequest)); transforms = entityAsMap(client().performRequest(getRequest));
assertEquals(3, XContentMapValues.extractValue("count", transforms)); assertEquals(3, XContentMapValues.extractValue("count", transforms));
// only pivot_1 // only pivot_1
getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + "pivot_1", authHeader); getRequest = createRequestWithAuth("GET", getTransformEndpoint() + "pivot_1", authHeader);
transforms = entityAsMap(client().performRequest(getRequest)); transforms = entityAsMap(client().performRequest(getRequest));
assertEquals(1, XContentMapValues.extractValue("count", transforms)); assertEquals(1, XContentMapValues.extractValue("count", transforms));
@ -168,7 +168,7 @@ public class TransformGetAndGetStatsIT extends TransformRestTestCase {
createPivotReviewsTransform("pivot_stats_2", "pivot_reviews_stats_2", null); createPivotReviewsTransform("pivot_stats_2", "pivot_reviews_stats_2", null);
startAndWaitForTransform("pivot_stats_2", "pivot_reviews_stats_2"); startAndWaitForTransform("pivot_stats_2", "pivot_reviews_stats_2");
Request getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + "_stats", BASIC_AUTH_VALUE_TRANSFORM_ADMIN); Request getRequest = createRequestWithAuth("GET", getTransformEndpoint() + "_stats", BASIC_AUTH_VALUE_TRANSFORM_ADMIN);
Map<String, Object> stats = entityAsMap(client().performRequest(getRequest)); Map<String, Object> stats = entityAsMap(client().performRequest(getRequest));
assertEquals(2, XContentMapValues.extractValue("count", stats)); assertEquals(2, XContentMapValues.extractValue("count", stats));
List<Map<String, Object>> transformsStats = (List<Map<String, Object>>)XContentMapValues.extractValue("transforms", stats); List<Map<String, Object>> transformsStats = (List<Map<String, Object>>)XContentMapValues.extractValue("transforms", stats);
@ -192,7 +192,7 @@ public class TransformGetAndGetStatsIT extends TransformRestTestCase {
// Alternate testing between admin and lowly user, as both should be able to get the configs and stats // Alternate testing between admin and lowly user, as both should be able to get the configs and stats
String authHeader = randomFrom(BASIC_AUTH_VALUE_TRANSFORM_USER, BASIC_AUTH_VALUE_TRANSFORM_ADMIN); String authHeader = randomFrom(BASIC_AUTH_VALUE_TRANSFORM_USER, BASIC_AUTH_VALUE_TRANSFORM_ADMIN);
Request getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + transformId + "/_stats", authHeader); Request getRequest = createRequestWithAuth("GET", getTransformEndpoint() + transformId + "/_stats", authHeader);
Map<String, Object> stats = entityAsMap(client().performRequest(getRequest)); Map<String, Object> stats = entityAsMap(client().performRequest(getRequest));
assertEquals(1, XContentMapValues.extractValue("count", stats)); assertEquals(1, XContentMapValues.extractValue("count", stats));
List<Map<String, Object>> transformsStats = (List<Map<String, Object>>)XContentMapValues.extractValue("transforms", stats); List<Map<String, Object>> transformsStats = (List<Map<String, Object>>)XContentMapValues.extractValue("transforms", stats);
@ -218,7 +218,7 @@ public class TransformGetAndGetStatsIT extends TransformRestTestCase {
String transformDest = transformId + "_idx"; String transformDest = transformId + "_idx";
String transformSrc = "reviews_cont_pivot_test"; String transformSrc = "reviews_cont_pivot_test";
createReviewsIndex(transformSrc); createReviewsIndex(transformSrc);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, null); final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId, null);
String config = "{ \"dest\": {\"index\":\"" + transformDest + "\"}," String config = "{ \"dest\": {\"index\":\"" + transformDest + "\"},"
+ " \"source\": {\"index\":\"" + transformSrc + "\"}," + " \"source\": {\"index\":\"" + transformSrc + "\"},"
+ " \"frequency\": \"1s\"," + " \"frequency\": \"1s\","
@ -242,7 +242,7 @@ public class TransformGetAndGetStatsIT extends TransformRestTestCase {
assertThat(createTransformResponse.get("acknowledged"), equalTo(Boolean.TRUE)); assertThat(createTransformResponse.get("acknowledged"), equalTo(Boolean.TRUE));
startAndWaitForContinuousTransform(transformId, transformDest, null); startAndWaitForContinuousTransform(transformId, transformDest, null);
Request getRequest = createRequestWithAuth("GET", TRANSFORM_ENDPOINT + transformId + "/_stats", null); Request getRequest = createRequestWithAuth("GET", getTransformEndpoint() + transformId + "/_stats", null);
Map<String, Object> stats = entityAsMap(client().performRequest(getRequest)); Map<String, Object> stats = entityAsMap(client().performRequest(getRequest));
List<Map<String, Object>> transformsStats = (List<Map<String, Object>>)XContentMapValues.extractValue("transforms", stats); List<Map<String, Object>> transformsStats = (List<Map<String, Object>>)XContentMapValues.extractValue("transforms", stats);
assertEquals(1, transformsStats.size()); assertEquals(1, transformsStats.size());

View File

@ -12,12 +12,6 @@ import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.action.support.WriteRequest;
import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.search.SearchModule;
import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.transforms.TransformConfig;
import org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants;
import org.elasticsearch.client.indices.CreateIndexRequest; import org.elasticsearch.client.indices.CreateIndexRequest;
import org.elasticsearch.client.transform.GetTransformRequest; import org.elasticsearch.client.transform.GetTransformRequest;
import org.elasticsearch.client.transform.GetTransformResponse; import org.elasticsearch.client.transform.GetTransformResponse;
@ -26,17 +20,23 @@ import org.elasticsearch.client.transform.UpdateTransformResponse;
import org.elasticsearch.client.transform.transforms.TransformConfigUpdate; import org.elasticsearch.client.transform.transforms.TransformConfigUpdate;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.search.SearchModule;
import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.ESRestTestCase;
import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.transforms.TransformConfig;
import org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Base64; import java.util.Base64;
import java.util.Collections; import java.util.Collections;
import static org.hamcrest.Matchers.is;
import static org.elasticsearch.xpack.transform.persistence.TransformInternalIndex.addTransformsConfigMappings; import static org.elasticsearch.xpack.transform.persistence.TransformInternalIndex.addTransformsConfigMappings;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
public class TransformInternalIndexIT extends ESRestTestCase { public class TransformInternalIndexIT extends ESRestTestCase {

View File

@ -134,7 +134,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
String transformId = "simple_bucket_selector_pivot"; String transformId = "simple_bucket_selector_pivot";
String transformIndex = "bucket_selector_idx"; String transformIndex = "bucket_selector_idx";
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId,
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
+ " \"source\": {\"index\":\"" + REVIEWS_INDEX_NAME + "\"}," + " \"source\": {\"index\":\"" + REVIEWS_INDEX_NAME + "\"},"
@ -179,7 +179,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
String transformId = "simple_continuous_pivot"; String transformId = "simple_continuous_pivot";
String transformIndex = "pivot_reviews_continuous"; String transformIndex = "pivot_reviews_continuous";
setupDataAccessRole(DATA_ACCESS_ROLE, indexName, transformIndex); setupDataAccessRole(DATA_ACCESS_ROLE, indexName, transformIndex);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId,
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
+ " \"source\": {\"index\":\"" + indexName + "\"}," + " \"source\": {\"index\":\"" + indexName + "\"},"
@ -293,7 +293,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
String transformIndex = "pivot_reviews_via_histogram"; String transformIndex = "pivot_reviews_via_histogram";
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId,
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
@ -331,7 +331,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
String transformIndex = "bigger_pivot_reviews"; String transformIndex = "bigger_pivot_reviews";
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId,
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
@ -406,7 +406,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
String transformIndex = "pivot_reviews_via_date_histogram"; String transformIndex = "pivot_reviews_via_date_histogram";
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId,
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
@ -442,7 +442,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void testPreviewTransform() throws Exception { public void testPreviewTransform() throws Exception {
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME);
final Request createPreviewRequest = createRequestWithAuth("POST", TRANSFORM_ENDPOINT + "_preview", final Request createPreviewRequest = createRequestWithAuth("POST", getTransformEndpoint() + "_preview",
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
@ -494,7 +494,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
client().performRequest(pipelineRequest); client().performRequest(pipelineRequest);
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME);
final Request createPreviewRequest = createRequestWithAuth("POST", TRANSFORM_ENDPOINT + "_preview", null); final Request createPreviewRequest = createRequestWithAuth("POST", getTransformEndpoint() + "_preview", null);
String config = "{ \"source\": {\"index\":\"" + REVIEWS_INDEX_NAME + "\"} ," String config = "{ \"source\": {\"index\":\"" + REVIEWS_INDEX_NAME + "\"} ,"
+ "\"dest\": {\"pipeline\": \"" + pipelineId + "\"}," + "\"dest\": {\"pipeline\": \"" + pipelineId + "\"},"
@ -531,7 +531,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
String transformIndex = "pivot_reviews_via_date_histogram_with_max_time"; String transformIndex = "pivot_reviews_via_date_histogram_with_max_time";
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId,
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
@ -578,7 +578,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
String transformIndex = "scripted_metric_pivot_reviews"; String transformIndex = "scripted_metric_pivot_reviews";
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId,
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
@ -631,7 +631,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
String transformIndex = "bucket_script_pivot_reviews"; String transformIndex = "bucket_script_pivot_reviews";
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId,
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
@ -683,7 +683,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
String transformIndex = "geo_bounds_pivot_reviews"; String transformIndex = "geo_bounds_pivot_reviews";
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId,
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
@ -736,7 +736,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
String transformIndex = "geo_centroid_pivot_reviews"; String transformIndex = "geo_centroid_pivot_reviews";
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId,
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
@ -786,7 +786,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
String transformIndex = "weighted_avg_pivot_reviews"; String transformIndex = "weighted_avg_pivot_reviews";
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId,
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
@ -824,7 +824,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
String transformId = "test_with_many_buckets"; String transformId = "test_with_many_buckets";
String transformIndex = transformId + "-idx"; String transformIndex = transformId + "-idx";
setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex); setupDataAccessRole(DATA_ACCESS_ROLE, REVIEWS_INDEX_NAME, transformIndex);
final Request createTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, final Request createTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId,
BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
String config = "{" String config = "{"
@ -853,7 +853,7 @@ public class TransformPivotRestIT extends TransformRestTestCase {
startAndWaitForTransform(transformId, transformIndex, BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); startAndWaitForTransform(transformId, transformIndex, BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS);
assertTrue(indexExists(transformIndex)); assertTrue(indexExists(transformIndex));
Map<String, Object> stats = getAsMap(TRANSFORM_ENDPOINT + transformId + "/_stats"); Map<String, Object> stats = getAsMap(getTransformEndpoint() + transformId + "/_stats");
assertEquals(101, ((List<?>)XContentMapValues.extractValue("transforms.stats.pages_processed", stats)).get(0)); assertEquals(101, ((List<?>)XContentMapValues.extractValue("transforms.stats.pages_processed", stats)).get(0));
} }

View File

@ -6,12 +6,15 @@
package org.elasticsearch.xpack.transform.integration; package org.elasticsearch.xpack.transform.integration;
import org.apache.http.HttpHost;
import org.apache.http.entity.ContentType; import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity; import org.apache.http.entity.StringEntity;
import org.elasticsearch.client.Request; import org.elasticsearch.client.Request;
import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.Response; import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException; import org.elasticsearch.client.ResponseException;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.SecureString;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
@ -23,6 +26,7 @@ import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants; import org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants;
import org.junit.After; import org.junit.After;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.BeforeClass;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
@ -44,13 +48,30 @@ public abstract class TransformRestTestCase extends ESRestTestCase {
protected static final String REVIEWS_INDEX_NAME = "reviews"; protected static final String REVIEWS_INDEX_NAME = "reviews";
protected static final String TRANSFORM_ENDPOINT = TransformField.REST_BASE_PATH + "transforms/"; private static boolean useDeprecatedEndpoints;
@BeforeClass
public static void init() {
// randomly return the old or the new endpoints, old endpoints to be removed for 8.0.0
useDeprecatedEndpoints = randomBoolean();
}
@Override @Override
protected Settings restClientSettings() { protected Settings restClientSettings() {
return Settings.builder().put(ThreadContext.PREFIX + ".Authorization", BASIC_AUTH_VALUE_SUPER_USER).build(); return Settings.builder().put(ThreadContext.PREFIX + ".Authorization", BASIC_AUTH_VALUE_SUPER_USER).build();
} }
@Override
protected RestClient buildClient(Settings settings, HttpHost[] hosts) throws IOException {
if (useDeprecatedEndpoints) {
RestClientBuilder builder = RestClient.builder(hosts);
configureClient(builder, settings);
builder.setStrictDeprecationMode(false);
return builder.build();
}
return super.buildClient(settings, hosts);
}
protected void createReviewsIndex(String indexName, int numDocs) throws IOException { protected void createReviewsIndex(String indexName, int numDocs) throws IOException {
int[] distributionTable = {5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 3, 3, 2, 1, 1, 1}; int[] distributionTable = {5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 3, 3, 2, 1, 1, 1};
@ -159,7 +180,7 @@ public abstract class TransformRestTestCase extends ESRestTestCase {
protected void createContinuousPivotReviewsTransform(String transformId, String dataFrameIndex, String authHeader) throws IOException { protected void createContinuousPivotReviewsTransform(String transformId, String dataFrameIndex, String authHeader) throws IOException {
final Request createDataframeTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, authHeader); final Request createDataframeTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId, authHeader);
String config = "{ \"dest\": {\"index\":\"" + dataFrameIndex + "\"}," String config = "{ \"dest\": {\"index\":\"" + dataFrameIndex + "\"},"
+ " \"source\": {\"index\":\"" + REVIEWS_INDEX_NAME + "\"}," + " \"source\": {\"index\":\"" + REVIEWS_INDEX_NAME + "\"},"
@ -188,7 +209,7 @@ public abstract class TransformRestTestCase extends ESRestTestCase {
protected void createPivotReviewsTransform(String transformId, String dataFrameIndex, String query, String pipeline, String authHeader) protected void createPivotReviewsTransform(String transformId, String dataFrameIndex, String query, String pipeline, String authHeader)
throws IOException { throws IOException {
final Request createDataframeTransformRequest = createRequestWithAuth("PUT", TRANSFORM_ENDPOINT + transformId, authHeader); final Request createDataframeTransformRequest = createRequestWithAuth("PUT", getTransformEndpoint() + transformId, authHeader);
String config = "{"; String config = "{";
@ -230,7 +251,7 @@ public abstract class TransformRestTestCase extends ESRestTestCase {
protected void startDataframeTransform(String transformId, String authHeader, String... warnings) throws IOException { protected void startDataframeTransform(String transformId, String authHeader, String... warnings) throws IOException {
// start the transform // start the transform
final Request startTransformRequest = createRequestWithAuth("POST", TRANSFORM_ENDPOINT + transformId + "/_start", authHeader); final Request startTransformRequest = createRequestWithAuth("POST", getTransformEndpoint() + transformId + "/_start", authHeader);
if (warnings.length > 0) { if (warnings.length > 0) {
startTransformRequest.setOptions(expectWarnings(warnings)); startTransformRequest.setOptions(expectWarnings(warnings));
} }
@ -240,7 +261,7 @@ public abstract class TransformRestTestCase extends ESRestTestCase {
protected void stopTransform(String transformId, boolean force) throws Exception { protected void stopTransform(String transformId, boolean force) throws Exception {
// start the transform // start the transform
final Request stopTransformRequest = createRequestWithAuth("POST", TRANSFORM_ENDPOINT + transformId + "/_stop", null); final Request stopTransformRequest = createRequestWithAuth("POST", getTransformEndpoint() + transformId + "/_stop", null);
stopTransformRequest.addParameter(TransformField.FORCE.getPreferredName(), Boolean.toString(force)); stopTransformRequest.addParameter(TransformField.FORCE.getPreferredName(), Boolean.toString(force));
stopTransformRequest.addParameter(TransformField.WAIT_FOR_COMPLETION.getPreferredName(), Boolean.toString(true)); stopTransformRequest.addParameter(TransformField.WAIT_FOR_COMPLETION.getPreferredName(), Boolean.toString(true));
Map<String, Object> stopTransformResponse = entityAsMap(client().performRequest(stopTransformRequest)); Map<String, Object> stopTransformResponse = entityAsMap(client().performRequest(stopTransformRequest));
@ -317,7 +338,7 @@ public abstract class TransformRestTestCase extends ESRestTestCase {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private static List<Map<String, Object>> getDataFrameTransforms() throws IOException { private static List<Map<String, Object>> getDataFrameTransforms() throws IOException {
Response response = adminClient().performRequest(new Request("GET", TRANSFORM_ENDPOINT + "_all")); Response response = adminClient().performRequest(new Request("GET", getTransformEndpoint() + "_all"));
Map<String, Object> transforms = entityAsMap(response); Map<String, Object> transforms = entityAsMap(response);
List<Map<String, Object>> transformConfigs = (List<Map<String, Object>>) XContentMapValues.extractValue("transforms", transforms); List<Map<String, Object>> transformConfigs = (List<Map<String, Object>>) XContentMapValues.extractValue("transforms", transforms);
@ -330,7 +351,7 @@ public abstract class TransformRestTestCase extends ESRestTestCase {
} }
protected static Map<?, ?> getDataFrameState(String transformId) throws IOException { protected static Map<?, ?> getDataFrameState(String transformId) throws IOException {
Response statsResponse = client().performRequest(new Request("GET", TRANSFORM_ENDPOINT + transformId + "/_stats")); Response statsResponse = client().performRequest(new Request("GET", getTransformEndpoint() + transformId + "/_stats"));
List<?> transforms = ((List<?>) entityAsMap(statsResponse).get("transforms")); List<?> transforms = ((List<?>) entityAsMap(statsResponse).get("transforms"));
if (transforms.isEmpty()) { if (transforms.isEmpty()) {
return null; return null;
@ -339,7 +360,7 @@ public abstract class TransformRestTestCase extends ESRestTestCase {
} }
protected static void deleteTransform(String transformId) throws IOException { protected static void deleteTransform(String transformId) throws IOException {
Request request = new Request("DELETE", TRANSFORM_ENDPOINT + transformId); Request request = new Request("DELETE", getTransformEndpoint() + transformId);
request.addParameter("ignore", "404"); // Ignore 404s because they imply someone was racing us to delete this request.addParameter("ignore", "404"); // Ignore 404s because they imply someone was racing us to delete this
adminClient().performRequest(request); adminClient().performRequest(request);
} }
@ -361,7 +382,7 @@ public abstract class TransformRestTestCase extends ESRestTestCase {
List<Map<String, Object>> transformConfigs = getDataFrameTransforms(); List<Map<String, Object>> transformConfigs = getDataFrameTransforms();
for (Map<String, Object> transformConfig : transformConfigs) { for (Map<String, Object> transformConfig : transformConfigs) {
String transformId = (String) transformConfig.get("id"); String transformId = (String) transformConfig.get("id");
Request request = new Request("POST", TRANSFORM_ENDPOINT + transformId + "/_stop"); Request request = new Request("POST", getTransformEndpoint() + transformId + "/_stop");
request.addParameter("wait_for_completion", "true"); request.addParameter("wait_for_completion", "true");
request.addParameter("timeout", "10s"); request.addParameter("timeout", "10s");
request.addParameter("ignore", "404"); request.addParameter("ignore", "404");
@ -403,7 +424,7 @@ public abstract class TransformRestTestCase extends ESRestTestCase {
} }
static int getDataFrameCheckpoint(String transformId) throws IOException { static int getDataFrameCheckpoint(String transformId) throws IOException {
Response statsResponse = client().performRequest(new Request("GET", TRANSFORM_ENDPOINT + transformId + "/_stats")); Response statsResponse = client().performRequest(new Request("GET", getTransformEndpoint() + transformId + "/_stats"));
Map<?, ?> transformStatsAsMap = (Map<?, ?>) ((List<?>) entityAsMap(statsResponse).get("transforms")).get(0); Map<?, ?> transformStatsAsMap = (Map<?, ?>) ((List<?>) entityAsMap(statsResponse).get("transforms")).get(0);
return (int) XContentMapValues.extractValue("checkpointing.last.checkpoint", transformStatsAsMap); return (int) XContentMapValues.extractValue("checkpointing.last.checkpoint", transformStatsAsMap);
@ -431,4 +452,8 @@ public abstract class TransformRestTestCase extends ESRestTestCase {
+ "}"); + "}");
client().performRequest(request); client().performRequest(request);
} }
protected static String getTransformEndpoint() {
return useDeprecatedEndpoints ? TransformField.REST_BASE_PATH_TRANSFORMS_DEPRECATED : TransformField.REST_BASE_PATH_TRANSFORMS;
}
} }

View File

@ -64,7 +64,7 @@ public class TransformUsageIT extends TransformRestTestCase {
startAndWaitForContinuousTransform("test_usage_continuous", "pivot_reviews_continuous", null); startAndWaitForContinuousTransform("test_usage_continuous", "pivot_reviews_continuous", null);
Request getRequest = new Request("GET", TRANSFORM_ENDPOINT + "test_usage/_stats"); Request getRequest = new Request("GET", getTransformEndpoint() + "test_usage/_stats");
Map<String, Object> stats = entityAsMap(client().performRequest(getRequest)); Map<String, Object> stats = entityAsMap(client().performRequest(getRequest));
Map<String, Integer> expectedStats = new HashMap<>(); Map<String, Integer> expectedStats = new HashMap<>();
for(String statName : PROVIDED_STATS) { for(String statName : PROVIDED_STATS) {

View File

@ -52,6 +52,14 @@ import org.elasticsearch.xpack.core.transform.action.PutTransformAction;
import org.elasticsearch.xpack.core.transform.action.StartTransformAction; import org.elasticsearch.xpack.core.transform.action.StartTransformAction;
import org.elasticsearch.xpack.core.transform.action.StopTransformAction; import org.elasticsearch.xpack.core.transform.action.StopTransformAction;
import org.elasticsearch.xpack.core.transform.action.UpdateTransformAction; import org.elasticsearch.xpack.core.transform.action.UpdateTransformAction;
import org.elasticsearch.xpack.core.transform.action.compat.DeleteTransformActionDeprecated;
import org.elasticsearch.xpack.core.transform.action.compat.GetTransformActionDeprecated;
import org.elasticsearch.xpack.core.transform.action.compat.GetTransformStatsActionDeprecated;
import org.elasticsearch.xpack.core.transform.action.compat.PreviewTransformActionDeprecated;
import org.elasticsearch.xpack.core.transform.action.compat.PutTransformActionDeprecated;
import org.elasticsearch.xpack.core.transform.action.compat.StartTransformActionDeprecated;
import org.elasticsearch.xpack.core.transform.action.compat.StopTransformActionDeprecated;
import org.elasticsearch.xpack.core.transform.action.compat.UpdateTransformActionDeprecated;
import org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants; import org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants;
import org.elasticsearch.xpack.transform.action.TransportDeleteTransformAction; import org.elasticsearch.xpack.transform.action.TransportDeleteTransformAction;
import org.elasticsearch.xpack.transform.action.TransportGetTransformAction; import org.elasticsearch.xpack.transform.action.TransportGetTransformAction;
@ -61,6 +69,14 @@ import org.elasticsearch.xpack.transform.action.TransportPutTransformAction;
import org.elasticsearch.xpack.transform.action.TransportStartTransformAction; import org.elasticsearch.xpack.transform.action.TransportStartTransformAction;
import org.elasticsearch.xpack.transform.action.TransportStopTransformAction; import org.elasticsearch.xpack.transform.action.TransportStopTransformAction;
import org.elasticsearch.xpack.transform.action.TransportUpdateTransformAction; import org.elasticsearch.xpack.transform.action.TransportUpdateTransformAction;
import org.elasticsearch.xpack.transform.action.compat.TransportDeleteTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.compat.TransportGetTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.compat.TransportGetTransformStatsActionDeprecated;
import org.elasticsearch.xpack.transform.action.compat.TransportPreviewTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.compat.TransportPutTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.compat.TransportStartTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.compat.TransportStopTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.compat.TransportUpdateTransformActionDeprecated;
import org.elasticsearch.xpack.transform.checkpoint.TransformCheckpointService; import org.elasticsearch.xpack.transform.checkpoint.TransformCheckpointService;
import org.elasticsearch.xpack.transform.notifications.TransformAuditor; import org.elasticsearch.xpack.transform.notifications.TransformAuditor;
import org.elasticsearch.xpack.transform.persistence.TransformConfigManager; import org.elasticsearch.xpack.transform.persistence.TransformConfigManager;
@ -73,6 +89,14 @@ import org.elasticsearch.xpack.transform.rest.action.RestPutTransformAction;
import org.elasticsearch.xpack.transform.rest.action.RestStartTransformAction; import org.elasticsearch.xpack.transform.rest.action.RestStartTransformAction;
import org.elasticsearch.xpack.transform.rest.action.RestStopTransformAction; import org.elasticsearch.xpack.transform.rest.action.RestStopTransformAction;
import org.elasticsearch.xpack.transform.rest.action.RestUpdateTransformAction; import org.elasticsearch.xpack.transform.rest.action.RestUpdateTransformAction;
import org.elasticsearch.xpack.transform.rest.action.compat.RestDeleteTransformActionDeprecated;
import org.elasticsearch.xpack.transform.rest.action.compat.RestGetTransformActionDeprecated;
import org.elasticsearch.xpack.transform.rest.action.compat.RestGetTransformStatsActionDeprecated;
import org.elasticsearch.xpack.transform.rest.action.compat.RestPreviewTransformActionDeprecated;
import org.elasticsearch.xpack.transform.rest.action.compat.RestPutTransformActionDeprecated;
import org.elasticsearch.xpack.transform.rest.action.compat.RestStartTransformActionDeprecated;
import org.elasticsearch.xpack.transform.rest.action.compat.RestStopTransformActionDeprecated;
import org.elasticsearch.xpack.transform.rest.action.compat.RestUpdateTransformActionDeprecated;
import org.elasticsearch.xpack.transform.transforms.TransformPersistentTasksExecutor; import org.elasticsearch.xpack.transform.transforms.TransformPersistentTasksExecutor;
import org.elasticsearch.xpack.transform.transforms.TransformTask; import org.elasticsearch.xpack.transform.transforms.TransformTask;
@ -141,7 +165,17 @@ public class Transform extends Plugin implements ActionPlugin, PersistentTaskPlu
new RestGetTransformAction(restController), new RestGetTransformAction(restController),
new RestGetTransformStatsAction(restController), new RestGetTransformStatsAction(restController),
new RestPreviewTransformAction(restController), new RestPreviewTransformAction(restController),
new RestUpdateTransformAction(restController) new RestUpdateTransformAction(restController),
// deprecated endpoints, to be removed for 8.0.0
new RestPutTransformActionDeprecated(restController),
new RestStartTransformActionDeprecated(restController),
new RestStopTransformActionDeprecated(restController),
new RestDeleteTransformActionDeprecated(restController),
new RestGetTransformActionDeprecated(restController),
new RestGetTransformStatsActionDeprecated(restController),
new RestPreviewTransformActionDeprecated(restController),
new RestUpdateTransformActionDeprecated(restController)
); );
} }
@ -159,8 +193,18 @@ public class Transform extends Plugin implements ActionPlugin, PersistentTaskPlu
new ActionHandler<>(GetTransformAction.INSTANCE, TransportGetTransformAction.class), new ActionHandler<>(GetTransformAction.INSTANCE, TransportGetTransformAction.class),
new ActionHandler<>(GetTransformStatsAction.INSTANCE, TransportGetTransformStatsAction.class), new ActionHandler<>(GetTransformStatsAction.INSTANCE, TransportGetTransformStatsAction.class),
new ActionHandler<>(PreviewTransformAction.INSTANCE, TransportPreviewTransformAction.class), new ActionHandler<>(PreviewTransformAction.INSTANCE, TransportPreviewTransformAction.class),
new ActionHandler<>(UpdateTransformAction.INSTANCE, TransportUpdateTransformAction.class) new ActionHandler<>(UpdateTransformAction.INSTANCE, TransportUpdateTransformAction.class),
);
// deprecated actions, to be removed for 8.0.0
new ActionHandler<>(PutTransformActionDeprecated.INSTANCE, TransportPutTransformActionDeprecated.class),
new ActionHandler<>(StartTransformActionDeprecated.INSTANCE, TransportStartTransformActionDeprecated.class),
new ActionHandler<>(StopTransformActionDeprecated.INSTANCE, TransportStopTransformActionDeprecated.class),
new ActionHandler<>(DeleteTransformActionDeprecated.INSTANCE, TransportDeleteTransformActionDeprecated.class),
new ActionHandler<>(GetTransformActionDeprecated.INSTANCE, TransportGetTransformActionDeprecated.class),
new ActionHandler<>(GetTransformStatsActionDeprecated.INSTANCE, TransportGetTransformStatsActionDeprecated.class),
new ActionHandler<>(PreviewTransformActionDeprecated.INSTANCE, TransportPreviewTransformActionDeprecated.class),
new ActionHandler<>(UpdateTransformActionDeprecated.INSTANCE, TransportUpdateTransformActionDeprecated.class)
);
} }
@Override @Override
@ -170,7 +214,7 @@ public class Transform extends Plugin implements ActionPlugin, PersistentTaskPlu
} }
FixedExecutorBuilder indexing = new FixedExecutorBuilder(settings, TASK_THREAD_POOL_NAME, 4, 4, FixedExecutorBuilder indexing = new FixedExecutorBuilder(settings, TASK_THREAD_POOL_NAME, 4, 4,
"data_frame.task_thread_pool"); "transform.task_thread_pool");
return Collections.singletonList(indexing); return Collections.singletonList(indexing);
} }

View File

@ -23,8 +23,8 @@ import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService; import org.elasticsearch.transport.TransportService;
import org.elasticsearch.xpack.core.transform.action.DeleteTransformAction; import org.elasticsearch.xpack.core.transform.action.DeleteTransformAction;
import org.elasticsearch.xpack.core.transform.action.StopTransformAction;
import org.elasticsearch.xpack.core.transform.action.DeleteTransformAction.Request; import org.elasticsearch.xpack.core.transform.action.DeleteTransformAction.Request;
import org.elasticsearch.xpack.core.transform.action.StopTransformAction;
import org.elasticsearch.xpack.transform.notifications.TransformAuditor; import org.elasticsearch.xpack.transform.notifications.TransformAuditor;
import org.elasticsearch.xpack.transform.persistence.TransformConfigManager; import org.elasticsearch.xpack.transform.persistence.TransformConfigManager;
@ -35,18 +35,25 @@ import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin;
public class TransportDeleteTransformAction extends TransportMasterNodeAction<Request, AcknowledgedResponse> { public class TransportDeleteTransformAction extends TransportMasterNodeAction<Request, AcknowledgedResponse> {
private final TransformConfigManager transformsConfigManager; private final TransformConfigManager transformConfigManager;
private final TransformAuditor auditor; private final TransformAuditor auditor;
private final Client client; private final Client client;
@Inject @Inject
public TransportDeleteTransformAction(TransportService transportService, ActionFilters actionFilters, ThreadPool threadPool, public TransportDeleteTransformAction(TransportService transportService, ActionFilters actionFilters, ThreadPool threadPool,
ClusterService clusterService, IndexNameExpressionResolver indexNameExpressionResolver, ClusterService clusterService, IndexNameExpressionResolver indexNameExpressionResolver,
TransformConfigManager transformsConfigManager, TransformAuditor auditor, TransformConfigManager transformsConfigManager, TransformAuditor auditor,
Client client) { Client client) {
super(DeleteTransformAction.NAME, transportService, clusterService, threadPool, actionFilters, this(DeleteTransformAction.NAME, transportService, actionFilters, threadPool, clusterService, indexNameExpressionResolver,
Request::new, indexNameExpressionResolver); transformsConfigManager, auditor, client);
this.transformsConfigManager = transformsConfigManager; }
protected TransportDeleteTransformAction(String name, TransportService transportService, ActionFilters actionFilters,
ThreadPool threadPool, ClusterService clusterService,
IndexNameExpressionResolver indexNameExpressionResolver,
TransformConfigManager transformConfigManager, TransformAuditor auditor, Client client) {
super(name, transportService, clusterService, threadPool, actionFilters, Request::new, indexNameExpressionResolver);
this.transformConfigManager = transformConfigManager;
this.auditor = auditor; this.auditor = auditor;
this.client = client; this.client = client;
} }
@ -70,7 +77,7 @@ public class TransportDeleteTransformAction extends TransportMasterNodeAction<Re
"] as the task is running. Stop the task first", RestStatus.CONFLICT)); "] as the task is running. Stop the task first", RestStatus.CONFLICT));
} else { } else {
ActionListener<Void> stopTransformActionListener = ActionListener.wrap( ActionListener<Void> stopTransformActionListener = ActionListener.wrap(
stopResponse -> transformsConfigManager.deleteTransform(request.getId(), stopResponse -> transformConfigManager.deleteTransform(request.getId(),
ActionListener.wrap( ActionListener.wrap(
r -> { r -> {
auditor.info(request.getId(), "Deleted transform."); auditor.info(request.getId(), "Deleted transform.");

View File

@ -38,9 +38,14 @@ public class TransportGetTransformAction extends AbstractTransportGetResourcesAc
Response> { Response> {
@Inject @Inject
public TransportGetTransformAction(TransportService transportService, ActionFilters actionFilters, public TransportGetTransformAction(TransportService transportService, ActionFilters actionFilters, Client client,
Client client, NamedXContentRegistry xContentRegistry) { NamedXContentRegistry xContentRegistry) {
super(GetTransformAction.NAME, transportService, actionFilters, Request::new, client, xContentRegistry); this(GetTransformAction.NAME, transportService, actionFilters, client, xContentRegistry);
}
protected TransportGetTransformAction(String name, TransportService transportService, ActionFilters actionFilters, Client client,
NamedXContentRegistry xContentRegistry) {
super(name, transportService, actionFilters, Request::new, client, xContentRegistry);
} }
@Override @Override

View File

@ -59,14 +59,22 @@ public class TransportGetTransformStatsAction extends
@Inject @Inject
public TransportGetTransformStatsAction(TransportService transportService, ActionFilters actionFilters, public TransportGetTransformStatsAction(TransportService transportService, ActionFilters actionFilters,
ClusterService clusterService, ClusterService clusterService,
TransformConfigManager transformsConfigManager, TransformConfigManager transformConfigManager,
TransformCheckpointService transformsCheckpointService) { TransformCheckpointService transformsCheckpointService) {
super(GetTransformStatsAction.NAME, clusterService, transportService, actionFilters, Request::new, Response::new, this(GetTransformStatsAction.NAME, transportService, actionFilters, clusterService, transformConfigManager,
transformsCheckpointService);
}
protected TransportGetTransformStatsAction(String name, TransportService transportService, ActionFilters actionFilters,
ClusterService clusterService, TransformConfigManager transformsConfigManager,
TransformCheckpointService transformsCheckpointService) {
super(name, clusterService, transportService, actionFilters, Request::new, Response::new,
Response::new, ThreadPool.Names.SAME); Response::new, ThreadPool.Names.SAME);
this.transformConfigManager = transformsConfigManager; this.transformConfigManager = transformsConfigManager;
this.transformCheckpointService = transformsCheckpointService; this.transformCheckpointService = transformsCheckpointService;
} }
@Override @Override
protected Response newResponse(Request request, List<Response> tasks, List<TaskOperationFailure> taskOperationFailures, protected Response newResponse(Request request, List<Response> tasks, List<TaskOperationFailure> taskOperationFailures,
List<FailedNodeException> failedNodeExceptions) { List<FailedNodeException> failedNodeExceptions) {

View File

@ -43,9 +43,9 @@ import org.elasticsearch.xpack.core.XPackField;
import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.TransformMessages; import org.elasticsearch.xpack.core.transform.TransformMessages;
import org.elasticsearch.xpack.core.transform.action.PreviewTransformAction; import org.elasticsearch.xpack.core.transform.action.PreviewTransformAction;
import org.elasticsearch.xpack.core.transform.transforms.TransformIndexerStats;
import org.elasticsearch.xpack.core.transform.transforms.TransformConfig;
import org.elasticsearch.xpack.core.transform.transforms.SourceConfig; import org.elasticsearch.xpack.core.transform.transforms.SourceConfig;
import org.elasticsearch.xpack.core.transform.transforms.TransformConfig;
import org.elasticsearch.xpack.core.transform.transforms.TransformIndexerStats;
import org.elasticsearch.xpack.transform.transforms.pivot.AggregationResultUtils; import org.elasticsearch.xpack.transform.transforms.pivot.AggregationResultUtils;
import org.elasticsearch.xpack.transform.transforms.pivot.Pivot; import org.elasticsearch.xpack.transform.transforms.pivot.Pivot;
@ -74,7 +74,15 @@ public class TransportPreviewTransformAction extends
Client client, ThreadPool threadPool, XPackLicenseState licenseState, Client client, ThreadPool threadPool, XPackLicenseState licenseState,
IndexNameExpressionResolver indexNameExpressionResolver, IndexNameExpressionResolver indexNameExpressionResolver,
ClusterService clusterService) { ClusterService clusterService) {
super(PreviewTransformAction.NAME,transportService, actionFilters, PreviewTransformAction.Request::new); this(PreviewTransformAction.NAME,transportService, actionFilters, client, threadPool, licenseState, indexNameExpressionResolver,
clusterService);
}
protected TransportPreviewTransformAction(String name, TransportService transportService, ActionFilters actionFilters,
Client client, ThreadPool threadPool, XPackLicenseState licenseState,
IndexNameExpressionResolver indexNameExpressionResolver,
ClusterService clusterService) {
super(name, transportService, actionFilters, PreviewTransformAction.Request::new);
this.licenseState = licenseState; this.licenseState = licenseState;
this.client = client; this.client = client;
this.threadPool = threadPool; this.threadPool = threadPool;

View File

@ -61,7 +61,7 @@ public class TransportPutTransformAction extends TransportMasterNodeAction<Reque
private final XPackLicenseState licenseState; private final XPackLicenseState licenseState;
private final Client client; private final Client client;
private final TransformConfigManager transformsConfigManager; private final TransformConfigManager transformConfigManager;
private final SecurityContext securityContext; private final SecurityContext securityContext;
private final TransformAuditor auditor; private final TransformAuditor auditor;
@ -69,18 +69,28 @@ public class TransportPutTransformAction extends TransportMasterNodeAction<Reque
public TransportPutTransformAction(Settings settings, TransportService transportService, ThreadPool threadPool, public TransportPutTransformAction(Settings settings, TransportService transportService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
ClusterService clusterService, XPackLicenseState licenseState, ClusterService clusterService, XPackLicenseState licenseState,
TransformConfigManager transformsConfigManager, Client client, TransformConfigManager transformConfigManager, Client client,
TransformAuditor auditor) { TransformAuditor auditor) {
super(PutTransformAction.NAME, transportService, clusterService, threadPool, actionFilters, this(PutTransformAction.NAME, settings, transportService, threadPool, actionFilters, indexNameExpressionResolver,
PutTransformAction.Request::new, indexNameExpressionResolver); clusterService, licenseState, transformConfigManager, client, auditor);
}
protected TransportPutTransformAction(String name, Settings settings, TransportService transportService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
ClusterService clusterService, XPackLicenseState licenseState,
TransformConfigManager transformConfigManager, Client client,
TransformAuditor auditor) {
super(name, transportService, clusterService, threadPool, actionFilters,
PutTransformAction.Request::new, indexNameExpressionResolver);
this.licenseState = licenseState; this.licenseState = licenseState;
this.client = client; this.client = client;
this.transformsConfigManager = transformsConfigManager; this.transformConfigManager = transformConfigManager;
this.securityContext = XPackSettings.SECURITY_ENABLED.get(settings) ? this.securityContext = XPackSettings.SECURITY_ENABLED.get(settings) ?
new SecurityContext(settings, threadPool.getThreadContext()) : null; new SecurityContext(settings, threadPool.getThreadContext()) : null;
this.auditor = auditor; this.auditor = auditor;
} }
static HasPrivilegesRequest buildPrivilegeCheck(TransformConfig config, static HasPrivilegesRequest buildPrivilegeCheck(TransformConfig config,
IndexNameExpressionResolver indexNameExpressionResolver, IndexNameExpressionResolver indexNameExpressionResolver,
ClusterState clusterState, ClusterState clusterState,
@ -220,7 +230,7 @@ public class TransportPutTransformAction extends TransportMasterNodeAction<Reque
// <2> Put our transform // <2> Put our transform
ActionListener<Boolean> pivotValidationListener = ActionListener.wrap( ActionListener<Boolean> pivotValidationListener = ActionListener.wrap(
validationResult -> transformsConfigManager.putTransformConfiguration(config, putTransformConfigurationListener), validationResult -> transformConfigManager.putTransformConfiguration(config, putTransformConfigurationListener),
validationException -> { validationException -> {
if (validationException instanceof ElasticsearchStatusException) { if (validationException instanceof ElasticsearchStatusException) {
listener.onFailure(new ElasticsearchStatusException( listener.onFailure(new ElasticsearchStatusException(

View File

@ -36,9 +36,9 @@ import org.elasticsearch.xpack.core.ClientHelper;
import org.elasticsearch.xpack.core.XPackField; import org.elasticsearch.xpack.core.XPackField;
import org.elasticsearch.xpack.core.transform.TransformMessages; import org.elasticsearch.xpack.core.transform.TransformMessages;
import org.elasticsearch.xpack.core.transform.action.StartTransformAction; import org.elasticsearch.xpack.core.transform.action.StartTransformAction;
import org.elasticsearch.xpack.core.transform.transforms.TransformTaskParams;
import org.elasticsearch.xpack.core.transform.transforms.TransformConfig; import org.elasticsearch.xpack.core.transform.transforms.TransformConfig;
import org.elasticsearch.xpack.core.transform.transforms.TransformState; import org.elasticsearch.xpack.core.transform.transforms.TransformState;
import org.elasticsearch.xpack.core.transform.transforms.TransformTaskParams;
import org.elasticsearch.xpack.core.transform.transforms.TransformTaskState; import org.elasticsearch.xpack.core.transform.transforms.TransformTaskState;
import org.elasticsearch.xpack.transform.notifications.TransformAuditor; import org.elasticsearch.xpack.transform.notifications.TransformAuditor;
import org.elasticsearch.xpack.transform.persistence.TransformConfigManager; import org.elasticsearch.xpack.transform.persistence.TransformConfigManager;
@ -61,7 +61,7 @@ public class TransportStartTransformAction extends
private static final Logger logger = LogManager.getLogger(TransportStartTransformAction.class); private static final Logger logger = LogManager.getLogger(TransportStartTransformAction.class);
private final XPackLicenseState licenseState; private final XPackLicenseState licenseState;
private final TransformConfigManager transformsConfigManager; private final TransformConfigManager transformConfigManager;
private final PersistentTasksService persistentTasksService; private final PersistentTasksService persistentTasksService;
private final Client client; private final Client client;
private final TransformAuditor auditor; private final TransformAuditor auditor;
@ -70,13 +70,23 @@ public class TransportStartTransformAction extends
public TransportStartTransformAction(TransportService transportService, ActionFilters actionFilters, public TransportStartTransformAction(TransportService transportService, ActionFilters actionFilters,
ClusterService clusterService, XPackLicenseState licenseState, ClusterService clusterService, XPackLicenseState licenseState,
ThreadPool threadPool, IndexNameExpressionResolver indexNameExpressionResolver, ThreadPool threadPool, IndexNameExpressionResolver indexNameExpressionResolver,
TransformConfigManager transformsConfigManager, TransformConfigManager transformConfigManager,
PersistentTasksService persistentTasksService, Client client, PersistentTasksService persistentTasksService, Client client,
TransformAuditor auditor) { TransformAuditor auditor) {
super(StartTransformAction.NAME, transportService, clusterService, threadPool, actionFilters, this(StartTransformAction.NAME, transportService, actionFilters, clusterService, licenseState, threadPool,
StartTransformAction.Request::new, indexNameExpressionResolver); indexNameExpressionResolver, transformConfigManager, persistentTasksService, client, auditor);
}
protected TransportStartTransformAction(String name, TransportService transportService, ActionFilters actionFilters,
ClusterService clusterService, XPackLicenseState licenseState,
ThreadPool threadPool, IndexNameExpressionResolver indexNameExpressionResolver,
TransformConfigManager transformConfigManager,
PersistentTasksService persistentTasksService, Client client,
TransformAuditor auditor) {
super(name, transportService, clusterService, threadPool, actionFilters, StartTransformAction.Request::new,
indexNameExpressionResolver);
this.licenseState = licenseState; this.licenseState = licenseState;
this.transformsConfigManager = transformsConfigManager; this.transformConfigManager = transformConfigManager;
this.persistentTasksService = persistentTasksService; this.persistentTasksService = persistentTasksService;
this.client = client; this.client = client;
this.auditor = auditor; this.auditor = auditor;
@ -208,7 +218,7 @@ public class TransportStartTransformAction extends
); );
// <1> Get the config to verify it exists and is valid // <1> Get the config to verify it exists and is valid
transformsConfigManager.getTransformConfiguration(request.getId(), getTransformListener); transformConfigManager.getTransformConfiguration(request.getId(), getTransformListener);
} }
private void createDestinationIndex(final TransformConfig config, final ActionListener<Void> listener) { private void createDestinationIndex(final TransformConfig config, final ActionListener<Void> listener) {

View File

@ -54,7 +54,7 @@ public class TransportStopTransformAction extends TransportTasksAction<Transform
private static final Logger logger = LogManager.getLogger(TransportStopTransformAction.class); private static final Logger logger = LogManager.getLogger(TransportStopTransformAction.class);
private final ThreadPool threadPool; private final ThreadPool threadPool;
private final TransformConfigManager transformsConfigManager; private final TransformConfigManager transformConfigManager;
private final PersistentTasksService persistentTasksService; private final PersistentTasksService persistentTasksService;
private final Client client; private final Client client;
@ -62,12 +62,21 @@ public class TransportStopTransformAction extends TransportTasksAction<Transform
public TransportStopTransformAction(TransportService transportService, ActionFilters actionFilters, public TransportStopTransformAction(TransportService transportService, ActionFilters actionFilters,
ClusterService clusterService, ThreadPool threadPool, ClusterService clusterService, ThreadPool threadPool,
PersistentTasksService persistentTasksService, PersistentTasksService persistentTasksService,
TransformConfigManager transformsConfigManager, TransformConfigManager transformConfigManager,
Client client) { Client client) {
super(StopTransformAction.NAME, clusterService, transportService, actionFilters, Request::new, this(StopTransformAction.NAME, transportService, actionFilters, clusterService, threadPool, persistentTasksService,
Response::new, Response::new, ThreadPool.Names.SAME); transformConfigManager, client);
}
protected TransportStopTransformAction(String name, TransportService transportService, ActionFilters actionFilters,
ClusterService clusterService, ThreadPool threadPool,
PersistentTasksService persistentTasksService,
TransformConfigManager transformConfigManager,
Client client) {
super(name, clusterService, transportService, actionFilters, Request::new,
Response::new, Response::new, ThreadPool.Names.SAME);
this.threadPool = threadPool; this.threadPool = threadPool;
this.transformsConfigManager = transformsConfigManager; this.transformConfigManager = transformConfigManager;
this.persistentTasksService = persistentTasksService; this.persistentTasksService = persistentTasksService;
this.client = client; this.client = client;
} }
@ -118,7 +127,7 @@ public class TransportStopTransformAction extends TransportTasksAction<Transform
finalListener = listener; finalListener = listener;
} }
transformsConfigManager.expandTransformIds(request.getId(), transformConfigManager.expandTransformIds(request.getId(),
new PageParams(0, 10_000), new PageParams(0, 10_000),
request.isAllowNoMatch(), request.isAllowNoMatch(),
ActionListener.wrap(hitsAndIds -> { ActionListener.wrap(hitsAndIds -> {

View File

@ -46,9 +46,9 @@ import org.elasticsearch.xpack.core.transform.action.UpdateTransformAction.Respo
import org.elasticsearch.xpack.core.transform.transforms.TransformConfig; import org.elasticsearch.xpack.core.transform.transforms.TransformConfig;
import org.elasticsearch.xpack.core.transform.transforms.TransformConfigUpdate; import org.elasticsearch.xpack.core.transform.transforms.TransformConfigUpdate;
import org.elasticsearch.xpack.transform.notifications.TransformAuditor; import org.elasticsearch.xpack.transform.notifications.TransformAuditor;
import org.elasticsearch.xpack.transform.persistence.SeqNoPrimaryTermAndIndex;
import org.elasticsearch.xpack.transform.persistence.TransformConfigManager; import org.elasticsearch.xpack.transform.persistence.TransformConfigManager;
import org.elasticsearch.xpack.transform.persistence.TransformIndex; import org.elasticsearch.xpack.transform.persistence.TransformIndex;
import org.elasticsearch.xpack.transform.persistence.SeqNoPrimaryTermAndIndex;
import org.elasticsearch.xpack.transform.transforms.SourceDestValidator; import org.elasticsearch.xpack.transform.transforms.SourceDestValidator;
import org.elasticsearch.xpack.transform.transforms.pivot.Pivot; import org.elasticsearch.xpack.transform.transforms.pivot.Pivot;
@ -65,7 +65,7 @@ public class TransportUpdateTransformAction extends TransportMasterNodeAction<Re
private static final Logger logger = LogManager.getLogger(TransportUpdateTransformAction.class); private static final Logger logger = LogManager.getLogger(TransportUpdateTransformAction.class);
private final XPackLicenseState licenseState; private final XPackLicenseState licenseState;
private final Client client; private final Client client;
private final TransformConfigManager transformsConfigManager; private final TransformConfigManager transformConfigManager;
private final SecurityContext securityContext; private final SecurityContext securityContext;
private final TransformAuditor auditor; private final TransformAuditor auditor;
@ -73,13 +73,22 @@ public class TransportUpdateTransformAction extends TransportMasterNodeAction<Re
public TransportUpdateTransformAction(Settings settings, TransportService transportService, ThreadPool threadPool, public TransportUpdateTransformAction(Settings settings, TransportService transportService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
ClusterService clusterService, XPackLicenseState licenseState, ClusterService clusterService, XPackLicenseState licenseState,
TransformConfigManager transformsConfigManager, Client client, TransformConfigManager transformConfigManager, Client client,
TransformAuditor auditor) { TransformAuditor auditor) {
super(UpdateTransformAction.NAME, transportService, clusterService, threadPool, actionFilters, this(UpdateTransformAction.NAME, settings, transportService, threadPool, actionFilters, indexNameExpressionResolver, clusterService,
Request::new, indexNameExpressionResolver); licenseState, transformConfigManager, client, auditor);
}
protected TransportUpdateTransformAction(String name, Settings settings, TransportService transportService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
ClusterService clusterService, XPackLicenseState licenseState,
TransformConfigManager transformConfigManager, Client client,
TransformAuditor auditor) {
super(name, transportService, clusterService, threadPool, actionFilters,
Request::new, indexNameExpressionResolver);
this.licenseState = licenseState; this.licenseState = licenseState;
this.client = client; this.client = client;
this.transformsConfigManager = transformsConfigManager; this.transformConfigManager = transformConfigManager;
this.securityContext = XPackSettings.SECURITY_ENABLED.get(settings) ? this.securityContext = XPackSettings.SECURITY_ENABLED.get(settings) ?
new SecurityContext(settings, threadPool.getThreadContext()) : null; new SecurityContext(settings, threadPool.getThreadContext()) : null;
this.auditor = auditor; this.auditor = auditor;
@ -115,7 +124,7 @@ public class TransportUpdateTransformAction extends TransportMasterNodeAction<Re
// GET transform and attempt to update // GET transform and attempt to update
// We don't want the update to complete if the config changed between GET and INDEX // We don't want the update to complete if the config changed between GET and INDEX
transformsConfigManager.getTransformConfigurationForUpdate(request.getId(), ActionListener.wrap( transformConfigManager.getTransformConfigurationForUpdate(request.getId(), ActionListener.wrap(
configAndVersion -> { configAndVersion -> {
final TransformConfig config = configAndVersion.v1(); final TransformConfig config = configAndVersion.v1();
// If it is a noop don't bother even writing the doc, save the cycles, just return here. // If it is a noop don't bother even writing the doc, save the cycles, just return here.
@ -196,7 +205,7 @@ public class TransportUpdateTransformAction extends TransportMasterNodeAction<Re
ActionListener<Boolean> putTransformConfigurationListener = ActionListener.wrap( ActionListener<Boolean> putTransformConfigurationListener = ActionListener.wrap(
putTransformConfigurationResult -> { putTransformConfigurationResult -> {
auditor.info(config.getId(), "updated transform."); auditor.info(config.getId(), "updated transform.");
transformsConfigManager.deleteOldTransformConfigurations(request.getId(), ActionListener.wrap( transformConfigManager.deleteOldTransformConfigurations(request.getId(), ActionListener.wrap(
r -> { r -> {
logger.trace("[{}] successfully deleted old transform configurations", request.getId()); logger.trace("[{}] successfully deleted old transform configurations", request.getId());
listener.onResponse(new Response(config)); listener.onResponse(new Response(config));
@ -216,7 +225,7 @@ public class TransportUpdateTransformAction extends TransportMasterNodeAction<Re
// <2> Update our transform // <2> Update our transform
ActionListener<Void> createDestinationListener = ActionListener.wrap( ActionListener<Void> createDestinationListener = ActionListener.wrap(
createDestResponse -> transformsConfigManager.updateTransformConfiguration(config, createDestResponse -> transformConfigManager.updateTransformConfiguration(config,
seqNoPrimaryTermAndIndex, seqNoPrimaryTermAndIndex,
putTransformConfigurationListener), putTransformConfigurationListener),
listener::onFailure listener::onFailure

View File

@ -0,0 +1,31 @@
/*
* 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.transform.action.compat;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import org.elasticsearch.xpack.core.transform.action.compat.DeleteTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.TransportDeleteTransformAction;
import org.elasticsearch.xpack.transform.notifications.TransformAuditor;
import org.elasticsearch.xpack.transform.persistence.TransformConfigManager;
public class TransportDeleteTransformActionDeprecated extends TransportDeleteTransformAction{
@Inject
public TransportDeleteTransformActionDeprecated(TransportService transportService, ActionFilters actionFilters, ThreadPool threadPool,
ClusterService clusterService, IndexNameExpressionResolver indexNameExpressionResolver,
TransformConfigManager transformsConfigManager, TransformAuditor auditor,
Client client) {
super(DeleteTransformActionDeprecated.NAME, transportService, actionFilters, threadPool, clusterService,
indexNameExpressionResolver, transformsConfigManager, auditor, client);
}
}

View File

@ -0,0 +1,25 @@
/*
* 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.transform.action.compat;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.transport.TransportService;
import org.elasticsearch.xpack.core.transform.action.compat.GetTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.TransportGetTransformAction;
public class TransportGetTransformActionDeprecated extends TransportGetTransformAction {
@Inject
public TransportGetTransformActionDeprecated(TransportService transportService, ActionFilters actionFilters, Client client,
NamedXContentRegistry xContentRegistry) {
super(GetTransformActionDeprecated.NAME, transportService, actionFilters, client, xContentRegistry);
}
}

View File

@ -0,0 +1,28 @@
/*
* 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.transform.action.compat;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.transport.TransportService;
import org.elasticsearch.xpack.core.transform.action.compat.GetTransformStatsActionDeprecated;
import org.elasticsearch.xpack.transform.action.TransportGetTransformStatsAction;
import org.elasticsearch.xpack.transform.checkpoint.TransformCheckpointService;
import org.elasticsearch.xpack.transform.persistence.TransformConfigManager;
public class TransportGetTransformStatsActionDeprecated extends TransportGetTransformStatsAction {
@Inject
public TransportGetTransformStatsActionDeprecated(TransportService transportService, ActionFilters actionFilters,
ClusterService clusterService,
TransformConfigManager transformsConfigManager,
TransformCheckpointService transformsCheckpointService) {
super(GetTransformStatsActionDeprecated.NAME, transportService, actionFilters, clusterService, transformsConfigManager,
transformsCheckpointService);
}
}

View File

@ -0,0 +1,31 @@
/*
* 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.transform.action.compat;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.license.XPackLicenseState;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import org.elasticsearch.xpack.core.transform.action.compat.PreviewTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.TransportPreviewTransformAction;
public class TransportPreviewTransformActionDeprecated extends TransportPreviewTransformAction {
@Inject
public TransportPreviewTransformActionDeprecated(TransportService transportService, ActionFilters actionFilters,
Client client, ThreadPool threadPool, XPackLicenseState licenseState,
IndexNameExpressionResolver indexNameExpressionResolver,
ClusterService clusterService) {
super(PreviewTransformActionDeprecated.NAME, transportService, actionFilters, client, threadPool, licenseState,
indexNameExpressionResolver, clusterService);
}
}

View File

@ -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.transform.action.compat;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.license.XPackLicenseState;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import org.elasticsearch.xpack.core.transform.action.compat.PutTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.TransportPutTransformAction;
import org.elasticsearch.xpack.transform.notifications.TransformAuditor;
import org.elasticsearch.xpack.transform.persistence.TransformConfigManager;
public class TransportPutTransformActionDeprecated extends TransportPutTransformAction {
@Inject
public TransportPutTransformActionDeprecated(Settings settings, TransportService transportService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
ClusterService clusterService, XPackLicenseState licenseState,
TransformConfigManager transformConfigManager, Client client,
TransformAuditor auditor) {
super(PutTransformActionDeprecated.NAME, settings, transportService, threadPool, actionFilters, indexNameExpressionResolver,
clusterService, licenseState, transformConfigManager, client, auditor);
}
}

View File

@ -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.transform.action.compat;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.license.XPackLicenseState;
import org.elasticsearch.persistent.PersistentTasksService;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import org.elasticsearch.xpack.core.transform.action.compat.StartTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.TransportStartTransformAction;
import org.elasticsearch.xpack.transform.notifications.TransformAuditor;
import org.elasticsearch.xpack.transform.persistence.TransformConfigManager;
public class TransportStartTransformActionDeprecated extends TransportStartTransformAction {
@Inject
public TransportStartTransformActionDeprecated(TransportService transportService, ActionFilters actionFilters,
ClusterService clusterService, XPackLicenseState licenseState,
ThreadPool threadPool, IndexNameExpressionResolver indexNameExpressionResolver,
TransformConfigManager transformConfigManager,
PersistentTasksService persistentTasksService, Client client,
TransformAuditor auditor) {
super(StartTransformActionDeprecated.NAME, transportService, actionFilters, clusterService, licenseState, threadPool,
indexNameExpressionResolver, transformConfigManager, persistentTasksService, client, auditor);
}
}

View File

@ -0,0 +1,32 @@
/*
* 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.transform.action.compat;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.persistent.PersistentTasksService;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import org.elasticsearch.xpack.core.transform.action.compat.StopTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.TransportStopTransformAction;
import org.elasticsearch.xpack.transform.persistence.TransformConfigManager;
public class TransportStopTransformActionDeprecated extends TransportStopTransformAction {
@Inject
public TransportStopTransformActionDeprecated(TransportService transportService, ActionFilters actionFilters,
ClusterService clusterService, ThreadPool threadPool,
PersistentTasksService persistentTasksService,
TransformConfigManager transformConfigManager,
Client client) {
super(StopTransformActionDeprecated.NAME, transportService, actionFilters, clusterService, threadPool, persistentTasksService,
transformConfigManager, client);
}
}

View File

@ -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.transform.action.compat;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.license.XPackLicenseState;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import org.elasticsearch.xpack.core.transform.action.compat.UpdateTransformActionDeprecated;
import org.elasticsearch.xpack.transform.action.TransportUpdateTransformAction;
import org.elasticsearch.xpack.transform.notifications.TransformAuditor;
import org.elasticsearch.xpack.transform.persistence.TransformConfigManager;
public class TransportUpdateTransformActionDeprecated extends TransportUpdateTransformAction {
@Inject
public TransportUpdateTransformActionDeprecated(Settings settings, TransportService transportService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
ClusterService clusterService, XPackLicenseState licenseState,
TransformConfigManager transformConfigManager, Client client,
TransformAuditor auditor) {
super(UpdateTransformActionDeprecated.NAME, settings, transportService, threadPool, actionFilters, indexNameExpressionResolver,
clusterService, licenseState, transformConfigManager, client, auditor);
}
}

View File

@ -36,6 +36,6 @@ public class RestDeleteTransformAction extends BaseRestHandler {
@Override @Override
public String getName() { public String getName() {
return "data_frame_delete_transform_action"; return "transform_delete_transform_action";
} }
} }

View File

@ -41,6 +41,6 @@ public class RestGetTransformAction extends BaseRestHandler {
@Override @Override
public String getName() { public String getName() {
return "data_frame_get_transforms_action"; return "transform_get_transform_action";
} }
} }

View File

@ -40,6 +40,6 @@ public class RestGetTransformStatsAction extends BaseRestHandler {
@Override @Override
public String getName() { public String getName() {
return "data_frame_get_transforms_stats_action"; return "transform_get_transform_stats_action";
} }
} }

View File

@ -20,12 +20,12 @@ import java.io.IOException;
public class RestPreviewTransformAction extends BaseRestHandler { public class RestPreviewTransformAction extends BaseRestHandler {
public RestPreviewTransformAction(RestController controller) { public RestPreviewTransformAction(RestController controller) {
controller.registerHandler(RestRequest.Method.POST, TransformField.REST_BASE_PATH + "transforms/_preview", this); controller.registerHandler(RestRequest.Method.POST, TransformField.REST_BASE_PATH_TRANSFORMS + "_preview", this);
} }
@Override @Override
public String getName() { public String getName() {
return "data_frame_preview_transform_action"; return "transform_preview_transform_action";
} }
@Override @Override

View File

@ -25,7 +25,7 @@ public class RestPutTransformAction extends BaseRestHandler {
@Override @Override
public String getName() { public String getName() {
return "data_frame_put_transform_action"; return "transform_put_transform_action";
} }
@Override @Override

View File

@ -32,6 +32,6 @@ public class RestStartTransformAction extends BaseRestHandler {
@Override @Override
public String getName() { public String getName() {
return "data_frame_start_transform_action"; return "transform_start_transform_action";
} }
} }

View File

@ -42,6 +42,6 @@ public class RestStopTransformAction extends BaseRestHandler {
@Override @Override
public String getName() { public String getName() {
return "data_frame_stop_transform_action"; return "transform_stop_transform_action";
} }
} }

View File

@ -25,7 +25,7 @@ public class RestUpdateTransformAction extends BaseRestHandler {
@Override @Override
public String getName() { public String getName() {
return "data_frame_update_transform_action"; return "transform_update_transform_action";
} }
@Override @Override

View File

@ -0,0 +1,49 @@
/*
* 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.transform.rest.action.compat;
import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.TransformMessages;
import org.elasticsearch.xpack.core.transform.action.DeleteTransformAction;
import org.elasticsearch.xpack.core.transform.action.compat.DeleteTransformActionDeprecated;
public class RestDeleteTransformActionDeprecated extends BaseRestHandler {
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(RestDeleteTransformActionDeprecated.class));
public RestDeleteTransformActionDeprecated(RestController controller) {
controller.registerAsDeprecatedHandler(RestRequest.Method.DELETE, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED, this,
TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger);
}
@Override
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) {
if (restRequest.hasContent()) {
throw new IllegalArgumentException("delete transform requests can not have a request body");
}
String id = restRequest.param(TransformField.ID.getPreferredName());
boolean force = restRequest.paramAsBoolean(TransformField.FORCE.getPreferredName(), false);
DeleteTransformAction.Request request = new DeleteTransformAction.Request(id, force);
return channel -> client.execute(DeleteTransformActionDeprecated.INSTANCE, request,
new RestToXContentListener<>(channel));
}
@Override
public String getName() {
return "data_frame_delete_transform_action";
}
}

View File

@ -0,0 +1,55 @@
/*
* 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.transform.rest.action.compat;
import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.action.util.PageParams;
import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.TransformMessages;
import org.elasticsearch.xpack.core.transform.action.GetTransformAction;
import org.elasticsearch.xpack.core.transform.action.compat.GetTransformActionDeprecated;
import static org.elasticsearch.xpack.core.transform.TransformField.ALLOW_NO_MATCH;
public class RestGetTransformActionDeprecated extends BaseRestHandler {
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(RestGetTransformActionDeprecated.class));
public RestGetTransformActionDeprecated(RestController controller) {
controller.registerAsDeprecatedHandler(RestRequest.Method.GET, TransformField.REST_BASE_PATH_TRANSFORMS_DEPRECATED, this,
TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger);
controller.registerAsDeprecatedHandler(RestRequest.Method.GET, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED, this,
TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger);
}
@Override
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) {
GetTransformAction.Request request = new GetTransformAction.Request();
String id = restRequest.param(TransformField.ID.getPreferredName());
request.setResourceId(id);
request.setAllowNoResources(restRequest.paramAsBoolean(ALLOW_NO_MATCH.getPreferredName(), true));
if (restRequest.hasParam(PageParams.FROM.getPreferredName()) || restRequest.hasParam(PageParams.SIZE.getPreferredName())) {
request.setPageParams(
new PageParams(restRequest.paramAsInt(PageParams.FROM.getPreferredName(), PageParams.DEFAULT_FROM),
restRequest.paramAsInt(PageParams.SIZE.getPreferredName(), PageParams.DEFAULT_SIZE)));
}
return channel -> client.execute(GetTransformActionDeprecated.INSTANCE, request, new RestToXContentListener<>(channel));
}
@Override
public String getName() {
return "data_frame_get_transforms_action";
}
}

View File

@ -0,0 +1,55 @@
/*
* 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.transform.rest.action.compat;
import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.action.util.PageParams;
import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.TransformMessages;
import org.elasticsearch.xpack.core.transform.action.GetTransformStatsAction;
import org.elasticsearch.xpack.core.transform.action.compat.GetTransformStatsActionDeprecated;
import static org.elasticsearch.xpack.core.transform.TransformField.ALLOW_NO_MATCH;
public class RestGetTransformStatsActionDeprecated extends BaseRestHandler {
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(RestGetTransformStatsActionDeprecated.class));
public RestGetTransformStatsActionDeprecated(RestController controller) {
controller.registerAsDeprecatedHandler(RestRequest.Method.GET, TransformField.REST_BASE_PATH_TRANSFORMS_DEPRECATED + "_stats",
this, TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger);
controller.registerAsDeprecatedHandler(RestRequest.Method.GET,
TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_stats", this,
TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger);
}
@Override
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) {
String id = restRequest.param(TransformField.ID.getPreferredName());
GetTransformStatsAction.Request request = new GetTransformStatsAction.Request(id);
request.setAllowNoMatch(restRequest.paramAsBoolean(ALLOW_NO_MATCH.getPreferredName(), true));
if (restRequest.hasParam(PageParams.FROM.getPreferredName()) || restRequest.hasParam(PageParams.SIZE.getPreferredName())) {
request.setPageParams(
new PageParams(restRequest.paramAsInt(PageParams.FROM.getPreferredName(), PageParams.DEFAULT_FROM),
restRequest.paramAsInt(PageParams.SIZE.getPreferredName(), PageParams.DEFAULT_SIZE)));
}
return channel -> client.execute(GetTransformStatsActionDeprecated.INSTANCE, request,
new RestToXContentListener<>(channel));
}
@Override
public String getName() {
return "data_frame_get_transforms_stats_action";
}
}

View File

@ -0,0 +1,46 @@
/*
* 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.transform.rest.action.compat;
import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.TransformMessages;
import org.elasticsearch.xpack.core.transform.action.PreviewTransformAction;
import org.elasticsearch.xpack.core.transform.action.compat.PreviewTransformActionDeprecated;
import java.io.IOException;
public class RestPreviewTransformActionDeprecated extends BaseRestHandler {
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(RestPreviewTransformActionDeprecated.class));
public RestPreviewTransformActionDeprecated(RestController controller) {
controller.registerAsDeprecatedHandler(RestRequest.Method.POST, TransformField.REST_BASE_PATH_TRANSFORMS_DEPRECATED + "_preview",
this, TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger);
}
@Override
public String getName() {
return "data_frame_preview_transform_action";
}
@Override
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
XContentParser parser = restRequest.contentParser();
PreviewTransformAction.Request request = PreviewTransformAction.Request.fromXContent(parser);
return channel -> client.execute(PreviewTransformActionDeprecated.INSTANCE, request, new RestToXContentListener<>(channel));
}
}

View File

@ -0,0 +1,49 @@
/*
* 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.transform.rest.action.compat;
import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.TransformMessages;
import org.elasticsearch.xpack.core.transform.action.PutTransformAction;
import org.elasticsearch.xpack.core.transform.action.compat.PutTransformActionDeprecated;
import java.io.IOException;
public class RestPutTransformActionDeprecated extends BaseRestHandler {
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(RestPutTransformActionDeprecated.class));
public RestPutTransformActionDeprecated(RestController controller) {
controller.registerAsDeprecatedHandler(RestRequest.Method.PUT, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED, this,
TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger);
}
@Override
public String getName() {
return "data_frame_put_transform_action";
}
@Override
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
String id = restRequest.param(TransformField.ID.getPreferredName());
XContentParser parser = restRequest.contentParser();
boolean deferValidation = restRequest.paramAsBoolean(TransformField.DEFER_VALIDATION.getPreferredName(), false);
PutTransformAction.Request request = PutTransformAction.Request.fromXContent(parser, id, deferValidation);
return channel -> client.execute(PutTransformActionDeprecated.INSTANCE, request, new RestToXContentListener<>(channel));
}
}

View File

@ -0,0 +1,46 @@
/*
* 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.transform.rest.action.compat;
import org.apache.logging.log4j.LogManager;
import org.elasticsearch.action.support.master.AcknowledgedRequest;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.TransformMessages;
import org.elasticsearch.xpack.core.transform.action.StartTransformAction;
import org.elasticsearch.xpack.core.transform.action.compat.StartTransformActionDeprecated;
public class RestStartTransformActionDeprecated extends BaseRestHandler {
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(RestStartTransformActionDeprecated.class));
public RestStartTransformActionDeprecated(RestController controller) {
controller.registerAsDeprecatedHandler(RestRequest.Method.POST,
TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_start", this, TransformMessages.REST_DEPRECATED_ENDPOINT,
deprecationLogger);
}
@Override
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) {
String id = restRequest.param(TransformField.ID.getPreferredName());
StartTransformAction.Request request = new StartTransformAction.Request(id);
request.timeout(restRequest.paramAsTime(TransformField.TIMEOUT.getPreferredName(), AcknowledgedRequest.DEFAULT_ACK_TIMEOUT));
return channel -> client.execute(StartTransformActionDeprecated.INSTANCE, request,
new RestToXContentListener<>(channel));
}
@Override
public String getName() {
return "data_frame_start_transform_action";
}
}

View File

@ -0,0 +1,55 @@
/*
* 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.transform.rest.action.compat;
import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.TransformMessages;
import org.elasticsearch.xpack.core.transform.action.StopTransformAction;
import org.elasticsearch.xpack.core.transform.action.compat.StopTransformActionDeprecated;
public class RestStopTransformActionDeprecated extends BaseRestHandler {
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(RestStopTransformActionDeprecated.class));
public RestStopTransformActionDeprecated(RestController controller) {
controller.registerAsDeprecatedHandler(RestRequest.Method.POST, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_stop",
this, TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger);
}
@Override
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) {
String id = restRequest.param(TransformField.ID.getPreferredName());
TimeValue timeout = restRequest.paramAsTime(TransformField.TIMEOUT.getPreferredName(),
StopTransformAction.DEFAULT_TIMEOUT);
boolean waitForCompletion = restRequest.paramAsBoolean(TransformField.WAIT_FOR_COMPLETION.getPreferredName(), false);
boolean force = restRequest.paramAsBoolean(TransformField.FORCE.getPreferredName(), false);
boolean allowNoMatch = restRequest.paramAsBoolean(TransformField.ALLOW_NO_MATCH.getPreferredName(), false);
StopTransformAction.Request request = new StopTransformAction.Request(id,
waitForCompletion,
force,
timeout,
allowNoMatch);
return channel -> client.execute(StopTransformActionDeprecated.INSTANCE, request,
new RestToXContentListener<>(channel));
}
@Override
public String getName() {
return "data_frame_stop_transform_action";
}
}

View File

@ -0,0 +1,49 @@
/*
* 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.transform.rest.action.compat;
import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.transform.TransformField;
import org.elasticsearch.xpack.core.transform.TransformMessages;
import org.elasticsearch.xpack.core.transform.action.UpdateTransformAction;
import org.elasticsearch.xpack.core.transform.action.compat.UpdateTransformActionDeprecated;
import java.io.IOException;
public class RestUpdateTransformActionDeprecated extends BaseRestHandler {
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(RestUpdateTransformActionDeprecated.class));
public RestUpdateTransformActionDeprecated(RestController controller) {
controller.registerAsDeprecatedHandler(RestRequest.Method.POST,
TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_update", this, TransformMessages.REST_DEPRECATED_ENDPOINT,
deprecationLogger);
}
@Override
public String getName() {
return "data_frame_update_transform_action";
}
@Override
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
String id = restRequest.param(TransformField.ID.getPreferredName());
boolean deferValidation = restRequest.paramAsBoolean(TransformField.DEFER_VALIDATION.getPreferredName(), false);
XContentParser parser = restRequest.contentParser();
UpdateTransformAction.Request request = UpdateTransformAction.Request.fromXContent(parser, id, deferValidation);
return channel -> client.execute(UpdateTransformActionDeprecated.INSTANCE, request, new RestToXContentListener<>(channel));
}
}

View File

@ -5,23 +5,27 @@
*/ */
package org.elasticsearch.upgrades; package org.elasticsearch.upgrades;
import org.apache.http.HttpHost;
import org.apache.http.entity.ContentType; import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity; import org.apache.http.entity.StringEntity;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.client.Request; import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response; import org.elasticsearch.client.Response;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.core.IndexerState; import org.elasticsearch.client.core.IndexerState;
import org.elasticsearch.client.transform.GetTransformStatsResponse; import org.elasticsearch.client.transform.GetTransformStatsResponse;
import org.elasticsearch.client.transform.transforms.TransformConfig;
import org.elasticsearch.client.transform.transforms.TransformStats;
import org.elasticsearch.client.transform.transforms.DestConfig; import org.elasticsearch.client.transform.transforms.DestConfig;
import org.elasticsearch.client.transform.transforms.SourceConfig; import org.elasticsearch.client.transform.transforms.SourceConfig;
import org.elasticsearch.client.transform.transforms.TimeSyncConfig; import org.elasticsearch.client.transform.transforms.TimeSyncConfig;
import org.elasticsearch.client.transform.transforms.TransformConfig;
import org.elasticsearch.client.transform.transforms.TransformStats;
import org.elasticsearch.client.transform.transforms.pivot.GroupConfig; import org.elasticsearch.client.transform.transforms.pivot.GroupConfig;
import org.elasticsearch.client.transform.transforms.pivot.PivotConfig; import org.elasticsearch.client.transform.transforms.pivot.PivotConfig;
import org.elasticsearch.client.transform.transforms.pivot.TermsGroupSource; import org.elasticsearch.client.transform.transforms.pivot.TermsGroupSource;
import org.elasticsearch.common.Booleans; import org.elasticsearch.common.Booleans;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.DeprecationHandler;
import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.NamedXContentRegistry;
@ -52,12 +56,13 @@ import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.oneOf; import static org.hamcrest.Matchers.oneOf;
public class DataFrameSurvivesUpgradeIT extends AbstractUpgradeTestCase { public class TransformSurvivesUpgradeIT extends AbstractUpgradeTestCase {
private static final Version UPGRADE_FROM_VERSION = Version.fromString(System.getProperty("tests.upgrade_from_version")); private static final Version UPGRADE_FROM_VERSION = Version.fromString(System.getProperty("tests.upgrade_from_version"));
private static final String DATAFRAME_ENDPOINT = "/_data_frame/transforms/"; private static final String DATAFRAME_ENDPOINT = "/_transform/";
private static final String CONTINUOUS_DATA_FRAME_ID = "continuous-data-frame-upgrade-job"; private static final String DATAFRAME_ENDPOINT_DEPRECATED = "/_data_frame/transforms/";
private static final String CONTINUOUS_DATA_FRAME_SOURCE = "data-frame-upgrade-continuous-source"; private static final String CONTINUOUS_TRANSFORM_ID = "continuous-transform-upgrade-job";
private static final String CONTINUOUS_TRANSFORM_SOURCE = "transform-upgrade-continuous-source";
private static final List<String> ENTITIES = Stream.iterate(1, n -> n + 1) private static final List<String> ENTITIES = Stream.iterate(1, n -> n + 1)
.limit(5) .limit(5)
.map(v -> "user_" + v) .map(v -> "user_" + v)
@ -81,6 +86,14 @@ public class DataFrameSurvivesUpgradeIT extends AbstractUpgradeTestCase {
waitForPendingTasks(adminClient(), taskName -> taskName.startsWith("data_frame/transforms") == false); waitForPendingTasks(adminClient(), taskName -> taskName.startsWith("data_frame/transforms") == false);
} }
@Override
protected RestClient buildClient(Settings settings, HttpHost[] hosts) throws IOException {
RestClientBuilder builder = RestClient.builder(hosts);
configureClient(builder, settings);
builder.setStrictDeprecationMode(false);
return builder.build();
}
/** /**
* The purpose of this test is to ensure that when a job is open through a rolling upgrade we upgrade the results * The purpose of this test is to ensure that when a job is open through a rolling upgrade we upgrade the results
* index mappings when it is assigned to an upgraded node even if no other ML endpoint is called after the upgrade * index mappings when it is assigned to an upgraded node even if no other ML endpoint is called after the upgrade
@ -91,7 +104,9 @@ public class DataFrameSurvivesUpgradeIT extends AbstractUpgradeTestCase {
adjustLoggingLevels.setJsonEntity( adjustLoggingLevels.setJsonEntity(
"{\"transient\": {" + "{\"transient\": {" +
"\"logger.org.elasticsearch.xpack.core.indexing.AsyncTwoPhaseIndexer\": \"trace\"," + "\"logger.org.elasticsearch.xpack.core.indexing.AsyncTwoPhaseIndexer\": \"trace\"," +
"\"logger.org.elasticsearch.xpack.dataframe\": \"trace\"}}"); "\"logger.org.elasticsearch.xpack.dataframe\": \"trace\"," +
"\"logger.org.elasticsearch.xpack.transform\": \"trace\"" +
"}}");
client().performRequest(adjustLoggingLevels); client().performRequest(adjustLoggingLevels);
Request waitForYellow = new Request("GET", "/_cluster/health"); Request waitForYellow = new Request("GET", "/_cluster/health");
waitForYellow.addParameter("wait_for_nodes", "3"); waitForYellow.addParameter("wait_for_nodes", "3");
@ -120,17 +135,17 @@ public class DataFrameSurvivesUpgradeIT extends AbstractUpgradeTestCase {
} }
private void cleanUpTransforms() throws Exception { private void cleanUpTransforms() throws Exception {
stopTransform(CONTINUOUS_DATA_FRAME_ID); stopTransform(CONTINUOUS_TRANSFORM_ID);
deleteTransform(CONTINUOUS_DATA_FRAME_ID); deleteTransform(CONTINUOUS_TRANSFORM_ID);
waitForPendingDataFrameTasks(); waitForPendingDataFrameTasks();
} }
private void createAndStartContinuousDataFrame() throws Exception { private void createAndStartContinuousDataFrame() throws Exception {
createIndex(CONTINUOUS_DATA_FRAME_SOURCE); createIndex(CONTINUOUS_TRANSFORM_SOURCE);
long totalDocsWrittenSum = 0; long totalDocsWrittenSum = 0;
for (TimeValue bucket : BUCKETS) { for (TimeValue bucket : BUCKETS) {
int docs = randomIntBetween(1, 25); int docs = randomIntBetween(1, 25);
putData(CONTINUOUS_DATA_FRAME_SOURCE, docs, bucket, ENTITIES); putData(CONTINUOUS_TRANSFORM_SOURCE, docs, bucket, ENTITIES);
totalDocsWrittenSum += docs * ENTITIES.size(); totalDocsWrittenSum += docs * ENTITIES.size();
} }
long totalDocsWritten = totalDocsWrittenSum; long totalDocsWritten = totalDocsWrittenSum;
@ -140,18 +155,18 @@ public class DataFrameSurvivesUpgradeIT extends AbstractUpgradeTestCase {
.setAggregations(new AggregatorFactories.Builder().addAggregator(AggregationBuilders.avg("stars").field("stars"))) .setAggregations(new AggregatorFactories.Builder().addAggregator(AggregationBuilders.avg("stars").field("stars")))
.setGroups(GroupConfig.builder().groupBy("user_id", TermsGroupSource.builder().setField("user_id").build()).build()) .setGroups(GroupConfig.builder().groupBy("user_id", TermsGroupSource.builder().setField("user_id").build()).build())
.build()) .build())
.setDest(DestConfig.builder().setIndex(CONTINUOUS_DATA_FRAME_ID + "_idx").build()) .setDest(DestConfig.builder().setIndex(CONTINUOUS_TRANSFORM_ID + "_idx").build())
.setSource(SourceConfig.builder().setIndex(CONTINUOUS_DATA_FRAME_SOURCE).build()) .setSource(SourceConfig.builder().setIndex(CONTINUOUS_TRANSFORM_SOURCE).build())
.setId(CONTINUOUS_DATA_FRAME_ID) .setId(CONTINUOUS_TRANSFORM_ID)
.setFrequency(TimeValue.timeValueSeconds(1)) .setFrequency(TimeValue.timeValueSeconds(1))
.build(); .build();
putTransform(CONTINUOUS_DATA_FRAME_ID, config); putTransform(CONTINUOUS_TRANSFORM_ID, config);
startTransform(CONTINUOUS_DATA_FRAME_ID); startTransform(CONTINUOUS_TRANSFORM_ID);
waitUntilAfterCheckpoint(CONTINUOUS_DATA_FRAME_ID, 0L); waitUntilAfterCheckpoint(CONTINUOUS_TRANSFORM_ID, 0L);
assertBusy(() -> { assertBusy(() -> {
TransformStats stateAndStats = getTransformStats(CONTINUOUS_DATA_FRAME_ID); TransformStats stateAndStats = getTransformStats(CONTINUOUS_TRANSFORM_ID);
assertThat(stateAndStats.getIndexerStats().getOutputDocuments(), equalTo((long)ENTITIES.size())); assertThat(stateAndStats.getIndexerStats().getOutputDocuments(), equalTo((long)ENTITIES.size()));
assertThat(stateAndStats.getIndexerStats().getNumDocuments(), equalTo(totalDocsWritten)); assertThat(stateAndStats.getIndexerStats().getNumDocuments(), equalTo(totalDocsWritten));
// Even if we get back to started, we may periodically get set back to `indexing` when triggered. // Even if we get back to started, we may periodically get set back to `indexing` when triggered.
@ -161,7 +176,7 @@ public class DataFrameSurvivesUpgradeIT extends AbstractUpgradeTestCase {
// We want to make sure our latest state is written before we turn the node off, this makes the testing more reliable // We want to make sure our latest state is written before we turn the node off, this makes the testing more reliable
awaitWrittenIndexerState(CONTINUOUS_DATA_FRAME_ID, IndexerState.STARTED.value()); awaitWrittenIndexerState(CONTINUOUS_TRANSFORM_ID, IndexerState.STARTED.value());
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -170,13 +185,13 @@ public class DataFrameSurvivesUpgradeIT extends AbstractUpgradeTestCase {
// A continuous data frame should automatically become started when it gets assigned to a node // A continuous data frame should automatically become started when it gets assigned to a node
// if it was assigned to the node that was removed from the cluster // if it was assigned to the node that was removed from the cluster
assertBusy(() -> { assertBusy(() -> {
TransformStats stateAndStats = getTransformStats(CONTINUOUS_DATA_FRAME_ID); TransformStats stateAndStats = getTransformStats(CONTINUOUS_TRANSFORM_ID);
assertThat(stateAndStats.getState(), oneOf(TransformStats.State.STARTED, TransformStats.State.INDEXING)); assertThat(stateAndStats.getState(), oneOf(TransformStats.State.STARTED, TransformStats.State.INDEXING));
}, },
120, 120,
TimeUnit.SECONDS); TimeUnit.SECONDS);
TransformStats previousStateAndStats = getTransformStats(CONTINUOUS_DATA_FRAME_ID); TransformStats previousStateAndStats = getTransformStats(CONTINUOUS_TRANSFORM_ID);
// Add a new user and write data to it // Add a new user and write data to it
// This is so we can have more reliable data counts, as writing to existing entities requires // This is so we can have more reliable data counts, as writing to existing entities requires
@ -186,20 +201,20 @@ public class DataFrameSurvivesUpgradeIT extends AbstractUpgradeTestCase {
int docs = 5; int docs = 5;
// Index the data // Index the data
// The frequency and delay should see the data once its indexed // The frequency and delay should see the data once its indexed
putData(CONTINUOUS_DATA_FRAME_SOURCE, docs, TimeValue.timeValueSeconds(0), entities); putData(CONTINUOUS_TRANSFORM_SOURCE, docs, TimeValue.timeValueSeconds(0), entities);
waitUntilAfterCheckpoint(CONTINUOUS_DATA_FRAME_ID, expectedLastCheckpoint); waitUntilAfterCheckpoint(CONTINUOUS_TRANSFORM_ID, expectedLastCheckpoint);
assertBusy(() -> assertThat( assertBusy(() -> assertThat(
getTransformStats(CONTINUOUS_DATA_FRAME_ID).getIndexerStats().getNumDocuments(), getTransformStats(CONTINUOUS_TRANSFORM_ID).getIndexerStats().getNumDocuments(),
greaterThanOrEqualTo(docs + previousStateAndStats.getIndexerStats().getNumDocuments())), greaterThanOrEqualTo(docs + previousStateAndStats.getIndexerStats().getNumDocuments())),
120, 120,
TimeUnit.SECONDS); TimeUnit.SECONDS);
TransformStats stateAndStats = getTransformStats(CONTINUOUS_DATA_FRAME_ID); TransformStats stateAndStats = getTransformStats(CONTINUOUS_TRANSFORM_ID);
assertThat(stateAndStats.getState(), assertThat(stateAndStats.getState(),
oneOf(TransformStats.State.STARTED, TransformStats.State.INDEXING)); oneOf(TransformStats.State.STARTED, TransformStats.State.INDEXING));
awaitWrittenIndexerState(CONTINUOUS_DATA_FRAME_ID, (responseBody) -> { awaitWrittenIndexerState(CONTINUOUS_TRANSFORM_ID, (responseBody) -> {
Map<String, Object> indexerStats = (Map<String,Object>)((List<?>)XContentMapValues.extractValue("hits.hits._source.stats", Map<String, Object> indexerStats = (Map<String,Object>)((List<?>)XContentMapValues.extractValue("hits.hits._source.stats",
responseBody)) responseBody))
.get(0); .get(0);
@ -250,33 +265,37 @@ public class DataFrameSurvivesUpgradeIT extends AbstractUpgradeTestCase {
}); });
} }
private String getTransformEndpoint() {
return CLUSTER_TYPE == ClusterType.UPGRADED ? DATAFRAME_ENDPOINT : DATAFRAME_ENDPOINT_DEPRECATED;
}
private void putTransform(String id, TransformConfig config) throws IOException { private void putTransform(String id, TransformConfig config) throws IOException {
final Request createDataframeTransformRequest = new Request("PUT", DATAFRAME_ENDPOINT + id); final Request createDataframeTransformRequest = new Request("PUT", getTransformEndpoint() + id);
createDataframeTransformRequest.setJsonEntity(Strings.toString(config)); createDataframeTransformRequest.setJsonEntity(Strings.toString(config));
Response response = client().performRequest(createDataframeTransformRequest); Response response = client().performRequest(createDataframeTransformRequest);
assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals(200, response.getStatusLine().getStatusCode());
} }
private void deleteTransform(String id) throws IOException { private void deleteTransform(String id) throws IOException {
Response response = client().performRequest(new Request("DELETE", DATAFRAME_ENDPOINT + id)); Response response = client().performRequest(new Request("DELETE", getTransformEndpoint() + id));
assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals(200, response.getStatusLine().getStatusCode());
} }
private void startTransform(String id) throws IOException { private void startTransform(String id) throws IOException {
final Request startDataframeTransformRequest = new Request("POST", DATAFRAME_ENDPOINT + id + "/_start"); final Request startDataframeTransformRequest = new Request("POST", getTransformEndpoint() + id + "/_start");
Response response = client().performRequest(startDataframeTransformRequest); Response response = client().performRequest(startDataframeTransformRequest);
assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals(200, response.getStatusLine().getStatusCode());
} }
private void stopTransform(String id) throws IOException { private void stopTransform(String id) throws IOException {
final Request stopDataframeTransformRequest = new Request("POST", final Request stopDataframeTransformRequest = new Request("POST",
DATAFRAME_ENDPOINT + id + "/_stop?wait_for_completion=true"); getTransformEndpoint() + id + "/_stop?wait_for_completion=true");
Response response = client().performRequest(stopDataframeTransformRequest); Response response = client().performRequest(stopDataframeTransformRequest);
assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals(200, response.getStatusLine().getStatusCode());
} }
private TransformStats getTransformStats(String id) throws IOException { private TransformStats getTransformStats(String id) throws IOException {
final Request getStats = new Request("GET", DATAFRAME_ENDPOINT + id + "/_stats"); final Request getStats = new Request("GET", getTransformEndpoint() + id + "/_stats");
Response response = client().performRequest(getStats); Response response = client().performRequest(getStats);
assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals(200, response.getStatusLine().getStatusCode());
XContentType xContentType = XContentType.fromMediaTypeOrFormat(response.getEntity().getContentType().getValue()); XContentType xContentType = XContentType.fromMediaTypeOrFormat(response.getEntity().getContentType().getValue());

View File

@ -7,7 +7,7 @@
timeout: 70s timeout: 70s
- do: - do:
transform.put_transform: data_frame_transform_deprecated.put_transform:
transform_id: "mixed-simple-transform" transform_id: "mixed-simple-transform"
body: > body: >
{ {
@ -21,11 +21,11 @@
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.start_transform: data_frame_transform_deprecated.start_transform:
transform_id: "mixed-simple-transform" transform_id: "mixed-simple-transform"
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "mixed-simple-transform" transform_id: "mixed-simple-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "mixed-simple-transform" } - match: { transforms.0.id: "mixed-simple-transform" }
@ -34,13 +34,13 @@
#- match: { transforms.0.state: "/started|indexing|stopping|stopped/" } #- match: { transforms.0.state: "/started|indexing|stopping|stopped/" }
- do: - do:
transform.stop_transform: data_frame_transform_deprecated.stop_transform:
transform_id: "mixed-simple-transform" transform_id: "mixed-simple-transform"
wait_for_completion: true wait_for_completion: true
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "mixed-simple-transform" transform_id: "mixed-simple-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "mixed-simple-transform" } - match: { transforms.0.id: "mixed-simple-transform" }
@ -49,7 +49,7 @@
#- match: { transforms.0.state: "stopped" } #- match: { transforms.0.state: "stopped" }
- do: - do:
transform.put_transform: data_frame_transform_deprecated.put_transform:
transform_id: "mixed-complex-transform" transform_id: "mixed-complex-transform"
body: > body: >
{ {
@ -76,17 +76,17 @@
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform: data_frame_transform_deprecated.get_transform:
transform_id: "mixed-complex-transform" transform_id: "mixed-complex-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "mixed-complex-transform" } - match: { transforms.0.id: "mixed-complex-transform" }
- do: - do:
transform.start_transform: data_frame_transform_deprecated.start_transform:
transform_id: "mixed-complex-transform" transform_id: "mixed-complex-transform"
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "mixed-complex-transform" transform_id: "mixed-complex-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "mixed-complex-transform" } - match: { transforms.0.id: "mixed-complex-transform" }
@ -95,13 +95,13 @@
#- match: { transforms.0.state: "/started|indexing|stopping|stopped/" } #- match: { transforms.0.state: "/started|indexing|stopping|stopped/" }
- do: - do:
transform.stop_transform: data_frame_transform_deprecated.stop_transform:
transform_id: "mixed-complex-transform" transform_id: "mixed-complex-transform"
wait_for_completion: true wait_for_completion: true
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "mixed-complex-transform" transform_id: "mixed-complex-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "mixed-complex-transform" } - match: { transforms.0.id: "mixed-complex-transform" }
@ -118,7 +118,7 @@
timeout: 70s timeout: 70s
- do: - do:
transform.put_transform: data_frame_transform_deprecated.put_transform:
transform_id: "mixed-simple-continuous-transform" transform_id: "mixed-simple-continuous-transform"
body: > body: >
{ {
@ -138,7 +138,7 @@
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform: data_frame_transform_deprecated.get_transform:
transform_id: "mixed-simple-continuous-transform" transform_id: "mixed-simple-continuous-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "mixed-simple-continuous-transform" } - match: { transforms.0.id: "mixed-simple-continuous-transform" }
@ -148,24 +148,24 @@
- is_true: transforms.0.create_time - is_true: transforms.0.create_time
- do: - do:
transform.start_transform: data_frame_transform_deprecated.start_transform:
transform_id: "mixed-simple-continuous-transform" transform_id: "mixed-simple-continuous-transform"
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "mixed-simple-continuous-transform" transform_id: "mixed-simple-continuous-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "mixed-simple-continuous-transform" } - match: { transforms.0.id: "mixed-simple-continuous-transform" }
- match: { transforms.0.state: "/started|indexing/" } - match: { transforms.0.state: "/started|indexing/" }
- do: - do:
transform.stop_transform: data_frame_transform_deprecated.stop_transform:
transform_id: "mixed-simple-continuous-transform" transform_id: "mixed-simple-continuous-transform"
wait_for_completion: true wait_for_completion: true
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "mixed-simple-continuous-transform" transform_id: "mixed-simple-continuous-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "mixed-simple-continuous-transform" } - match: { transforms.0.id: "mixed-simple-continuous-transform" }
@ -180,7 +180,7 @@
timeout: 70s timeout: 70s
- do: - do:
transform.get_transform: data_frame_transform_deprecated.get_transform:
transform_id: "old-simple-transform" transform_id: "old-simple-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-simple-transform" } - match: { transforms.0.id: "old-simple-transform" }
@ -190,11 +190,11 @@
- match: { transforms.0.pivot.aggregations.avg_response.avg.field: "responsetime" } - match: { transforms.0.pivot.aggregations.avg_response.avg.field: "responsetime" }
- do: - do:
transform.start_transform: data_frame_transform_deprecated.start_transform:
transform_id: "old-simple-transform" transform_id: "old-simple-transform"
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "old-simple-transform" transform_id: "old-simple-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-simple-transform" } - match: { transforms.0.id: "old-simple-transform" }
@ -203,12 +203,12 @@
#- match: { transforms.0.state: "/started|indexing|stopping|stopped/" } #- match: { transforms.0.state: "/started|indexing|stopping|stopped/" }
- do: - do:
transform.stop_transform: data_frame_transform_deprecated.stop_transform:
transform_id: "old-simple-transform" transform_id: "old-simple-transform"
wait_for_completion: true wait_for_completion: true
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "old-simple-transform" transform_id: "old-simple-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-simple-transform" } - match: { transforms.0.id: "old-simple-transform" }
@ -217,7 +217,7 @@
#- match: { transforms.0.state: "stopped" } #- match: { transforms.0.state: "stopped" }
- do: - do:
transform.get_transform: data_frame_transform_deprecated.get_transform:
transform_id: "old-complex-transform" transform_id: "old-complex-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-complex-transform" } - match: { transforms.0.id: "old-complex-transform" }
@ -229,11 +229,11 @@
- match: { transforms.0.pivot.aggregations.avg_response.avg.field: "responsetime" } - match: { transforms.0.pivot.aggregations.avg_response.avg.field: "responsetime" }
- do: - do:
transform.start_transform: data_frame_transform_deprecated.start_transform:
transform_id: "old-complex-transform" transform_id: "old-complex-transform"
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "old-complex-transform" transform_id: "old-complex-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-complex-transform" } - match: { transforms.0.id: "old-complex-transform" }
@ -242,12 +242,12 @@
#- match: { transforms.0.state: "/started|indexing|stopping|stopped/" } #- match: { transforms.0.state: "/started|indexing|stopping|stopped/" }
- do: - do:
transform.stop_transform: data_frame_transform_deprecated.stop_transform:
transform_id: "old-complex-transform" transform_id: "old-complex-transform"
wait_for_completion: true wait_for_completion: true
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "old-complex-transform" transform_id: "old-complex-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-complex-transform" } - match: { transforms.0.id: "old-complex-transform" }
@ -264,7 +264,7 @@
timeout: 70s timeout: 70s
- do: - do:
transform.get_transform: data_frame_transform_deprecated.get_transform:
transform_id: "old-simple-continuous-transform" transform_id: "old-simple-continuous-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-simple-continuous-transform" } - match: { transforms.0.id: "old-simple-continuous-transform" }
@ -274,24 +274,24 @@
- is_true: transforms.0.create_time - is_true: transforms.0.create_time
- do: - do:
transform.start_transform: data_frame_transform_deprecated.start_transform:
transform_id: "old-simple-continuous-transform" transform_id: "old-simple-continuous-transform"
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "old-simple-continuous-transform" transform_id: "old-simple-continuous-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-simple-continuous-transform" } - match: { transforms.0.id: "old-simple-continuous-transform" }
- match: { transforms.0.state: "/started|indexing/" } - match: { transforms.0.state: "/started|indexing/" }
- do: - do:
transform.stop_transform: data_frame_transform_deprecated.stop_transform:
transform_id: "old-simple-continuous-transform" transform_id: "old-simple-continuous-transform"
wait_for_completion: true wait_for_completion: true
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "old-simple-continuous-transform" transform_id: "old-simple-continuous-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-simple-continuous-transform" } - match: { transforms.0.id: "old-simple-continuous-transform" }

View File

@ -21,7 +21,7 @@
timeout: 70s timeout: 70s
- do: - do:
transform.put_transform: data_frame_transform_deprecated.put_transform:
transform_id: "old-simple-transform" transform_id: "old-simple-transform"
body: > body: >
{ {
@ -35,35 +35,35 @@
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform: data_frame_transform_deprecated.get_transform:
transform_id: "old-simple-transform" transform_id: "old-simple-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-simple-transform" } - match: { transforms.0.id: "old-simple-transform" }
- do: - do:
transform.start_transform: data_frame_transform_deprecated.start_transform:
transform_id: "old-simple-transform" transform_id: "old-simple-transform"
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "old-simple-transform" transform_id: "old-simple-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-simple-transform" } - match: { transforms.0.id: "old-simple-transform" }
- do: - do:
transform.stop_transform: data_frame_transform_deprecated.stop_transform:
transform_id: "old-simple-transform" transform_id: "old-simple-transform"
wait_for_completion: true wait_for_completion: true
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "old-simple-transform" transform_id: "old-simple-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-simple-transform" } - match: { transforms.0.id: "old-simple-transform" }
- do: - do:
transform.put_transform: data_frame_transform_deprecated.put_transform:
transform_id: "old-complex-transform" transform_id: "old-complex-transform"
body: > body: >
{ {
@ -90,29 +90,29 @@
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform: data_frame_transform_deprecated.get_transform:
transform_id: "old-complex-transform" transform_id: "old-complex-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-complex-transform" } - match: { transforms.0.id: "old-complex-transform" }
- do: - do:
transform.start_transform: data_frame_transform_deprecated.start_transform:
transform_id: "old-complex-transform" transform_id: "old-complex-transform"
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "old-complex-transform" transform_id: "old-complex-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-complex-transform" } - match: { transforms.0.id: "old-complex-transform" }
- do: - do:
transform.stop_transform: data_frame_transform_deprecated.stop_transform:
transform_id: "old-complex-transform" transform_id: "old-complex-transform"
wait_for_completion: true wait_for_completion: true
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "old-complex-transform" transform_id: "old-complex-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-complex-transform" } - match: { transforms.0.id: "old-complex-transform" }
@ -140,7 +140,7 @@
timeout: 70s timeout: 70s
- do: - do:
transform.put_transform: data_frame_transform_deprecated.put_transform:
transform_id: "old-simple-continuous-transform" transform_id: "old-simple-continuous-transform"
body: > body: >
{ {
@ -160,7 +160,7 @@
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform: data_frame_transform_deprecated.get_transform:
transform_id: "old-simple-continuous-transform" transform_id: "old-simple-continuous-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-simple-continuous-transform" } - match: { transforms.0.id: "old-simple-continuous-transform" }
@ -170,23 +170,23 @@
- is_true: transforms.0.create_time - is_true: transforms.0.create_time
- do: - do:
transform.start_transform: data_frame_transform_deprecated.start_transform:
transform_id: "old-simple-continuous-transform" transform_id: "old-simple-continuous-transform"
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "old-simple-continuous-transform" transform_id: "old-simple-continuous-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-simple-continuous-transform" } - match: { transforms.0.id: "old-simple-continuous-transform" }
- do: - do:
transform.stop_transform: data_frame_transform_deprecated.stop_transform:
transform_id: "old-simple-continuous-transform" transform_id: "old-simple-continuous-transform"
wait_for_completion: true wait_for_completion: true
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
transform.get_transform_stats: data_frame_transform_deprecated.get_transform_stats:
transform_id: "old-simple-continuous-transform" transform_id: "old-simple-continuous-transform"
- match: { count: 1 } - match: { count: 1 }
- match: { transforms.0.id: "old-simple-continuous-transform" } - match: { transforms.0.id: "old-simple-continuous-transform" }