Skip to main content
bigdatacm
Silver ⭐️⭐️⭐️
August 6, 2024
Solved

How to perfrom update (REST API - PUT) operation of apache atlas entity

IHi All,

I am getting one issue while updating my existing entity using PUT calls.

I have downloaded json by using GET and i just trying to update my entity (i have tried updating description also tried not updating anything and PUT as it is ) using PUT operation and its failing with same reason  -  

"errorCode":"ATLAS-400-00-023","errorMessage":"Attribute null not found for type hive_table"   

could you please advise how did you update the entity using PUT command ?   

curl --negotiate -u : -X PUT   -H "Content-Type: application/json"   https://myURL:portNumber/api/atlas/v2/entity/guid/<myGuid>-d @downloaded_entity.json

 

i have referred this post , however its not showing how to perform PUT operation.   Solved: Re: PARTIAL UPDATE APACHE ATLAS ENTITY GUI - Cloudera Community - 297845

 

so my question is - Does atals REST PAI allows updating entity ?  my usecase is i want to update an hive table entity. I have hive table hive column relationship in place. now i want to update my hive-table entity by adding hive columns under attributes: { columns [...]}  

vats
vatsAnswer
Gold ⭐️
August 22, 2024

@bigdatacm Can you try this I hope it will work

i.e

curl " https://URL/api/atlas/v2/entity/guid/7g5678h9-4003-407a-ac00-791c7c53e6d5" \
-i -X GET --negotiate \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-u username:password >> test_oracle_tbl.json -k

and then modify the test_oracle_tbl.json and make a partial update to the entity

curl "https://hostname:port/api/atlas/v2/entity/uniqueAttribute/type/datsetname?attr:qualifiedName=name"
-i -X GET --negotiate \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-u username:password -d@test_oracle_tbl.json -k

14 replies

DianaTorres
Community Manager
Community Manager
August 6, 2024

@bigdatacm Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our Atlas experts @cravani @pvishnu  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.

Translate
Regards, Diana Torres, Senior Community Moderator
bigdatacm
bigdatacmAuthor
Silver ⭐️⭐️⭐️
August 7, 2024

thank you @DianaTorres . I will wait for their response 

Translate
bigdatacm
bigdatacmAuthor
Silver ⭐️⭐️⭐️
August 16, 2024

 @cravani @pvishnu  - could you please advise here ?

Translate
DianaTorres
Community Manager
Community Manager
August 16, 2024

@Scharan @mayank_gupta Hi! Do you have any insights here? Thanks

Translate
Regards, Diana Torres, Senior Community Moderator
mayank_gupta
Silver ⭐️⭐️
Silver ⭐️⭐️
August 16, 2024

Hello,  yes Atlas API allows updating the entity https://atlas.apache.org/api/v2/resource_EntityREST.html

Further as per the error shared, looks like some missing attributes in the updated JSON that you are trying to push, verify it once or if possible attach it here for a quick review. 

Translate
bigdatacm
bigdatacmAuthor
Silver ⭐️⭐️⭐️
August 20, 2024

I just downloaded same entity json and just added 'dummy description' under description of entity and tried with same PUT command and I got same error. 

Translate
jhoney12
Silver ⭐️
August 17, 2024

I'm facing an issue while performing a PUT operation to update an Apache Atlas entity. I'm getting the error: "errorCode":"ATLAS-400-00-023","errorMessage":"Attribute null not found for type hive_table", despite trying different update approaches. Could someone advise on how to correctly update an entity using the PUT command, or confirm if Atlas REST API supports entity updates?

Translate
vats
Gold ⭐️
Gold ⭐️
August 21, 2024

@jhoney12  yes Atlas Rest API supports , but you need to download the JSON for the entity first.

i.e

curl " https://URL/api/atlas/v2/entity/guid/7g5678h9-4003-407a-ac00-791c7c53e6d5" \
-i -X GET --negotiate \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-u username:password >> test_oracle_tbl.json -k

and then modify the test_oracle_tbl.json and make a partial update to the entity

curl "https://hostname:port/api/atlas/v2/entity/uniqueAttribute/type/datsetname?attr:qualifiedName=name"
-i -X GET --negotiate \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-u username:password -d@test_oracle_tbl.json -k





Translate
vats
Gold ⭐️
Gold ⭐️
August 21, 2024

@jhoney12 https://atlas.apache.org/api/v2/resource_EntityREST.html#resource_EntityREST_partialUpdateEntityAttrByGuid_PUT

Note-Entity Partial Update - Add/Update entity attribute identified by its GUID. Supports only uprimitive attribute type and entity references. does not support updation of complex types like arrays, maps Null updates are not possible

Translate
bigdatacm
bigdatacmAuthor
Silver ⭐️⭐️⭐️
August 22, 2024

Documentation saying syntax as follows.  

PUT /v2/entity/guid/{guid}

 

Translate
vats
Gold ⭐️
vatsAnswer
Gold ⭐️
August 22, 2024

@bigdatacm Can you try this I hope it will work

i.e

curl " https://URL/api/atlas/v2/entity/guid/7g5678h9-4003-407a-ac00-791c7c53e6d5" \
-i -X GET --negotiate \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-u username:password >> test_oracle_tbl.json -k

and then modify the test_oracle_tbl.json and make a partial update to the entity

curl "https://hostname:port/api/atlas/v2/entity/uniqueAttribute/type/datsetname?attr:qualifiedName=name"
-i -X GET --negotiate \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-u username:password -d@test_oracle_tbl.json -k

Translate
bigdatacm
bigdatacmAuthor
Silver ⭐️⭐️⭐️
August 26, 2024

yes, it works with PUT command in place not get command.

Translate