mirror of
https://git.deuxfleurs.fr/Deuxfleurs/garage.git
synced 2024-12-21 14:46:40 +00:00
1.4 KiB
1.4 KiB
+++ title = "Javascript" weight = 10 +++
S3
Coming soon.
Some refs:
-
Minio SDK
-
Amazon aws-sdk-js
K2V
Coming soon
Administration
Install the SDK with:
npm install --save git+https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-js.git
A short example:
const garage = require('garage_administration_api_v1garage_v0_9_0');
const api = new garage.ApiClient("http://127.0.0.1:3903/v1");
api.authentications['bearerAuth'].accessToken = "s3cr3t";
const [node, layout, key, bucket] = [
new garage.NodesApi(api),
new garage.LayoutApi(api),
new garage.KeyApi(api),
new garage.BucketApi(api),
];
node.getNodes().then((data) => {
console.log(`nodes: ${Object.values(data.knownNodes).map(n => n.hostname)}`)
}, (error) => {
console.error(error);
});
See also: