[ 
https://issues.apache.org/jira/browse/RANGER-4749?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anand Nadar reopened RANGER-4749:
---------------------------------

The GET service/tags/resource/service/\{serviceName}/resource api is not 
working as expected, as it is not populating the resource value in 
RangerPolicyResource

> Tag: Create an api to check if a resource is already available in database by 
> resource input. And send tag list along with the resource list in response of 
> GET /service/tags/resources/paginated API
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: RANGER-4749
>                 URL: https://issues.apache.org/jira/browse/RANGER-4749
>             Project: Ranger
>          Issue Type: Task
>          Components: admin
>            Reporter: Anand Nadar
>            Assignee: Anand Nadar
>            Priority: Major
>             Fix For: 3.0.0
>
>         Attachments: RANGER-4749.patch
>
>
> *1. Need an api to get the resource by resource if it exists in database.*
> Case:
> Suppose there already exists below tag and resource association.
> PII_NAME tag is associated with (database:HR-DB, table:EMPLOYEE, column:NAME)
> Now we dont know about the above resource already existing, so we are now 
> trying to create a new tag resource association as below
> PII_EMP_NAME associated with (database:HR-DB, table:EMPLOYEE, column:NAME)
> This is done using PUT /service/tags/importservicetags -> op: add_or_update
> So this will result in the deletion of PII_NAME association with the 
> resource,  and creation of PII_EMP_NAME tag associated with the resource.
> So if we have this GET service/tags/resource/service/\{serviceName}/resource 
> api which will have the query params as
> {code:java}
> Sample URL - 
> /service/tags/resource/service/hive8/resource?resource:column=NAME&resource:column.isExcludes=false&resource:column.isRecursive=true&resource:database=HR-DB&resource:database.isExcludes=false&resource:database.isRecursive=true&resource:table=EMPLOYEE&resource:table.isExcludes=false&resource:table.isRecursive=true&resource:database=HR-DB2{code}
> The values of resource can be multiple - 
> resource:database=db1&resource:database=db2 For isExcludes and isRecursive 
> there will be a subkey - 
> resource:database.isExcludes=false&resource:databasase.isRecursive=true
> we can check if this resource already exists or not.
> If the resource exists, we can get all the tags associated with that 
> resource(in our case PII_NAME), and include the new tag PII_EMP_NAME as well 
> and send this in 
> PUT /service/tags/importservicetags -> op: add_or_update
> then both PII_NAME and PII_EMP_NAME will be associated with the resource.
> *2. Need the list of associated tag names for a resource as well in  
> /service/tags/resources/paginated api.*
> Currently we are not returning the list of tags associated in the response.
> This will get the service resources with all its associated tags in a single 
> api which is also paginated.
> Free text search on the resource, and multiple tag-name search



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to