Skip to content

Commit 20d6fbc

Browse files
authored
Add xpack info and usage endpoints for runtime fields (#65600)
Relates to #59332
1 parent 52afaf2 commit 20d6fbc

File tree

13 files changed

+765
-17
lines changed

13 files changed

+765
-17
lines changed

docs/reference/rest-api/info.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ Example response:
107107
"available": true,
108108
"enabled": true
109109
},
110+
"runtime_fields": {
111+
"available": true,
112+
"enabled": true
113+
},
110114
"searchable_snapshots" : {
111115
"available" : true,
112116
"enabled" : true

docs/reference/rest-api/usage.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,11 @@ GET /_xpack/usage
341341
"aggregate_metric" : {
342342
"available" : true,
343343
"enabled" : true
344+
},
345+
"runtime_fields" : {
346+
"available" : true,
347+
"enabled" : true,
348+
"field_types" : []
344349
}
345350
}
346351
------------------------------------------------------------

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackClientPlugin.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,12 @@
151151
import org.elasticsearch.xpack.core.rollup.action.GetRollupJobsAction;
152152
import org.elasticsearch.xpack.core.rollup.action.PutRollupJobAction;
153153
import org.elasticsearch.xpack.core.rollup.action.RollupSearchAction;
154-
import org.elasticsearch.xpack.core.rollup.v2.RollupAction;
155154
import org.elasticsearch.xpack.core.rollup.action.StartRollupJobAction;
156155
import org.elasticsearch.xpack.core.rollup.action.StopRollupJobAction;
157156
import org.elasticsearch.xpack.core.rollup.job.RollupJob;
158157
import org.elasticsearch.xpack.core.rollup.job.RollupJobStatus;
158+
import org.elasticsearch.xpack.core.rollup.v2.RollupAction;
159+
import org.elasticsearch.xpack.core.runtimefields.RuntimeFieldsFeatureSetUsage;
159160
import org.elasticsearch.xpack.core.search.action.GetAsyncSearchAction;
160161
import org.elasticsearch.xpack.core.search.action.SubmitAsyncSearchAction;
161162
import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotFeatureSetUsage;
@@ -522,7 +523,8 @@ public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
522523
// Data Streams
523524
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.DATA_STREAMS, DataStreamFeatureSetUsage::new),
524525
// Data Tiers
525-
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.DATA_TIERS, DataTiersFeatureSetUsage::new)
526+
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.DATA_TIERS, DataTiersFeatureSetUsage::new),
527+
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.RUNTIME_FIELDS, RuntimeFieldsFeatureSetUsage::new)
526528
);
527529
}
528530

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackField.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public final class XPackField {
6767
public static final String DATA_TIERS = "data_tiers";
6868
/** Name constant for the aggregate_metric plugin. */
6969
public static final String AGGREGATE_METRIC = "aggregate_metric";
70+
/** Name constant for the runtime fields plugin. */
71+
public static final String RUNTIME_FIELDS = "runtime_fields";
7072
/** Name constant for the operator privileges feature. */
7173
public static final String OPERATOR_PRIVILEGES = "operator_privileges";
7274

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackInfoFeatureAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@ public class XPackInfoFeatureAction extends ActionType<XPackInfoFeatureResponse>
4747
public static final XPackInfoFeatureAction DATA_STREAMS = new XPackInfoFeatureAction(XPackField.DATA_STREAMS);
4848
public static final XPackInfoFeatureAction DATA_TIERS = new XPackInfoFeatureAction(XPackField.DATA_TIERS);
4949
public static final XPackInfoFeatureAction AGGREGATE_METRIC = new XPackInfoFeatureAction(XPackField.AGGREGATE_METRIC);
50+
public static final XPackInfoFeatureAction RUNTIME_FIELDS = new XPackInfoFeatureAction(XPackField.RUNTIME_FIELDS);
5051

5152
public static final List<XPackInfoFeatureAction> ALL;
5253
static {
5354
final List<XPackInfoFeatureAction> actions = new ArrayList<>();
5455
actions.addAll(Arrays.asList(
5556
SECURITY, MONITORING, WATCHER, GRAPH, MACHINE_LEARNING, LOGSTASH, EQL, SQL, ROLLUP, INDEX_LIFECYCLE, SNAPSHOT_LIFECYCLE, CCR,
5657
TRANSFORM, VECTORS, VOTING_ONLY, FROZEN_INDICES, SPATIAL, ANALYTICS, ENRICH, DATA_STREAMS, SEARCHABLE_SNAPSHOTS, DATA_TIERS,
57-
AGGREGATE_METRIC
58+
AGGREGATE_METRIC, RUNTIME_FIELDS
5859
));
5960
ALL = Collections.unmodifiableList(actions);
6061
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackUsageFeatureAction.java

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
import org.elasticsearch.action.ActionType;
99
import org.elasticsearch.xpack.core.XPackField;
1010

11-
import java.util.ArrayList;
12-
import java.util.Arrays;
13-
import java.util.Collections;
1411
import java.util.List;
1512

1613
/**
@@ -47,17 +44,33 @@ public class XPackUsageFeatureAction extends ActionType<XPackUsageFeatureRespons
4744
public static final XPackUsageFeatureAction DATA_STREAMS = new XPackUsageFeatureAction(XPackField.DATA_STREAMS);
4845
public static final XPackUsageFeatureAction DATA_TIERS = new XPackUsageFeatureAction(XPackField.DATA_TIERS);
4946
public static final XPackUsageFeatureAction AGGREGATE_METRIC = new XPackUsageFeatureAction(XPackField.AGGREGATE_METRIC);
47+
public static final XPackUsageFeatureAction RUNTIME_FIELDS = new XPackUsageFeatureAction(XPackField.RUNTIME_FIELDS);
5048

51-
public static final List<XPackUsageFeatureAction> ALL;
52-
static {
53-
final List<XPackUsageFeatureAction> actions = new ArrayList<>();
54-
actions.addAll(Arrays.asList(
55-
SECURITY, MONITORING, WATCHER, GRAPH, MACHINE_LEARNING, LOGSTASH, EQL, SQL, ROLLUP, INDEX_LIFECYCLE, SNAPSHOT_LIFECYCLE, CCR,
56-
TRANSFORM, VECTORS, VOTING_ONLY, FROZEN_INDICES, SPATIAL, ANALYTICS, DATA_STREAMS, SEARCHABLE_SNAPSHOTS, DATA_TIERS,
57-
AGGREGATE_METRIC
58-
));
59-
ALL = Collections.unmodifiableList(actions);
60-
}
49+
static final List<XPackUsageFeatureAction> ALL = List.of(
50+
AGGREGATE_METRIC,
51+
ANALYTICS,
52+
CCR,
53+
DATA_STREAMS,
54+
DATA_TIERS,
55+
EQL,
56+
FROZEN_INDICES,
57+
GRAPH,
58+
INDEX_LIFECYCLE,
59+
LOGSTASH,
60+
MACHINE_LEARNING,
61+
MONITORING,
62+
ROLLUP,
63+
RUNTIME_FIELDS,
64+
SEARCHABLE_SNAPSHOTS,
65+
SECURITY,
66+
SNAPSHOT_LIFECYCLE,
67+
SPATIAL,
68+
SQL,
69+
TRANSFORM,
70+
VECTORS,
71+
VOTING_ONLY,
72+
WATCHER
73+
);
6174

6275
private XPackUsageFeatureAction(String name) {
6376
super(BASE_NAME + name, XPackUsageFeatureResponse::new);

0 commit comments

Comments
 (0)