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.

How to get bulk entities using v2 Rest Endpoints of Atlas 0.8

How to get bulk entities using v2 Rest Endpoints of Atlas 0.8

New Contributor

Hi,

As per the docs , I am trying the rest endpoint to fetch all entities in my browser. Rest Endpoint is :

http://localhost:21000/api/atlas/v2/entity/bulk

I tried multiple combinations of filters, but till now haven't found any luck. Let me know what am I missing here. Please suggest a good doc which can be referred.

Ty,

Subash

5 REPLIES 5

Re: How to get bulk entities using v2 Rest Endpoints of Atlas 0.8

Expert Contributor

Can you tell me exact error are you getting?

To run the sample, unzip the contents of the attached zip.

Here's a complete sample:

curl -X POST -u admin:admin -H 'Content-Type: application/json' -d @type_def.json "http://localhost:21000/api/atlas/v2/types/typedefs"
curl -X POST -u admin:admin -H 'Content-Type: application/json' -d @entity_def.json "http://localhost:21000/api/atlas/v2/entity"

Navigate to this URL to see the entity in the web UI: http://localhost:21000/#!/search/searchResult?type=test_type&searchType=dsl&dslChecked=true

Use this CURL call to fetch the entity. Replace the guid below with the entity guid you see within the UI:

curl -X GET -u admin:admin -H 'Content-Type: application/json' "http://localhost:21000/api/atlas/v2/entity/bulk/?guid=d7858640-f681-4ed9-a4b5-cb4abe680483"

Hope this helps.

Re: How to get bulk entities using v2 Rest Endpoints of Atlas 0.8

Contributor

I've documented all Atlas REST API call types I've got working here:

https://community.hortonworks.com/content/idea/154998/working-examples-of-atlas-rest-api-calls.html

I'm still finding new things out, like how to use the v2/entity/bulk API. You will find my working example in the comments.

Re: How to get bulk entities using v2 Rest Endpoints of Atlas 0.8

Expert Contributor
@subash sharma

To use the /api/atlas/v2/entity/bulk to fetch entities , GUIDs need to be known before and to be given as parameters.

http://localhost:21000/api/atlas/v2/entity/bulk?guid=<guid1>&guid=guid2&guid=guid3

>> "fetch all entities in my browser" - There is no API currently to fetch all entities without specifying type / query / classification.

Could you please explain your requirement ? Do the entities you require are of a specific type , or have a specific tag or perhaps have a pattern in name ?

Highlighted

Re: How to get bulk entities using v2 Rest Endpoints of Atlas 0.8

New Contributor

looking for something like this :

http://localhost:21000/api/atlas/entities?type=type_name

This rest endpoint was available in Atlas rest API v1, Not sure how to get the same in Atlas Rest API v2.

Thank you,

Subash

Re: How to get bulk entities using v2 Rest Endpoints of Atlas 0.8

Expert Contributor

There is no such V2 REST API currently.

For this requirement , you can use the search APIs.

Example :

/api/atlas/v2/search/basic?typeName=type_name
/api/atlas/v2/search/dsl?typeName=type_name