Does datahub provide a list of APIs (similar to - ...
# troubleshoot
m
Does datahub provide a list of APIs (similar to - https://atlas.apache.org/api/v2/index.html ).
b
Restli interface of GMS offers something like that if you e.g. go on
/restli/docs/rest/entities
imho not a great overview but at least something
m
Thank you for the pointer. Most of the links from the path are not working hence I was not able to explore much (com.linkedin.restli.server.RoutingException: Invalid documentation path /restli/docs/rest/restli/docs) . I wanted to check if there are APIs available using which I can view the details of my metadata . (Say I ingest from SQL server I am able to see in the datahub UI the details, but I want the API which would give me that info (preferably as JSON) so that I can use it my further downstream logic/pages.
b
yeah I also experienced that sometimes the base path is not correct and modifying the URL manually helps. So you want to do a search by platformType?
m
I would like to get the "aspects" (I hope the terminology is correct) of the entities I loaded. Say clicking on a entity, currently the UI displays the following - http://myip:9002/dataset/urn:li:dataset:(urn:li:dataPlatform:mongodb,utilitiesdb.well,PROD)/Schema?is_lineage_mode=false and it shows me the Schema definition. How do I get the corresponding JSON data . I tried few options as given - https://datahubproject.io/docs/metadata-modeling/metadata-model#querying-an-entity but unable but keep getting 404. Hence asking if there are any api docs/swagger available. I might be missing something basic but unable to understand. Atlas allows searches like : /api/atlas/v2/search/dsl?typeName=hive_table&query=where.
g
Hey @microscopic-musician-99632 - you can try checking out the graphiql interface by navigating to
/api/graphiql
!
this lets you play around with querying Datahub's Graphql api. You can explore the schema by hitting
Docs
in the upper right corner
m
Sorry I am not familiar with GraphQL (will try to check it ) , simply put I want to get the schemameta data for my mongo collection (well) that I have ingested from database (utilitiesdb) => urn:li:dataPlatform:mongodb,utilitiesdb.well,PROD . Along the lines of curl 'http://localhost:8080/aspects/urn%3Ali%3Adataset%3A(urn%3Ali%3AdataPlatform%3Afoo%2Cbar%2CPROD)?aspect=schemaMetadata&version=0' given on https://datahubproject.io/docs/metadata-modeling/metadata-model/#querying-an-entity
g
got it! Is that command you showed not working for you?
b
@microscopic-musician-99632 I would recommend you try to use the "dataset" GraphQL query... It will allow you to fetch this information... Here's an example curl:
Copy code
curl --location --request POST '<http://localhost:8080/api/graphql>' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"query dataset {\n  dataset(urn: \"urn:li:dataset:....\") {\n    schemaMetadata {\n      fields {\n        fieldPath\n      }\n    }\n  }\n}","variables":{}}'
Where you'd replace "urnlidataset:...." with whichever error
m
Thank you. I was able to get the metadata from - curl --location --request GET 'http://myip:8080/entities/urn%3Ali%3Adataset%3A(urn%3Ali%3AdataPlatform%3Amongodb%2Cutilitiesdb.well%2CPROD)' . I will check out more regarding the graphQL APIs since I can filter on it.
b
Awesome - I will also be adding some richer documentation for GraphQL in coming days