Support Questions
Find answers, ask questions, and share your expertise

How to associate tags to multiple Entities using Atlas Rest API ??

Solved Go to solution

How to associate tags to multiple Entities using Atlas Rest API ??

We are trying to associate tags to multiple entities ( in my case Entities are columns of the Hive Tables) .We are able to associate a tag to an entity one at a time. What i am thinking is to Implement A process to associate multiple entities to a tag in one go.

I have gone through the technical documentation but haven't found any command for bulk import. Let me know if someone has tried this scenario. That would be great Help!!

Thanks in Advance,

Subash

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to associate tags to multiple Entities using Atlas Rest API ??

Expert Contributor
@subash sharma

Adding tags/traits to multiple entities is included in HDP 2.6 which will have Atlas 0.8. You can associate a tag (name) to multiple entities using their guids through REST API and also through UI.

View solution in original post

8 REPLIES 8

Re: How to associate tags to multiple Entities using Atlas Rest API ??

Expert Contributor
@subash sharma

Adding tags/traits to multiple entities is included in HDP 2.6 which will have Atlas 0.8. You can associate a tag (name) to multiple entities using their guids through REST API and also through UI.

View solution in original post

Re: How to associate tags to multiple Entities using Atlas Rest API ??

Rising Star

I think this might prove useful for understanding the APIs and the integration

http://atlas.incubator.apache.org/api/v2/index.html

Re: How to associate tags to multiple Entities using Atlas Rest API ??

Hey @Sarath Subramanian, Can you please share the Latest Rest API doc of Apache Atlas 0.8

Re: How to associate tags to multiple Entities using Atlas Rest API ??

Contributor

Re: How to associate tags to multiple Entities using Atlas Rest API ??

@ssanthosh I don't think it works on Apache Atlas 0.7. I tried this command to get all the entities, But it didn't work.

http://atlas.apache.org/api/v2/resource_EntityREST.html#resource_EntityREST_addClassification_POST

curl -X GET -H "Content-Type: application/json" -H "Accept: application/json" -u username:password hostname:21000/api/v2/entity/bulk

When i tried this command from the link ( http://atlas.incubator.apache.org/AtlasTechnicalUserGuide.pdf ), I was able to get GUID of all columns.

curl -X GET -H "Content-Type: application/json" -H "Accept: application/json" -u username:password hostname:21000/api/atlas/entities?type=hive_column

Am i doing something wrong in my Curl Command or the referred document works on older versions.

Awaiting your reply !!

Thank you,

Subash

Re: How to associate tags to multiple Entities using Atlas Rest API ??

Expert Contributor

@subash sharma, v2 APIs were added to Apache Atlas 0.8 and is not applicable to 0.7.

The following curl command can be used to associate a tag to multiple entities using its GUID.

curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -u username:password -d '{
  "classification": {
    "typeName": "PII",
    "attributes": {}
  },
  "entityGuids": [ "955f36b9-91cc-4a81-aa25-62a466ccd3a6" ]
}' "http://localhost:21000/api/atlas/v2/entity/bulk/classification"

Re: How to associate tags to multiple Entities using Atlas Rest API ??

Thank you @Sarath Subramanian for Clarification. I should have mentioned the Version of Atlas in my question as well. Can you please let me know from which version of HDP, I will get Apache Atlas 0.8.

Re: How to associate tags to multiple Entities using Atlas Rest API ??

Expert Contributor

HDP 2.6 stack will include Apache Atlas 0.8