-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/75208/
-----------------------------------------------------------
(Updated Sept. 24, 2024, 9:10 p.m.)
Review request for ranger, Madhan Neethiraj and Ramesh Mani.
Changes
-------
Patch updated as per review comments
Bugs: RANGER-4934
https://issues.apache.org/jira/browse/RANGER-4934
Repository: ranger
Description
-------
Ranger API to add and delete assets to the DataShare in bulk. Current API
accepts only one resource and has to support adding / deleting multiple
resources.
Diffs (updated)
-----
security-admin/src/main/java/org/apache/ranger/rest/GdsREST.java b1a00533e
security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java
65e0f7848
Diff: https://reviews.apache.org/r/75208/diff/2/
Changes: https://reviews.apache.org/r/75208/diff/1-2/
Testing (updated)
-------
Tested manually.
CURL cmd to add resources in bulk:
----------------------------------
curl --location '<ranger url>/service/gds/resources' \
--data '[
{
"createdBy": "Admin",
"isEnabled": "true",
"version": 1,
"dataShareId":"1",
"resource":{
"database":{
"values":["test_db"]
},
"table":{
"values":["sal1","sal2","sal4"]
},
"column": {
"values": [
"id"
],
"isExcludes": false,
"isRecursive": false
}
},
"name":"test-resource-17",
"accessTypes":["all"]
},
{
"createdBy": "Admin",
"isEnabled": "true",
"version": 1,
"dataShareId":"1",
"resource":{
"database":{
"values":["default"]
},
"table":{
"values":["sal2","emp","tb_1","sal1","sal3","tb_2"]
},
"column": {
"values": [
"*"
],
"isExcludes": false,
"isRecursive": false
}
},
"name":"test-resource-18",
"accessTypes":["all"]
}
]'
CURL cmd to remove resources in bulk:
-------------------------------------
curl --location --request DELETE '<ranger url>/service/gds/resources' \
--data '[2,3,4,7]'
By default max batch size is 100 and it can be configured using configration
"ranger.admin.rest.gds.shared.resources.max.batch.size". If requested batch
size exceeds this limit, it'll throw error
"addSharedResources/removeSharedResources batch size exceeded the configured
limit: Maximum allowed is <configured value>
File Attachments
----------------
API details
https://reviews.apache.org/media/uploaded/files/2024/09/16/a4540abb-1c2d-471e-bbd3-eb74a8756159__Multiple_resources_add_delete_API_details.json
Thanks,
Radhika Kundam