Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Atlas: How to pull the Tag attribute value?

Solved Go to solution

Atlas: How to pull the Tag attribute value?

New Contributor

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Atlas: How to pull the Tag attribute value?

@H G

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}

View solution in original post

5 REPLIES 5
Highlighted

Re: Atlas: How to pull the Tag attribute value?

@H G

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}

View solution in original post

Highlighted

Re: Atlas: How to pull the Tag attribute value?

New Contributor

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"}

Highlighted

Re: Atlas: How to pull the Tag attribute value?

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})

Highlighted

Re: Atlas: How to pull the Tag attribute value?

New Contributor

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.

Highlighted

Re: Atlas: How to pull the Tag attribute value?

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}

Don't have an account?
Coming from Hortonworks? Activate your account here