Skip to content

Conversation

pradeepagrawal8184
Copy link
Contributor

What changes were proposed in this pull request?

We are adding two REST APIs in ranger-admin to delete stale plugin info entries:

Delete based on plugin info entry id : plugins/plugins/info/{id}

Example: if the plugin info entry id is 9 which need to be deleted then below REST shall work.

curl -ivk -u admin:Admin123 -H "Accept: application/json" -H "Content-Type: application/json" -X DELETE https://<ranger_host>:6182/service/plugins/plugins/info/9

Delete based on plugin info entry attributes : plugins/plugins/info

Case-1: if you want to delete all plugin info entries of a ranger service.

curl -ivk -u admin:Admin123 -H "Accept: application/json" -H "Content-Type: application/json" -X DELETE "https://<ranger_host>:6182/service/plugins/plugins/info?serviceName=${SERVICE_NAME}"

Case-2: if you want to delete all plugin info entries of a ranger service and host name.

curl -ivk -u admin:Admin123 -H "Accept: application/json" -H "Content-Type: application/json" -X DELETE "https://<ranger_host>:6182/service/plugins/plugins/info?serviceName=${SERVICE_NAME}&pluginHostName=${HOST_NAME}"

Case-3: if you want to delete all plugin info entries of a ranger service, host and application name/type.

curl -ivk -u admin:Admin123 -H "Accept: application/json" -H "Content-Type: application/json" -X DELETE "https://<ranger_host>:6182/service/plugins/plugins/info?serviceName=${SERVICE_NAME}&pluginHostName=${HOST_NAME}&pluginAppType=${APPLICATION_NAME}"

How was this patch tested?

Manually: via calling the above given REST point

Copy link
Contributor

@kumaab kumaab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good, I think it would be good to add unit tests for the new API as well. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants