Created on 03-09-2018 03:38 PM - edited 08-18-2019 01:39 AM
Hi Experts,
I would want to know if there is any REST API for creating tags in Atlas and assigning those tags to its respected entity. If there is any API can your'll send it with what should be put in the body.
Below are the screenshot of the apis which were tried in which one was giving an error while the other one was working fine for assigning term to an entity.
Thank You.
Created 03-09-2018 04:09 PM
POST the attached create-tag.txt to following REST API to create a tag named PII
http://localhost:21000/api/atlas/v2/types/typedefs?type=classification
After tag creation , get the GUID of the entity in Atlas which has to be associated to the tag.
If you want to associate to an hive_table entity by name employee which is in default database , fetch the GUID of the entity using DSL search :
typename = hive_table , query = where qualifiedName="default.employee@cl1" select __guid
Fetch the GUID and post the associate-tag.txt to the following REST API:
http://localhost:21000/api/atlas/v2/entity/bulk/classification
In the associate-tag.txt file , in "entityGuids" json array ,replace the existing GUID with the GUID fetched from the DSL search query.
Please refer to http://atlas.apache.org/api/v2/resource_TypesREST.html for more information on creating,updating,deleting tags and http://atlas.apache.org/api/v2/resource_EntityREST.html#resource_EntityREST_addClassification_POST for associating tags to entities.
Created 03-09-2018 04:09 PM
POST the attached create-tag.txt to following REST API to create a tag named PII
http://localhost:21000/api/atlas/v2/types/typedefs?type=classification
After tag creation , get the GUID of the entity in Atlas which has to be associated to the tag.
If you want to associate to an hive_table entity by name employee which is in default database , fetch the GUID of the entity using DSL search :
typename = hive_table , query = where qualifiedName="default.employee@cl1" select __guid
Fetch the GUID and post the associate-tag.txt to the following REST API:
http://localhost:21000/api/atlas/v2/entity/bulk/classification
In the associate-tag.txt file , in "entityGuids" json array ,replace the existing GUID with the GUID fetched from the DSL search query.
Please refer to http://atlas.apache.org/api/v2/resource_TypesREST.html for more information on creating,updating,deleting tags and http://atlas.apache.org/api/v2/resource_EntityREST.html#resource_EntityREST_addClassification_POST for associating tags to entities.