Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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

avatar
Contributor

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 [...]}  

1 ACCEPTED SOLUTION

avatar
Expert Contributor

@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

View solution in original post

14 REPLIES 14

avatar
Community Manager

@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.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
Contributor

thank you @DianaTorres . I will wait for their response 

avatar
Contributor

 @cravani @pvishnu  - could you please advise here ?

avatar
Community Manager

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


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
Contributor

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. 

avatar
Contributor

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. 

avatar
Contributor

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. 

avatar
Contributor

@mayank_gupta - thanks

attaching my json file and CURL command i tried below.   

 

curl --negotiate -u : -X PUT -H "Content-Type: application/json" https://URL/api/atlas/v2/entity/guid/7g5678h9-4003-407a-ac00-791c7c53e6d5  -d @test_oracle_tbl.json

error I am getting -     
{"errorCode":"ATLAS-400-00-023","errorMessage":"Attribute null not found for type oracle_table_test"}

 

 

 

my json :

{
"referredEntities": {
"a4ff269b-566f-40f6-b7a3-8e0678c100fa": {
"typeName": "oracle_column",
"attributes": {
"owner": null,
"replicatedTo": null,
"userDescription": null,
"replicatedFrom": null,
"qualifiedName": "sales@oracle_column_fc_opo_test",
"displayName": null,
"dataType": "double",
"name": "sales",
"description": null,
"comment": "Sales",
"position": 0,
"table": {
"guid": "7g5678h9-4003-407a-ac00-791c7c53e6d5",
"typeName": "oracle_table_test"
}
},
"guid": "a4ff269b-566f-40f6-b7a3-8e0678c100fa",
"isIncomplete": false,
"status": "ACTIVE",
"createdBy": "ownerTest",
"updatedBy": "ownerTest",
"createTime": 1722463451536,
"updateTime": 1722463451536,
"version": 0,
"relationshipAttributes": {
"inputToProcesses": [],
"pipeline": null,
"schema": [],
"model": null,
"meanings": [],
"table": {
"guid": "7g5678h9-4003-407a-ac00-791c7c53e6d5",
"typeName": "oracle_table_test",
"entityStatus": "ACTIVE",
"displayText": "fc_opo_test",
"relationshipType": "oracle_table_test_columns",
"relationshipGuid": "4581a28b-73fb-4743-9069-649ff1812a80",
"relationshipStatus": "ACTIVE",
"relationshipAttributes": {
"typeName": "oracle_table_test_columns"
}
},
"outputFromProcesses": []
},
"labels": []
}
},
"entity": {
"typeName": "oracle_table_test",
"attributes": {
"owner": "ownerTest",
"temporary": false,
"lastAccessTime": 0,
"aliases": null,
"replicatedTo": null,
"userDescription": null,
"replicatedFrom": null,
"qualifiedName": "fc_opo_test@oracle_table_test",
"displayName": null,
"columns": [
{
"guid": "a4ff269b-566f-40f6-b7a3-8e0678c100fa",
"typeName": "oracle_column"
}
],
"description": "fc_opo_test oracle Table Test",
"viewExpandedText": null,
"tableType": null,
"rewriteEnable": null,
"createTime": 0,
"name": "fc_opo_test",
"comment": null,
"parameters": null,
"retention": 0,
"viewOriginalText": null,
"db": null
},
"guid": "7g5678h9-4003-407a-ac00-791c7c53e6d5",
"isIncomplete": false,
"status": "ACTIVE",
"createdBy": "ownerTest",
"updatedBy": "ownerTest",
"createTime": 1722463451536,
"updateTime": 1722463451536,
"version": 0,
"relationshipAttributes": {
"inputToProcesses": [],
"pipeline": null,
"schema": [],
"columns": [
{
"guid": "a4ff269b-566f-40f6-b7a3-8e0678c100fa",
"typeName": "oracle_column",
"entityStatus": "ACTIVE",
"displayText": "sales",
"relationshipType": "oracle_table_test_columns",
"relationshipGuid": "b63f4847-14ef-4e70-a384-8fa40e422b39",
"relationshipStatus": "ACTIVE",
"relationshipAttributes": {
"typeName": "oracle_table_test_columns"
}
}
],
"model": null,
"meanings": [],
"db": null,
"outputFromProcesses": []
},
"labels": []
}
}

 

avatar
New Contributor

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?