Storage API

Storage API PRODUCT     AVGIDEA, INC. 

Avgidea Storage に対して API 経由でファイルの操作(アップロードやダウンロードなど)を実行できます


共通パラメータ

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

パラメータ


ファイルのアップロード

ファイルのアップロードには、下記の2つのステップを実行が必要です。

1. アップロード用のリファレンスを生成

% 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"}

パラメータ

戻り値


2. ローカル環境上のファイルをアップロード

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

パラメータ


ファイルのダウンロード

ファイルのダウンロードには、下記の2つのステップを実行が必要です。

1. ダウンロード用のリファレンスを生成

% 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"}

パラメータ

戻り値


2. ローカル環境ファイルをダウンロード

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

パラメータ