Skip to content

Commit

Permalink
Add xpack info and usage endpoints for runtime fields (elastic#65600)
Browse files Browse the repository at this point in the history
Relates to elastic#59332
  • Loading branch information
javanna authored and rjernst committed Dec 11, 2020
1 parent 5c8990b commit 88b8f68
Show file tree
Hide file tree
Showing 13 changed files with 765 additions and 17 deletions.
4 changes: 4 additions & 0 deletions docs/reference/rest-api/info.asciidoc
Expand Up @@ -107,6 +107,10 @@ Example response:
"available": true,
"enabled": true
},
"runtime_fields": {
"available": true,
"enabled": true
},
"searchable_snapshots" : {
"available" : true,
"enabled" : true
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/rest-api/usage.asciidoc
Expand Up @@ -341,6 +341,11 @@ GET /_xpack/usage
"aggregate_metric" : {
"available" : true,
"enabled" : true
},
"runtime_fields" : {
"available" : true,
"enabled" : true,
"field_types" : []
}
}
------------------------------------------------------------
Expand Down
Expand Up @@ -151,11 +151,12 @@
import org.elasticsearch.xpack.core.rollup.action.GetRollupJobsAction;
import org.elasticsearch.xpack.core.rollup.action.PutRollupJobAction;
import org.elasticsearch.xpack.core.rollup.action.RollupSearchAction;
import org.elasticsearch.xpack.core.rollup.v2.RollupAction;
import org.elasticsearch.xpack.core.rollup.action.StartRollupJobAction;
import org.elasticsearch.xpack.core.rollup.action.StopRollupJobAction;
import org.elasticsearch.xpack.core.rollup.job.RollupJob;
import org.elasticsearch.xpack.core.rollup.job.RollupJobStatus;
import org.elasticsearch.xpack.core.rollup.v2.RollupAction;
import org.elasticsearch.xpack.core.runtimefields.RuntimeFieldsFeatureSetUsage;
import org.elasticsearch.xpack.core.search.action.GetAsyncSearchAction;
import org.elasticsearch.xpack.core.search.action.SubmitAsyncSearchAction;
import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotFeatureSetUsage;
Expand Down Expand Up @@ -522,7 +523,8 @@ public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
// Data Streams
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.DATA_STREAMS, DataStreamFeatureSetUsage::new),
// Data Tiers
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.DATA_TIERS, DataTiersFeatureSetUsage::new)
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.DATA_TIERS, DataTiersFeatureSetUsage::new),
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.RUNTIME_FIELDS, RuntimeFieldsFeatureSetUsage::new)
);
}

Expand Down
Expand Up @@ -67,6 +67,8 @@ public final class XPackField {
public static final String DATA_TIERS = "data_tiers";
/** Name constant for the aggregate_metric plugin. */
public static final String AGGREGATE_METRIC = "aggregate_metric";
/** Name constant for the runtime fields plugin. */
public static final String RUNTIME_FIELDS = "runtime_fields";
/** Name constant for the operator privileges feature. */
public static final String OPERATOR_PRIVILEGES = "operator_privileges";

Expand Down
Expand Up @@ -47,14 +47,15 @@ public class XPackInfoFeatureAction extends ActionType<XPackInfoFeatureResponse>
public static final XPackInfoFeatureAction DATA_STREAMS = new XPackInfoFeatureAction(XPackField.DATA_STREAMS);
public static final XPackInfoFeatureAction DATA_TIERS = new XPackInfoFeatureAction(XPackField.DATA_TIERS);
public static final XPackInfoFeatureAction AGGREGATE_METRIC = new XPackInfoFeatureAction(XPackField.AGGREGATE_METRIC);
public static final XPackInfoFeatureAction RUNTIME_FIELDS = new XPackInfoFeatureAction(XPackField.RUNTIME_FIELDS);

public static final List<XPackInfoFeatureAction> ALL;
static {
final List<XPackInfoFeatureAction> actions = new ArrayList<>();
actions.addAll(Arrays.asList(
SECURITY, MONITORING, WATCHER, GRAPH, MACHINE_LEARNING, LOGSTASH, EQL, SQL, ROLLUP, INDEX_LIFECYCLE, SNAPSHOT_LIFECYCLE, CCR,
TRANSFORM, VECTORS, VOTING_ONLY, FROZEN_INDICES, SPATIAL, ANALYTICS, ENRICH, DATA_STREAMS, SEARCHABLE_SNAPSHOTS, DATA_TIERS,
AGGREGATE_METRIC
AGGREGATE_METRIC, RUNTIME_FIELDS
));
ALL = Collections.unmodifiableList(actions);
}
Expand Down
Expand Up @@ -8,9 +8,6 @@
import org.elasticsearch.action.ActionType;
import org.elasticsearch.xpack.core.XPackField;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
Expand Down Expand Up @@ -47,17 +44,33 @@ public class XPackUsageFeatureAction extends ActionType<XPackUsageFeatureRespons
public static final XPackUsageFeatureAction DATA_STREAMS = new XPackUsageFeatureAction(XPackField.DATA_STREAMS);
public static final XPackUsageFeatureAction DATA_TIERS = new XPackUsageFeatureAction(XPackField.DATA_TIERS);
public static final XPackUsageFeatureAction AGGREGATE_METRIC = new XPackUsageFeatureAction(XPackField.AGGREGATE_METRIC);
public static final XPackUsageFeatureAction RUNTIME_FIELDS = new XPackUsageFeatureAction(XPackField.RUNTIME_FIELDS);

public static final List<XPackUsageFeatureAction> ALL;
static {
final List<XPackUsageFeatureAction> actions = new ArrayList<>();
actions.addAll(Arrays.asList(
SECURITY, MONITORING, WATCHER, GRAPH, MACHINE_LEARNING, LOGSTASH, EQL, SQL, ROLLUP, INDEX_LIFECYCLE, SNAPSHOT_LIFECYCLE, CCR,
TRANSFORM, VECTORS, VOTING_ONLY, FROZEN_INDICES, SPATIAL, ANALYTICS, DATA_STREAMS, SEARCHABLE_SNAPSHOTS, DATA_TIERS,
AGGREGATE_METRIC
));
ALL = Collections.unmodifiableList(actions);
}
static final List<XPackUsageFeatureAction> ALL = List.of(
AGGREGATE_METRIC,
ANALYTICS,
CCR,
DATA_STREAMS,
DATA_TIERS,
EQL,
FROZEN_INDICES,
GRAPH,
INDEX_LIFECYCLE,
LOGSTASH,
MACHINE_LEARNING,
MONITORING,
ROLLUP,
RUNTIME_FIELDS,
SEARCHABLE_SNAPSHOTS,
SECURITY,
SNAPSHOT_LIFECYCLE,
SPATIAL,
SQL,
TRANSFORM,
VECTORS,
VOTING_ONLY,
WATCHER
);

private XPackUsageFeatureAction(String name) {
super(BASE_NAME + name, XPackUsageFeatureResponse::new);
Expand Down

0 comments on commit 88b8f68

Please sign in to comment.