Entity API

Entity API PRODUCT     AVGIDEA, INC. 

Data can be transferred between Avgidea Storage and external databases or storage. For storage, data is transferred on an object (file) basis. For databases, records in a table can be output as a CSV file or loaded into a table.

The destination database or storage must be registered with ADP as a datasource in advance.


Common parameters

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

Parameters


% curl -X POST -d "{\"accesskey\":\"<accesskey>\", \"secret\":\"<secretkey>\", \"component\":\"function\", \"action\":\"<action>\" ...}" https://<endpoint url>

Note :
When using curl commands under Windows, use only double quotes and escape within JSON data, as in the example at left.

Copying Objects Between Storages

You can copy specific objects or groups of objects that match a condition from one storage to another.

a. Copying files between storage (single file)

% curl -X POST -d '{"accesskey":"<accesskey>", "secret":"<secretkey>", "component":"entity", "action":"transfer", "from":"as1", "to":"as2", "object":"data.csv"}' https://<endpoint url>

{"data":"Transferred successfully","status":"success"}

Parameters

Return value


b. Copying files (multiple files) between storage

% curl -X POST -d '{"accesskey":"<accesskey>", "secret":"<secretkey>", "component":"entity", "action":"transfer", "from":"as1", "to":"as2", "filter":"data"}' https://<endpoint url>

{"data":"Transferred successfully","status":"success"}

Parameters

Return value


Loading CSV files from storage to database

CSV files in storage can be loaded directly into database tables.

Loading a CSV file

% curl -X POST -d '{"accesskey":"<accesskey>", "secret":"<secretkey>", "component":"entity", "action":"transfer", "from":"as1", "to":"orcl", "object":"employee.csv", "table":"employees" "worker":4}' https://<endpoint url>

{"data":"Transferred successfully","status":"success"}

パラメータ

Return value


Exporting CSV files from a database

Tables in a database can be output to storage as CSV files.

Extracting a CSV file

% curl -X POST -d '{"accesskey":"<accesskey>", "secret":"<secretkey>", "component":"entity", "action":"transfer", "from":"orcl", "to":"as1", "table":"employees", "table":"employees"}' https://<endpoint url>

{"data":"Transferred successfully","status":"success"}

Parameters

Return value