Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-4749

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

    XMLWordPrintableJSON

Details

    • Task
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • 3.0.0
    • admin
    • None

    Description

      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

      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

      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

      Attachments

        1. RANGER-4749.patch
          35 kB
          Anand Nadar

        Activity

          People

            anandNadar Anand Nadar
            anandNadar Anand Nadar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: