Storage API

Storage API PRODUCT     AVGIDEA, INC. 

File operations (upload, download, etc.) can be performed on Avgidea Storage via the API.


Common parameters

% curl -X POST -H 'content-type: application/json' -d '{"accesskey":"<accesskey>", "secret":"secretkey", "component":"storage", "action":"<action>" ... }' https://<endpoint url>

Parameters


Uploading an object

Uploading a file requires the following two steps

1. Generate references for upload

% curl -X POST -H 'content-type: application/json' -d '{"accesskey":"<accesskey>", "secret":"secretkey", "component":"storage", "action":"putref", "datasource":"ds1", "obj":"data.csv"}' https://<endpoint url>

{"data":"https://<upload url>","status":"success"}

Parameters

Return value


2. upload a file on the local environment

% curl -X PUT --upload-file . /data.csv https://<upload url>

Parameters


Downloading an object

To download the file, the following two steps must be performed

1. Generate references for download

% curl -X POST -H 'content-type: application/json' -d '{"accesskey":"<accesskey>", "secret":"secretkey", "component":"storage", "action":"getref", "datasource":"ds1", "obj":"data.csv"}' https://<endpoint url>

{"data":"https://<download url>","status":"success"}

Parameters

Return value


2. Download the file to your local environment

% curl -X GET -o ./data.csv https://<download url>

Parameters