wjohnson / pyapacheatlas

A python package to help work with the apache atlas REST APIs
https://wjohnson.github.io/pyapacheatlas-docs/latest/
MIT License
170 stars 96 forks source link

Uploading an entity to a sub collection, instead of the root collection. #248

Closed MickeyLulz closed 9 months ago

MickeyLulz commented 1 year ago

What is your desired outcome Be able to upload / bulk upload new entities to a sub collection. As of now I can only create the new entities in the root collection.

What have you tried so far Looked through the documentation (https://github.com/wjohnson/pyapacheatlas) but have not found anything that can do this.

Screenshots This is what my collections look like. I want to be able to create new entities in the sub collections under my root collection (ie. be able to create an entity in 'Snowflake_Economics'). image

Desktop (please complete the following information):

Additional context Is there also a list of type names? This would be quite helpful with creating new entities.

wjohnson commented 1 year ago

Hi, @MickeyLulz Thank you for using PyApacheAtlas!

To answer your maing question, you can use client.collections.upload_entity() where you must specify the collection id.

Doc Small Sample

To get the collection id you probably will need to list all of the collections

To answer your additional context question, you can use get_all_typedefs to list all of the typedefs in your purview instance.

Please let me know if that helps!

wjohnson commented 9 months ago

Closing but please feel free to re-open if you need any additional guidance.