From 21bc2414f51b380138900fcf99ccfdc25ac49f79 Mon Sep 17 00:00:00 2001 From: Shounak kulkarni Date: Thu, 2 May 2024 23:27:08 +0500 Subject: [PATCH] Use separate action for /tasks/scheduler/jobDetails API (#13054) Created new Action GET_SCHEDULER_JOB_DETAILS under the Table actions for the endpoint /tasks/scheduler/jobDetails as its fetching table level information and the existing action puts this endpoint under Cluster actions. --- .../controller/api/resources/PinotTaskRestletResource.java | 4 ++-- .../src/main/java/org/apache/pinot/core/auth/Actions.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTaskRestletResource.java b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTaskRestletResource.java index 0d9d3a05c123..f240234b03e4 100644 --- a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTaskRestletResource.java +++ b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTaskRestletResource.java @@ -553,9 +553,9 @@ public List getCronSchedulerJobKeys() @GET @Path("/tasks/scheduler/jobDetails") - @Authorize(targetType = TargetType.CLUSTER, action = Actions.Cluster.GET_SCHEDULER_INFO) + @Authorize(targetType = TargetType.TABLE, action = Actions.Table.GET_SCHEDULER_JOB_DETAILS) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation("Fetch cron scheduler job keys") + @ApiOperation("Fetch job details for table tasks") public Map getCronSchedulerJobDetails( @ApiParam(value = "Table name (with type suffix)", required = true) @QueryParam("tableName") String tableName, @ApiParam(value = "Task type") @QueryParam("taskType") String taskType, @Context HttpHeaders headers) diff --git a/pinot-core/src/main/java/org/apache/pinot/core/auth/Actions.java b/pinot-core/src/main/java/org/apache/pinot/core/auth/Actions.java index 3793d773a62c..877041eb7d28 100644 --- a/pinot-core/src/main/java/org/apache/pinot/core/auth/Actions.java +++ b/pinot-core/src/main/java/org/apache/pinot/core/auth/Actions.java @@ -131,6 +131,7 @@ public static class Table { public static final String GET_TABLE_CONFIGS = "GetTableConfigs"; public static final String GET_TABLE_LEADER = "GetTableLeader"; public static final String GET_TIME_BOUNDARY = "GetTimeBoundary"; + public static final String GET_SCHEDULER_JOB_DETAILS = "GetSchedulerJobDetails"; public static final String PAUSE_CONSUMPTION = "PauseConsumption"; public static final String QUERY = "Query"; public static final String REBALANCE_TABLE = "RebalanceTable";