garage/doc/book/build/javascript.md
Quentin Dufour cf23aee183
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Add a "build" section, doc for SDK
2022-11-13 16:48:52 +01:00

1.4 KiB

+++ title = "Javascript" weight = 10 +++

S3

Coming soon.

Some refs:

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_v0garage_v0_8_0');

const api = new garage.ApiClient("http://127.0.0.1:3903/v0");
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: