Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Renaming all Actions to distinguish between internal and external fac…
Browse files Browse the repository at this point in the history
…ing (#284)

* Renaming all Actions to distinguish between internal and external facing
  • Loading branch information
saratvemulapalli authored Oct 22, 2020
1 parent ab836c7 commit ad02fd5
Show file tree
Hide file tree
Showing 20 changed files with 78 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@
public class CommonValue {
// unknown or no schema version
public static Integer NO_SCHEMA_VERSION = 0;
public static String INTERNAL_ACTION_PREFIX = "cluster:admin/opendistro/adinternal/";
public static String EXTERNAL_ACTION_PREFIX = "cluster:admin/opendistro/ad/";
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.transport.TransportRequestOptions;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class ADResultBulkAction extends ActionType<BulkResponse> {

// Internal Action which is not used for public facing RestAPIs.
public static final String NAME = CommonValue.INTERNAL_ACTION_PREFIX + "write/bulk";
public static final ADResultBulkAction INSTANCE = new ADResultBulkAction();
public static final String NAME = "cluster:admin/ad/write/bulk";

private ADResultBulkAction() {
super(NAME, BulkResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

/**
* ADStatsNodesAction class
*/
public class ADStatsNodesAction extends ActionType<ADStatsNodesResponse> {

// Internal Action which is not used for public facing RestAPIs.
public static final String NAME = CommonValue.INTERNAL_ACTION_PREFIX + "stats/nodes";
public static final ADStatsNodesAction INSTANCE = new ADStatsNodesAction();
public static final String NAME = "cluster:admin/ad/stats/nodes";

/**
* Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class AnomalyDetectorJobAction extends ActionType<AnomalyDetectorJobResponse> {
// External Action which used for public facing RestAPIs.
public static final String NAME = CommonValue.EXTERNAL_ACTION_PREFIX + "detector/jobmanagement";
public static final AnomalyDetectorJobAction INSTANCE = new AnomalyDetectorJobAction();
public static final String NAME = "cluster:admin/opendistro/ad/detector/jobmanagement";

private AnomalyDetectorJobAction() {
super(NAME, AnomalyDetectorJobResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class AnomalyResultAction extends ActionType<AnomalyResultResponse> {
// External Action which used for public facing RestAPIs.
public static final String NAME = CommonValue.EXTERNAL_ACTION_PREFIX + "detector/run";
public static final AnomalyResultAction INSTANCE = new AnomalyResultAction();
public static final String NAME = "cluster:admin/opendistro/ad/detector/run";

private AnomalyResultAction() {
super(NAME, AnomalyResultResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class CronAction extends ActionType<CronResponse> {
// Internal Action which is not used for public facing RestAPIs.
public static final String NAME = CommonValue.INTERNAL_ACTION_PREFIX + "cron";
public static final CronAction INSTANCE = new CronAction();
public static final String NAME = "cluster:admin/ad/cron";

private CronAction() {
super(NAME, CronResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.delete.DeleteResponse;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class DeleteAnomalyDetectorAction extends ActionType<DeleteResponse> {
// External Action which used for public facing RestAPIs.
public static final String NAME = CommonValue.EXTERNAL_ACTION_PREFIX + "detector/delete";
public static final DeleteAnomalyDetectorAction INSTANCE = new DeleteAnomalyDetectorAction();
public static final String NAME = "cluster:admin/opendistro/ad/detector/delete";

private DeleteAnomalyDetectorAction() {
super(NAME, DeleteResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class DeleteModelAction extends ActionType<DeleteModelResponse> {
// Internal Action which is not used for public facing RestAPIs.
public static final String NAME = CommonValue.INTERNAL_ACTION_PREFIX + "model/delete";
public static final DeleteModelAction INSTANCE = new DeleteModelAction();
public static final String NAME = "cluster:admin/ad/model/delete";

private DeleteModelAction() {
super(NAME, DeleteModelResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class EntityProfileAction extends ActionType<EntityProfileResponse> {
// Internal Action which is not used for public facing RestAPIs.
public static final String NAME = CommonValue.INTERNAL_ACTION_PREFIX + "detectors/profile/entity";
public static final EntityProfileAction INSTANCE = new EntityProfileAction();
public static final String NAME = "cluster:admin/opendistro/ad/detectors/profile/entity";

private EntityProfileAction() {
super(NAME, EntityProfileResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.support.master.AcknowledgedResponse;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class EntityResultAction extends ActionType<AcknowledgedResponse> {
// Internal Action which is not used for public facing RestAPIs.
public static final String NAME = CommonValue.INTERNAL_ACTION_PREFIX + "entity/result";
public static final EntityResultAction INSTANCE = new EntityResultAction();
public static final String NAME = "cluster:admin/opendistro/ad/entity/result";

private EntityResultAction() {
super(NAME, AcknowledgedResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class GetAnomalyDetectorAction extends ActionType<GetAnomalyDetectorResponse> {
// External Action which used for public facing RestAPIs.
public static final String NAME = CommonValue.EXTERNAL_ACTION_PREFIX + "detectors/get";
public static final GetAnomalyDetectorAction INSTANCE = new GetAnomalyDetectorAction();
public static final String NAME = "cluster:admin/opendistro/ad/detectors/get";

private GetAnomalyDetectorAction() {
super(NAME, GetAnomalyDetectorResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class IndexAnomalyDetectorAction extends ActionType<IndexAnomalyDetectorResponse> {
// External Action which used for public facing RestAPIs.
public static final String NAME = CommonValue.EXTERNAL_ACTION_PREFIX + "detector/write";
public static final IndexAnomalyDetectorAction INSTANCE = new IndexAnomalyDetectorAction();
public static final String NAME = "cluster:admin/opendistro/ad/detector/write";

private IndexAnomalyDetectorAction() {
super(NAME, IndexAnomalyDetectorResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

/**
* Profile transport action
*/
public class ProfileAction extends ActionType<ProfileResponse> {

// Internal Action which is not used for public facing RestAPIs.
public static final String NAME = CommonValue.INTERNAL_ACTION_PREFIX + "detectors/profile";
public static final ProfileAction INSTANCE = new ProfileAction();
public static final String NAME = "cluster:admin/opendistro/ad/detectors/profile";

/**
* Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class RCFPollingAction extends ActionType<RCFPollingResponse> {
// Internal Action which is not used for public facing RestAPIs.
public static final String NAME = CommonValue.INTERNAL_ACTION_PREFIX + "rcfpolling";
public static final RCFPollingAction INSTANCE = new RCFPollingAction();
public static final String NAME = "cluster:admin/ad/rcfpolling";

private RCFPollingAction() {
super(NAME, RCFPollingResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class RCFResultAction extends ActionType<RCFResultResponse> {
// Internal Action which is not used for public facing RestAPIs.
public static final String NAME = CommonValue.INTERNAL_ACTION_PREFIX + "rcf/result";
public static final RCFResultAction INSTANCE = new RCFResultAction();
public static final String NAME = "cluster:admin/ad/rcf/result";

private RCFResultAction() {
super(NAME, RCFResultResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.search.SearchResponse;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class SearchAnomalyDetectorAction extends ActionType<SearchResponse> {
// External Action which used for public facing RestAPIs.
public static final String NAME = CommonValue.EXTERNAL_ACTION_PREFIX + "detector/search";
public static final SearchAnomalyDetectorAction INSTANCE = new SearchAnomalyDetectorAction();
public static final String NAME = "cluster:admin/opendistro/ad/detector/search";

private SearchAnomalyDetectorAction() {
super(NAME, SearchResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.search.SearchResponse;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class SearchAnomalyResultAction extends ActionType<SearchResponse> {
// External Action which used for public facing RestAPIs.
public static final String NAME = CommonValue.EXTERNAL_ACTION_PREFIX + "result/search";
public static final SearchAnomalyResultAction INSTANCE = new SearchAnomalyResultAction();
public static final String NAME = "cluster:admin/opendistro/ad/result/search";

private SearchAnomalyResultAction() {
super(NAME, SearchResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class StatsAnomalyDetectorAction extends ActionType<StatsAnomalyDetectorResponse> {
// External Action which used for public facing RestAPIs.
public static final String NAME = CommonValue.EXTERNAL_ACTION_PREFIX + "detector/stats";
public static final StatsAnomalyDetectorAction INSTANCE = new StatsAnomalyDetectorAction();
public static final String NAME = "cluster:admin/opendistro/ad/detector/stats";

private StatsAnomalyDetectorAction() {
super(NAME, StatsAnomalyDetectorResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class StopDetectorAction extends ActionType<StopDetectorResponse> {
// Internal Action which is not used for public facing RestAPIs.
public static final String NAME = CommonValue.INTERNAL_ACTION_PREFIX + "detector/stop";
public static final StopDetectorAction INSTANCE = new StopDetectorAction();
public static final String NAME = "cluster:admin/ad/detector/stop";

private StopDetectorAction() {
super(NAME, StopDetectorResponse::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import org.elasticsearch.action.ActionType;

import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue;

public class ThresholdResultAction extends ActionType<ThresholdResultResponse> {
// Internal Action which is not used for public facing RestAPIs.
public static final String NAME = CommonValue.INTERNAL_ACTION_PREFIX + "threshold/result";
public static final ThresholdResultAction INSTANCE = new ThresholdResultAction();
public static final String NAME = "cluster:admin/ad/theshold/result";

private ThresholdResultAction() {
super(NAME, ThresholdResultResponse::new);
Expand Down

0 comments on commit ad02fd5

Please sign in to comment.