mneethiraj commented on code in PR #683:
URL: https://github.com/apache/ranger/pull/683#discussion_r2403350209
##########
security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java:
##########
@@ -2852,6 +2852,48 @@ public RangerPluginInfoList getPluginsInfo(@Context
HttpServletRequest request)
return ret;
}
+ @DELETE
+ @Path("/plugins/info")
+ @Produces("application/json")
+ @PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
+ public void deletePluginsInfo(@Context HttpServletRequest request) {
+ LOG.debug("==> ServiceREST.deletePluginsInfo()");
+
+ RangerPluginInfoList ret = null;
+ SearchFilter filter = searchUtil.getSearchFilter(request,
pluginInfoService.getSortFields());
+
+ try {
+ PList<RangerPluginInfo> paginatedPluginsInfo =
pluginInfoService.searchRangerPluginInfo(filter);
+ if (paginatedPluginsInfo != null) {
+ for (RangerPluginInfo rangerPluginInfo :
paginatedPluginsInfo.getList()) {
+ if (rangerPluginInfo != null) {
+ deletePluginsInfo(rangerPluginInfo.getId());
+ LOG.debug("Deleted rangerPluginInfo:[{}]",
rangerPluginInfo);
+ }
+ }
+ }
+ } catch (WebApplicationException excp) {
+ throw excp;
+ } catch (Throwable excp) {
+ LOG.error("deletePluginsInfo() failed", excp);
+
+ throw restErrorUtil.createRESTException(excp.getMessage());
+ }
+
+ LOG.debug("<== ServiceREST.deletePluginsInfo()");
+ }
+
+ @DELETE
+ @Path("/plugins/info/{id}")
+ @PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
+ public void deletePluginsInfo(@PathParam("id") Long id) {
Review Comment:
ok. I suggest to introduce this API when we add UI for this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]