Upload local csv file to server via rest API

Hi,

I have created bunch of CSV files on the Dremio Server
Can I upload them locally via rest api
Or the only way is to copy them manually via the client

I try to create a source via authenticated post curl:

curl -X POST ‘http://localhost:9047/apiv2/sources’ -H ‘Accept-Encoding: gzip, deflate, br’ -H “authorization:_dremio$TOKEN” -H ‘Accept: /’ -H ‘Connection: keep-alive’ --compressed

and get:

{“errorMessage”:“Something went wrong”,“moreInfo”:“HTTP 405 Method Not Allowed”}

can’t find it in the documentation

any idea ?

Hi,

You can create datasets using the API described here.. However there is currently no way to upload CSV files using our public API.

You could create a NAS source and point it at the directory containing the CSV files. You can then promote the files using the API (described here) or using the UI. If all CSV files have the same schema, you can also promote the container folder.

Thanks Doron
For the quick response
Will do!
(P.S. love you hair)

2 Likes

Is this still the case? If not then is there an example? I can’t find much in the way of a simple example for my use case, I just need to use CSV files on an S3 bucket as a dataset/table in Dremio. If this is not possible then I can download the files using boto3 and then upload to Dremio as a File entity type and then promote to a Dataset?

Thanks for any suggestions!

@monocongo

When you just have 1 or 2 files upload is ok but to promote a bunch of files, promoting the S3 folder via a S3 source would be ideal

Thanks
Bali

1 Like

Hey I know this is old, the API link is broken (404)

@jrdunson Here is the link to the docs page for the Catalog entity

https://docs.dremio.com/software/rest-api/catalog/