File tree Expand file tree Collapse file tree 4 files changed +16
-15
lines changed
esql/src/main/java/org/elasticsearch/xpack/esql
security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator Expand file tree Collapse file tree 4 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 1212
1313public class EsqlGetQueryAction extends ActionType <EsqlGetQueryResponse > {
1414 public static final EsqlGetQueryAction INSTANCE = new EsqlGetQueryAction ();
15- public static final String NAME = "cluster:monitor/data/read/ esql/query " ;
15+ public static final String NAME = "cluster:monitor/xpack/ esql/get_queries " ;
1616
1717 private EsqlGetQueryAction () {
1818 super (NAME );
Original file line number Diff line number Diff line change 1212
1313public class EsqlListQueriesAction extends ActionType <EsqlListQueriesResponse > {
1414 public static final EsqlListQueriesAction INSTANCE = new EsqlListQueriesAction ();
15- public static final String NAME = "cluster:monitor/data/read/ esql/queries " ;
15+ public static final String NAME = "cluster:monitor/xpack/ esql/list_queries " ;
1616
1717 private EsqlListQueriesAction () {
1818 super (NAME );
Original file line number Diff line number Diff line change @@ -45,19 +45,7 @@ public void onResponse(GetTaskResponse response) {
4545 .execute (new ActionListener <>() {
4646 @ Override
4747 public void onResponse (ListTasksResponse response ) {
48- listener .onResponse (
49- new EsqlGetQueryResponse (
50- new EsqlGetQueryResponse .DetailedQuery (
51- request .id (),
52- task .startTime (),
53- task .runningTimeNanos (),
54- task .description (),
55- // FIXME(gal, NOCOMMIT) This should be the coordinating node... how do I get that?
56- task .node (),
57- response .getTasks ().stream ().map (TaskInfo ::node ).distinct ().toList ()
58- )
59- )
60- );
48+ listener .onResponse (new EsqlGetQueryResponse (toDetailedQuery (task , response )));
6149 }
6250
6351 @ Override
@@ -73,4 +61,15 @@ public void onFailure(Exception e) {
7361 }
7462 });
7563 }
64+
65+ private static EsqlGetQueryResponse .DetailedQuery toDetailedQuery (TaskInfo task , ListTasksResponse response ) {
66+ return new EsqlGetQueryResponse .DetailedQuery (
67+ task .taskId (),
68+ task .startTime (),
69+ task .runningTimeNanos (),
70+ task .description (), // Query
71+ task .node (), // Coordinating node
72+ response .getTasks ().stream ().map (TaskInfo ::node ).distinct ().toList () // Data nodes
73+ );
74+ }
7675}
Original file line number Diff line number Diff line change @@ -386,6 +386,8 @@ public class Constants {
386386 "cluster:monitor/xpack/enrich/coordinator_stats" ,
387387 "cluster:monitor/xpack/enrich/stats" ,
388388 "cluster:monitor/xpack/eql/stats/dist" ,
389+ "cluster:monitor/xpack/esql/get_queries" ,
390+ "cluster:monitor/xpack/esql/list_queries" ,
389391 "cluster:monitor/xpack/esql/stats/dist" ,
390392 "cluster:monitor/xpack/inference/post" ,
391393 "cluster:monitor/xpack/inference/get" ,
You can’t perform that action at this time.
0 commit comments