Adds nodes usage action to known actions list (elastic/x-pack-elasticsearch#1111)
* Adds nodes usage action to known actions list * Adds name to all rest actions Original commit: elastic/x-pack-elasticsearch@77ae827a66
This commit is contained in:
parent
261bf8d78d
commit
36b8fe9b29
|
@ -30,6 +30,11 @@ public class RestDeleteLicenseAction extends XPackRestHandler {
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_delete_license_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(final RestRequest request, final XPackClient client) throws IOException {
|
||||
return channel -> client.es().admin().cluster().execute(DeleteLicenseAction.INSTANCE,
|
||||
|
|
|
@ -41,6 +41,11 @@ public class RestGetLicenseAction extends XPackRestHandler {
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_get_license_action";
|
||||
}
|
||||
|
||||
/**
|
||||
* There will be only one license displayed per feature, the selected license will have the latest expiry_date
|
||||
* out of all other licenses for the feature.
|
||||
|
|
|
@ -42,6 +42,11 @@ public class RestPutLicenseAction extends XPackRestHandler {
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_put_license_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(final RestRequest request, final XPackClient client) throws IOException {
|
||||
PutLicenseRequest putLicenseRequest = new PutLicenseRequest();
|
||||
|
|
|
@ -69,6 +69,11 @@ public class RestGraphAction extends XPackRestHandler {
|
|||
POST, "/{index}/{type}" + URI_BASE + "/_graph/_explore", deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_graph_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(final RestRequest request, final XPackClient client) throws IOException {
|
||||
GraphExploreRequest graphRequest = new GraphExploreRequest(Strings.splitStringByCommaToArray(request.param("index")));
|
||||
|
|
|
@ -23,6 +23,11 @@ public class RestDeleteExpiredDataAction extends BaseRestHandler {
|
|||
controller.registerHandler(RestRequest.Method.DELETE, MachineLearning.BASE_PATH + "_delete_expired_data", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_delete_expired_data_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
DeleteExpiredDataAction.Request request = new DeleteExpiredDataAction.Request();
|
||||
|
|
|
@ -25,6 +25,11 @@ public class RestDeleteDatafeedAction extends BaseRestHandler {
|
|||
+ DatafeedConfig.ID.getPreferredName() + "}", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_delete_datafeed_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String datafeedId = restRequest.param(DatafeedConfig.ID.getPreferredName());
|
||||
|
|
|
@ -28,6 +28,11 @@ public class RestGetDatafeedStatsAction extends BaseRestHandler {
|
|||
+ "datafeeds/_stats", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_get_datafeed_stats_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String datafeedId = restRequest.param(DatafeedConfig.ID.getPreferredName());
|
||||
|
|
|
@ -27,6 +27,11 @@ public class RestGetDatafeedsAction extends BaseRestHandler {
|
|||
+ "datafeeds", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_get_datafeeds_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String datafeedId = restRequest.param(DatafeedConfig.ID.getPreferredName());
|
||||
|
|
|
@ -25,6 +25,11 @@ public class RestPreviewDatafeedAction extends BaseRestHandler {
|
|||
MachineLearning.BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_preview", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_preview_datafeed_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String datafeedId = restRequest.param(DatafeedConfig.ID.getPreferredName());
|
||||
|
|
|
@ -26,6 +26,11 @@ public class RestPutDatafeedAction extends BaseRestHandler {
|
|||
+ DatafeedConfig.ID.getPreferredName() + "}", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_put_datafeed_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String datafeedId = restRequest.param(DatafeedConfig.ID.getPreferredName());
|
||||
|
|
|
@ -33,6 +33,11 @@ public class RestStartDatafeedAction extends BaseRestHandler {
|
|||
MachineLearning.BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_start", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_start_datafeed_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String datafeedId = restRequest.param(DatafeedConfig.ID.getPreferredName());
|
||||
|
|
|
@ -32,6 +32,11 @@ public class RestStopDatafeedAction extends BaseRestHandler {
|
|||
+ DatafeedConfig.ID.getPreferredName() + "}/_stop", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_stop_datafeed_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String datafeedId = restRequest.param(DatafeedConfig.ID.getPreferredName());
|
||||
|
|
|
@ -26,6 +26,11 @@ public class RestUpdateDatafeedAction extends BaseRestHandler {
|
|||
+ DatafeedConfig.ID.getPreferredName() + "}/_update", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_update_datafeed_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String datafeedId = restRequest.param(DatafeedConfig.ID.getPreferredName());
|
||||
|
|
|
@ -25,6 +25,11 @@ public class RestDeleteFilterAction extends BaseRestHandler {
|
|||
MachineLearning.BASE_PATH + "filters/{" + Request.FILTER_ID.getPreferredName() + "}", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_delete_filter_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
Request request = new Request(restRequest.param(Request.FILTER_ID.getPreferredName()));
|
||||
|
|
|
@ -28,6 +28,11 @@ public class RestGetFiltersAction extends BaseRestHandler {
|
|||
controller.registerHandler(RestRequest.Method.GET, MachineLearning.BASE_PATH + "filters/", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_get_filters_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
GetFiltersAction.Request getListRequest = new GetFiltersAction.Request();
|
||||
|
|
|
@ -26,6 +26,11 @@ public class RestPutFilterAction extends BaseRestHandler {
|
|||
MachineLearning.BASE_PATH + "filters/{" + MlFilter.ID.getPreferredName() + "}", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_put_filter_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String filterId = restRequest.param(MlFilter.ID.getPreferredName());
|
||||
|
|
|
@ -27,6 +27,11 @@ public class RestCloseJobAction extends BaseRestHandler {
|
|||
+ "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_close", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_close_job_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
Request request = new Request(restRequest.param(Job.ID.getPreferredName()));
|
||||
|
|
|
@ -25,6 +25,11 @@ public class RestDeleteJobAction extends BaseRestHandler {
|
|||
+ "anomaly_detectors/{" + Job.ID.getPreferredName() + "}", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_delete_job_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
DeleteJobAction.Request deleteJobRequest = new DeleteJobAction.Request(restRequest.param(Job.ID.getPreferredName()));
|
||||
|
|
|
@ -31,6 +31,11 @@ public class RestFlushJobAction extends BaseRestHandler {
|
|||
+ "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_flush", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_flush_job_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String jobId = restRequest.param(Job.ID.getPreferredName());
|
||||
|
|
|
@ -28,6 +28,11 @@ public class RestGetJobStatsAction extends BaseRestHandler {
|
|||
+ "anomaly_detectors/_stats", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_get_job_stats_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String jobId = restRequest.param(Job.ID.getPreferredName());
|
||||
|
|
|
@ -29,6 +29,11 @@ public class RestGetJobsAction extends BaseRestHandler {
|
|||
+ "anomaly_detectors", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_get_jobs_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String jobId = restRequest.param(Job.ID.getPreferredName());
|
||||
|
|
|
@ -30,6 +30,11 @@ public class RestOpenJobAction extends BaseRestHandler {
|
|||
+ "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_open", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_open_job_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
OpenJobAction.Request request;
|
||||
|
|
|
@ -28,6 +28,11 @@ public class RestPostDataAction extends BaseRestHandler {
|
|||
+ "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_data", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_post_data_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
PostDataAction.Request request = new PostDataAction.Request(restRequest.param(Job.ID.getPreferredName()));
|
||||
|
|
|
@ -25,6 +25,11 @@ public class RestPostJobUpdateAction extends BaseRestHandler {
|
|||
MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_update", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_post_job_update_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String jobId = restRequest.param(Job.ID.getPreferredName());
|
||||
|
|
|
@ -26,6 +26,11 @@ public class RestPutJobAction extends BaseRestHandler {
|
|||
MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_put_job_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String jobId = restRequest.param(Job.ID.getPreferredName());
|
||||
|
|
|
@ -26,6 +26,11 @@ public class RestDeleteModelSnapshotAction extends BaseRestHandler {
|
|||
+ Job.ID.getPreferredName() + "}/model_snapshots/{" + ModelSnapshot.SNAPSHOT_ID.getPreferredName() + "}", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_delete_model_snapshot_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
DeleteModelSnapshotAction.Request deleteModelSnapshot = new DeleteModelSnapshotAction.Request(
|
||||
|
|
|
@ -48,6 +48,11 @@ public class RestGetModelSnapshotsAction extends BaseRestHandler {
|
|||
+ Job.ID.getPreferredName() + "}/model_snapshots", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_get_model_snapshot_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String jobId = restRequest.param(Job.ID.getPreferredName());
|
||||
|
|
|
@ -29,6 +29,11 @@ public class RestRevertModelSnapshotAction extends BaseRestHandler {
|
|||
RevertModelSnapshotAction.Request.SNAPSHOT_ID.getPreferredName() + "}/_revert", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_revert_model_snapshot_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String jobId = restRequest.param(Job.ID.getPreferredName());
|
||||
|
|
|
@ -28,6 +28,11 @@ public class RestUpdateModelSnapshotAction extends BaseRestHandler {
|
|||
this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_update_model_snapshot_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
XContentParser parser = restRequest.contentParser();
|
||||
|
|
|
@ -37,6 +37,11 @@ public class RestGetBucketsAction extends BaseRestHandler {
|
|||
MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/buckets", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_get_buckets_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String jobId = restRequest.param(Job.ID.getPreferredName());
|
||||
|
|
|
@ -37,6 +37,11 @@ public class RestGetCategoriesAction extends BaseRestHandler {
|
|||
MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/categories", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_get_catagories_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
Request request;
|
||||
|
|
|
@ -30,6 +30,11 @@ public class RestGetInfluencersAction extends BaseRestHandler {
|
|||
MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/influencers", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_get_influencers_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String jobId = restRequest.param(Job.ID.getPreferredName());
|
||||
|
|
|
@ -14,9 +14,9 @@ import org.elasticsearch.rest.RestRequest;
|
|||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
import org.elasticsearch.xpack.ml.MachineLearning;
|
||||
import org.elasticsearch.xpack.ml.action.GetRecordsAction;
|
||||
import org.elasticsearch.xpack.ml.action.util.PageParams;
|
||||
import org.elasticsearch.xpack.ml.job.config.Job;
|
||||
import org.elasticsearch.xpack.ml.job.results.AnomalyRecord;
|
||||
import org.elasticsearch.xpack.ml.action.util.PageParams;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -30,6 +30,11 @@ public class RestGetRecordsAction extends BaseRestHandler {
|
|||
+ Job.ID.getPreferredName() + "}/results/records", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_get_records_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
String jobId = restRequest.param(Job.ID.getPreferredName());
|
||||
|
|
|
@ -24,6 +24,11 @@ public class RestValidateDetectorAction extends BaseRestHandler {
|
|||
controller.registerHandler(RestRequest.Method.POST, MachineLearning.BASE_PATH + "anomaly_detectors/_validate/detector", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_validate_detector_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
XContentParser parser = restRequest.contentOrSourceParamParser();
|
||||
|
|
|
@ -24,6 +24,11 @@ public class RestValidateJobConfigAction extends BaseRestHandler {
|
|||
controller.registerHandler(RestRequest.Method.POST, MachineLearning.BASE_PATH + "anomaly_detectors/_validate", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_ml_validate_job_config_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
|
||||
XContentParser parser = restRequest.contentOrSourceParamParser();
|
||||
|
|
|
@ -38,6 +38,11 @@ public class RestMonitoringBulkAction extends MonitoringRestHandler {
|
|||
controller.registerHandler(PUT, URI_BASE + "/{type}/_bulk", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_monitoring_bulk_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(RestRequest request, XPackClient client) throws IOException {
|
||||
String defaultType = request.param("type");
|
||||
|
|
|
@ -31,6 +31,11 @@ public class RestXPackInfoAction extends XPackRestHandler {
|
|||
controller.registerHandler(GET, URI_BASE, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_info_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(RestRequest request, XPackClient client) throws IOException {
|
||||
|
||||
|
|
|
@ -31,6 +31,11 @@ public class RestXPackUsageAction extends XPackRestHandler {
|
|||
controller.registerHandler(GET, URI_BASE + "/usage", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_usage_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(RestRequest request, XPackClient client) throws IOException {
|
||||
final TimeValue masterTimeout = request.paramAsTime("master_timeout", MasterNodeRequest.DEFAULT_MASTER_NODE_TIMEOUT);
|
||||
|
|
|
@ -43,6 +43,11 @@ public class RestAuthenticateAction extends SecurityBaseRestHandler {
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_authenticate_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
final User user = securityContext.getUser();
|
||||
|
|
|
@ -58,6 +58,11 @@ public final class RestGetTokenAction extends SecurityBaseRestHandler {
|
|||
controller.registerHandler(POST, "/_xpack/security/oauth2/token", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_get_token_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client)throws IOException {
|
||||
try (XContentParser parser = request.contentParser()) {
|
||||
|
|
|
@ -43,6 +43,11 @@ public final class RestInvalidateTokenAction extends SecurityBaseRestHandler {
|
|||
controller.registerHandler(DELETE, "/_xpack/security/oauth2/token", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_invalidate_token_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
try (XContentParser parser = request.contentParser()) {
|
||||
|
|
|
@ -36,6 +36,11 @@ public final class RestClearRealmCacheAction extends SecurityBaseRestHandler {
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_clear_realm_cache_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
String[] realms = request.paramAsStringArrayOrEmptyIfAll("realms");
|
||||
|
|
|
@ -32,6 +32,11 @@ public final class RestClearRolesCacheAction extends SecurityBaseRestHandler {
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_clear_roles_cache_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
String[] roles = request.paramAsStringArrayOrEmptyIfAll("name");
|
||||
|
|
|
@ -39,6 +39,11 @@ public class RestDeleteRoleAction extends SecurityBaseRestHandler {
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_delete_role_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
final String name = request.param("name");
|
||||
|
|
|
@ -45,6 +45,11 @@ public class RestGetRolesAction extends SecurityBaseRestHandler {
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_get_roles_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
final String[] roles = request.paramAsStringArray("name", Strings.EMPTY_ARRAY);
|
||||
|
|
|
@ -46,6 +46,11 @@ public class RestPutRoleAction extends SecurityBaseRestHandler {
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_put_role_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
PutRoleRequestBuilder requestBuilder = new SecurityClient(client)
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.rolemapping;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
@ -21,6 +19,8 @@ import org.elasticsearch.xpack.security.action.rolemapping.DeleteRoleMappingResp
|
|||
import org.elasticsearch.xpack.security.client.SecurityClient;
|
||||
import org.elasticsearch.xpack.security.rest.action.SecurityBaseRestHandler;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
/**
|
||||
|
@ -33,6 +33,11 @@ public class RestDeleteRoleMappingAction extends SecurityBaseRestHandler {
|
|||
controller.registerHandler(DELETE, "/_xpack/security/role_mapping/{name}", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_delete_role_mapping_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
final String name = request.param("name");
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.rolemapping;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
@ -22,6 +20,8 @@ import org.elasticsearch.xpack.security.authc.support.mapper.ExpressionRoleMappi
|
|||
import org.elasticsearch.xpack.security.client.SecurityClient;
|
||||
import org.elasticsearch.xpack.security.rest.action.SecurityBaseRestHandler;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
/**
|
||||
|
@ -35,6 +35,11 @@ public class RestGetRoleMappingsAction extends SecurityBaseRestHandler {
|
|||
controller.registerHandler(GET, "/_xpack/security/role_mapping/{name}", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_get_role_mappings_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
final String[] names = request.paramAsStringArrayOrEmptyIfAll("name");
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.rolemapping;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
@ -22,6 +20,8 @@ import org.elasticsearch.xpack.security.action.rolemapping.PutRoleMappingRespons
|
|||
import org.elasticsearch.xpack.security.client.SecurityClient;
|
||||
import org.elasticsearch.xpack.security.rest.action.SecurityBaseRestHandler;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
|
||||
|
@ -38,6 +38,11 @@ public class RestPutRoleMappingAction extends SecurityBaseRestHandler {
|
|||
controller.registerHandler(PUT, "/_xpack/security/role_mapping/{name}", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_put_role_mappings_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
final String name = request.param("name");
|
||||
|
|
|
@ -43,6 +43,11 @@ public class RestChangePasswordAction extends SecurityBaseRestHandler implements
|
|||
controller.registerHandler(PUT, "/_xpack/security/user/_password", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_change_password_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
final User user = securityContext.getUser();
|
||||
|
|
|
@ -39,6 +39,11 @@ public class RestDeleteUserAction extends SecurityBaseRestHandler {
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_delete_user_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
final String username = request.param("username");
|
||||
|
|
|
@ -46,6 +46,11 @@ public class RestGetUsersAction extends SecurityBaseRestHandler {
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_get_users_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
String[] usernames = request.paramAsStringArray("username", Strings.EMPTY_ARRAY);
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.user;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
@ -23,7 +21,8 @@ import org.elasticsearch.xpack.security.action.user.HasPrivilegesRequestBuilder;
|
|||
import org.elasticsearch.xpack.security.action.user.HasPrivilegesResponse;
|
||||
import org.elasticsearch.xpack.security.client.SecurityClient;
|
||||
import org.elasticsearch.xpack.security.rest.action.SecurityBaseRestHandler;
|
||||
import org.elasticsearch.xpack.security.user.User;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
@ -46,6 +45,11 @@ public class RestHasPrivilegesAction extends SecurityBaseRestHandler {
|
|||
controller.registerHandler(POST, "/_xpack/security/user/_has_privileges", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_has_priviledges_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
final String username = getUsername(request);
|
||||
|
|
|
@ -50,6 +50,11 @@ public class RestPutUserAction extends SecurityBaseRestHandler implements RestRe
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_put_user_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
PutUserRequestBuilder requestBuilder = new SecurityClient(client)
|
||||
|
|
|
@ -9,7 +9,6 @@ import org.elasticsearch.client.node.NodeClient;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -39,6 +38,11 @@ public class RestSetEnabledAction extends SecurityBaseRestHandler {
|
|||
controller.registerHandler(PUT, "/_xpack/security/user/{username}/_disable", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_security_set_enabled_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
final boolean enabled = request.path().endsWith("_enable");
|
||||
|
|
|
@ -53,6 +53,11 @@ public class RestAckWatchAction extends WatcherRestHandler {
|
|||
deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_ack_watch_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(RestRequest request, WatcherClient client) throws IOException {
|
||||
AckWatchRequest ackWatchRequest = new AckWatchRequest(request.param("id"));
|
||||
|
|
|
@ -45,6 +45,11 @@ public class RestActivateWatchAction extends WatcherRestHandler {
|
|||
PUT, "/_watcher/watch/{id}/_deactivate", deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_activate_watch_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(RestRequest request, WatcherClient client) throws IOException {
|
||||
String watchId = request.param("id");
|
||||
|
@ -65,6 +70,11 @@ public class RestActivateWatchAction extends WatcherRestHandler {
|
|||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_deactivate_watch_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(RestRequest request, WatcherClient client) throws IOException {
|
||||
String watchId = request.param("id");
|
||||
|
|
|
@ -32,6 +32,11 @@ public class RestDeleteWatchAction extends WatcherRestHandler {
|
|||
DELETE, "/_watcher/watch/{id}", deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_delete_watch_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer doPrepareRequest(final RestRequest request, WatcherClient client) throws IOException {
|
||||
DeleteWatchRequest deleteWatchRequest = new DeleteWatchRequest(request.param("id"));
|
||||
|
|
|
@ -52,6 +52,11 @@ public class RestExecuteWatchAction extends WatcherRestHandler implements RestRe
|
|||
PUT, "/_watcher/watch/_execute", deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_execute_watch_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer doPrepareRequest(final RestRequest request, WatcherClient client) throws IOException {
|
||||
ExecuteWatchRequest executeWatchRequest = parseRequest(request, client);
|
||||
|
|
|
@ -34,6 +34,11 @@ public class RestGetWatchAction extends WatcherRestHandler {
|
|||
GET, "/_watcher/watch/{id}", deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_get_watch_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer doPrepareRequest(final RestRequest request, WatcherClient client) throws IOException {
|
||||
final GetWatchRequest getWatchRequest = new GetWatchRequest(request.param("id"));
|
||||
|
|
|
@ -49,6 +49,11 @@ public class RestHijackOperationAction extends WatcherRestHandler {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_hijack_operation_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(RestRequest request, WatcherClient client) throws IOException {
|
||||
// we have to consume the id parameter lest the request will fail for the wrong reason
|
||||
|
@ -73,6 +78,11 @@ public class RestHijackOperationAction extends WatcherRestHandler {
|
|||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_unsupported_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(RestRequest request, WatcherClient client) throws IOException {
|
||||
// we have to consume the id parameter lest the request will fail for the wrong reason
|
||||
|
|
|
@ -41,6 +41,11 @@ public class RestPutWatchAction extends WatcherRestHandler implements RestReques
|
|||
PUT, "/_watcher/watch/{id}", deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_put_watch_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer doPrepareRequest(final RestRequest request, WatcherClient client) throws IOException {
|
||||
PutWatchRequest putWatchRequest =
|
||||
|
|
|
@ -35,6 +35,11 @@ public class RestWatchServiceAction extends WatcherRestHandler {
|
|||
new StopRestHandler(settings), PUT, "/_watcher/_stop", deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_service_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(RestRequest request, WatcherClient client)
|
||||
throws IOException {
|
||||
|
@ -58,6 +63,11 @@ public class RestWatchServiceAction extends WatcherRestHandler {
|
|||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_start_service_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(RestRequest request, WatcherClient client)
|
||||
throws IOException {
|
||||
|
@ -72,6 +82,11 @@ public class RestWatchServiceAction extends WatcherRestHandler {
|
|||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_stop_service_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer doPrepareRequest(RestRequest request, WatcherClient client)
|
||||
throws IOException {
|
||||
|
|
|
@ -13,7 +13,6 @@ import org.elasticsearch.rest.action.RestActions;
|
|||
import org.elasticsearch.xpack.watcher.client.WatcherClient;
|
||||
import org.elasticsearch.xpack.watcher.rest.WatcherRestHandler;
|
||||
import org.elasticsearch.xpack.watcher.transport.actions.stats.WatcherStatsRequest;
|
||||
import org.elasticsearch.xpack.watcher.transport.actions.stats.WatcherStatsResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
@ -31,6 +30,11 @@ public class RestWatcherStatsAction extends WatcherRestHandler {
|
|||
GET, "/_watcher/stats/{metric}", deprecationLogger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "xpack_watcher_stats_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer doPrepareRequest(final RestRequest restRequest, WatcherClient client) throws IOException {
|
||||
Set<String> metrics = Strings.splitStringByCommaToSet(restRequest.param("metric", ""));
|
||||
|
|
|
@ -29,6 +29,12 @@ public class SecurityBaseRestHandlerTests extends ESTestCase {
|
|||
final XPackLicenseState licenseState = mock(XPackLicenseState.class);
|
||||
when(licenseState.isAuthAllowed()).thenReturn(securityEnabled);
|
||||
SecurityBaseRestHandler handler = new SecurityBaseRestHandler(Settings.EMPTY, licenseState) {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "test_xpack_security_base_action";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
return channel -> {
|
||||
|
|
|
@ -16,6 +16,7 @@ cluster:monitor/main
|
|||
cluster:monitor/nodes/hot_threads
|
||||
cluster:monitor/nodes/info
|
||||
cluster:monitor/nodes/stats
|
||||
cluster:monitor/nodes/usage
|
||||
cluster:monitor/remote/info
|
||||
cluster:monitor/state
|
||||
cluster:monitor/stats
|
||||
|
|
|
@ -7,6 +7,7 @@ cluster:monitor/nodes/hot_threads[n]
|
|||
cluster:monitor/nodes/info[n]
|
||||
cluster:monitor/nodes/liveness
|
||||
cluster:monitor/nodes/stats[n]
|
||||
cluster:monitor/nodes/usage[n]
|
||||
cluster:monitor/stats[n]
|
||||
cluster:monitor/tasks/lists[n]
|
||||
cluster:admin/xpack/security/realm/cache/clear
|
||||
|
|
Loading…
Reference in New Issue