- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Atlas: How to pull the Tag attribute value?
- Labels:
-
Apache Atlas
Created ‎12-20-2016 11:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I have a 'User ID' tag with attribute 'ID Number' and add this to entity A, how can I pull the attribute ID Number VALUE using the REST api?
Farthest I'm able to get is pulling the tags for entity A but not the attribute values:
sandbox:2100/api/atlas/entities/{guid}/traits
Created ‎12-21-2016 12:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you want to get the Tag/Trait info then use:
GET http://<atlas-server-host:port>/api/atlas/types/{trait_name}
If you want to get the Tags/Traits associated with an Entity, with details, use:
GET http://<atlas-server-host:port>/api/atlas/entities/{guid}
Created ‎12-21-2016 12:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you want to get the Tag/Trait info then use:
GET http://<atlas-server-host:port>/api/atlas/types/{trait_name}
If you want to get the Tags/Traits associated with an Entity, with details, use:
GET http://<atlas-server-host:port>/api/atlas/entities/{guid}
Created ‎12-21-2016 01:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the quick response!
Lets say I added the User ID tag to A and provide the ID number attribute value ID123456.
When I pull using either command provided I still don't see ID123456 anywhere. I have not been able to find any documentation about pulling attribute values, perhaps this has not been implemented yet?
{"typeName":"User ID","definition":{"enumTypes":[],"structTypes":[],"traitTypes":[{"superTypes":["Business2"],"hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.TraitType","typeName":"User ID","typeDescription":"","attributeDefinitions":[{"name":"ID Number","dataTypeName":"string","multiplicity":"optional","isComposite":false,"isUnique":false,"isIndexable":true,"reverseAttributeName":null}]}]
,"classTypes":[]},"requestId":" - \/api\/atlas\/types\/User%20ID\/ - 7e841c42-ea66-4f05-b7e9-719ef3c1c943"}
Created ‎12-21-2016 03:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What you provided above is the response for:
GET http://<atlas-server-host:port>/api/atlas/types/{typeName}
Please post the response for:
GET http://<atlas-server-host:port>/api/atlas/entities/{entity_guid}
It should have the "ID123456" under "values" right after the "typeName":"UserID"
If you don't know the entity_guid, navigate to the entity you want ("A" in this case) in the Atlas UI. The alphanumeric string at the end of the URL is the entity_guid.
(http://<atlas-server-host:port>/index.html#!/detailPage/{entity_guid})
Created ‎12-21-2016 05:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for clarifying, I'm able to see the attribute value now.
Do you know if you're able to search by attribute value, either through the rest api or dsl? And if so can you provide an example.
Created ‎12-21-2016 05:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The easiest way would be to do a full text search not DSL. Just search for the attribute value itself. You can do this through the UI or through the API as follows:
GET http://<atlas-server- host:port>/api/atlas/discovery/search/fulltext?query={query_string}
