Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add non-X-Pack centric rollup endpoints #36383

Merged
merged 3 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@

public class Rollup extends Plugin implements ActionPlugin, PersistentTaskPlugin {

public static final String BASE_PATH = "/_xpack/rollup/";

// Introduced in ES version 6.3
public static final int ROLLUP_VERSION_V1 = 1;
// Introduced in ES Version 6.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* 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.rollup.rest;

package org.elasticsearch.xpack.rollup.rest;

import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.ParseField;
Expand All @@ -15,16 +15,17 @@
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.rollup.action.DeleteRollupJobAction;
import org.elasticsearch.xpack.rollup.Rollup;

import java.io.IOException;

public class RestDeleteRollupJobAction extends BaseRestHandler {

public static final ParseField ID = new ParseField("id");

public RestDeleteRollupJobAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.DELETE, Rollup.BASE_PATH + "job/{id}/", this);
controller.registerHandler(RestRequest.Method.DELETE, "/_xpack/rollup/job/{id}/", this);
controller.registerHandler(RestRequest.Method.DELETE, "/_rollup/job/{id}/", this);
}

@Override
Expand All @@ -48,4 +49,5 @@ protected RestStatus getStatus(DeleteRollupJobAction.Response response) {
public String getName() {
return "rollup_delete_job_action";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.rollup.rest;

import org.elasticsearch.client.node.NodeClient;
Expand All @@ -13,16 +14,17 @@
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.rollup.action.GetRollupCapsAction;
import org.elasticsearch.xpack.rollup.Rollup;

import java.io.IOException;

public class RestGetRollupCapsAction extends BaseRestHandler {

public static final ParseField ID = new ParseField("id");

public RestGetRollupCapsAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.GET, Rollup.BASE_PATH + "data/{id}/", this);
controller.registerHandler(RestRequest.Method.GET, "/_xpack/rollup/data/{id}/", this);
controller.registerHandler(RestRequest.Method.GET, "/_rollup/data/{id}/", this);
}

@Override
Expand All @@ -37,4 +39,5 @@ protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient
public String getName() {
return "rollup_get_caps_action";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.rollup.rest;

import org.elasticsearch.action.support.IndicesOptions;
Expand All @@ -17,11 +18,13 @@
import org.elasticsearch.xpack.core.rollup.action.GetRollupIndexCapsAction;

public class RestGetRollupIndexCapsAction extends BaseRestHandler {

public static final ParseField INDEX = new ParseField("index");

public RestGetRollupIndexCapsAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.GET, "/{index}/_xpack/rollup/data", this);
controller.registerHandler(RestRequest.Method.GET, "/{index}/_rollup/data", this);
}

@Override
Expand All @@ -37,4 +40,5 @@ protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient
public String getName() {
return "rollup_get_caps_action";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.rollup.rest;

import org.elasticsearch.client.node.NodeClient;
Expand All @@ -13,14 +14,15 @@
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.rollup.action.GetRollupJobsAction;
import org.elasticsearch.xpack.rollup.Rollup;

public class RestGetRollupJobsAction extends BaseRestHandler {

public static final ParseField ID = new ParseField("id");

public RestGetRollupJobsAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.GET, Rollup.BASE_PATH + "job/{id}/", this);
controller.registerHandler(RestRequest.Method.GET, "/_xpack/rollup/job/{id}/", this);
controller.registerHandler(RestRequest.Method.GET, "/_rollup/job/{id}/", this);
}

@Override
Expand All @@ -35,4 +37,5 @@ protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient
public String getName() {
return "rollup_get_job_action";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* 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.rollup.rest;

package org.elasticsearch.xpack.rollup.rest;

import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.settings.Settings;
Expand All @@ -13,15 +13,15 @@
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.rollup.action.PutRollupJobAction;
import org.elasticsearch.xpack.rollup.Rollup;

import java.io.IOException;

public class RestPutRollupJobAction extends BaseRestHandler {

public RestPutRollupJobAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.PUT, Rollup.BASE_PATH + "job/{id}/", this);
controller.registerHandler(RestRequest.Method.PUT, "/_xpack/rollup/job/{id}/", this);
controller.registerHandler(RestRequest.Method.PUT, "/_rollup/job/{id}/", this);
}

@Override
Expand All @@ -35,4 +35,5 @@ protected RestChannelConsumer prepareRequest(final RestRequest request, final No
public String getName() {
return "rollup_put_job_action";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.rollup.rest;

import org.elasticsearch.client.node.NodeClient;
Expand All @@ -13,15 +14,15 @@
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.rollup.RollupField;
import org.elasticsearch.xpack.core.rollup.action.StartRollupJobAction;
import org.elasticsearch.xpack.rollup.Rollup;

import java.io.IOException;

public class RestStartRollupJobAction extends BaseRestHandler {

public RestStartRollupJobAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.POST, Rollup.BASE_PATH + "job/{id}/_start", this);
controller.registerHandler(RestRequest.Method.POST, "/_xpack/rollup/job/{id}/_start", this);
controller.registerHandler(RestRequest.Method.POST, "/_rollup/job/{id}/_start", this);
}

@Override
Expand All @@ -36,4 +37,5 @@ protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient
public String getName() {
return "rollup_start_job_action";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.rollup.rest;

import org.elasticsearch.client.node.NodeClient;
Expand All @@ -14,13 +15,13 @@
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.rollup.RollupField;
import org.elasticsearch.xpack.core.rollup.action.StopRollupJobAction;
import org.elasticsearch.xpack.rollup.Rollup;

public class RestStopRollupJobAction extends BaseRestHandler {

public RestStopRollupJobAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.POST, Rollup.BASE_PATH + "job/{id}/_stop", this);
controller.registerHandler(RestRequest.Method.POST, "/_xpack/rollup/job/{id}/_stop", this);
controller.registerHandler(RestRequest.Method.POST, "/_rollup/job/{id}/_stop", this);
}

@Override
Expand All @@ -37,4 +38,5 @@ protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient
public String getName() {
return "rollup_stop_job_action";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"methods": [ "DELETE" ],
"url": {
"path": "/_xpack/rollup/job/{id}",
"paths": [ "/_xpack/rollup/job/{id}" ],
"paths": [ "/_xpack/rollup/job/{id}", "/_rollup/job/{id}" ],
"parts": {
"id": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"methods": [ "GET" ],
"url": {
"path": "/_xpack/rollup/job/{id}",
"paths": [ "/_xpack/rollup/job/{id}", "/_xpack/rollup/job/" ],
"paths": [ "/_xpack/rollup/job/{id}", "/_xpack/rollup/job/", "/_rollup/job/{id}", "/_rollup/job/"],
"parts": {
"id": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"methods": [ "GET" ],
"url": {
"path": "/_xpack/rollup/data/{id}",
"paths": [ "/_xpack/rollup/data/{id}", "/_xpack/rollup/data/" ],
"paths": [ "/_xpack/rollup/data/{id}", "/_xpack/rollup/data/", "/_rollup/data/{id}", "/_rollup/data/" ],
"parts": {
"id": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"methods": [ "GET" ],
"url": {
"path": "/{index}/_xpack/rollup/data",
"paths": [ "/{index}/_xpack/rollup/data" ],
"paths": [ "/{index}/_xpack/rollup/data", "/{index}/_rollup/data" ],
"parts": {
"index": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"methods": [ "PUT" ],
"url": {
"path": "/_xpack/rollup/job/{id}",
"paths": [ "/_xpack/rollup/job/{id}" ],
"paths": [ "/_xpack/rollup/job/{id}", "/_rollup/job/{id}" ],
"parts": {
"id": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"methods": [ "POST" ],
"url": {
"path": "/_xpack/rollup/job/{id}/_start",
"paths": [ "/_xpack/rollup/job/{id}/_start" ],
"paths": [ "/_xpack/rollup/job/{id}/_start", "/_rollup/job/{id}/_start" ],
"parts": {
"id": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"methods": [ "POST" ],
"url": {
"path": "/_xpack/rollup/job/{id}/_stop",
"paths": [ "/_xpack/rollup/job/{id}/_stop" ],
"paths": [ "/_xpack/rollup/job/{id}/_stop", "/_rollup/job/{id}/_stop" ],
"parts": {
"id": {
"type": "string",
Expand Down