You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Quentin 635d3c1517
Update git URL
3 weeks ago
.openapi-generator Use promises 3 weeks ago
docs Use promises 3 weeks ago
src Use promises 3 weeks ago
test Initial commit 3 weeks ago
.babelrc Initial commit 3 weeks ago
.gitignore Initial commit 3 weeks ago
.openapi-generator-ignore Initial commit 3 weeks ago
.travis.yml Initial commit 3 weeks ago
README.md Update git URL 3 weeks ago
git_push.sh Update git URL 3 weeks ago
mocha.opts Initial commit 3 weeks ago
package.json Use promises 3 weeks ago

README.md

garage_administration_api_v0garage_v0_8_0

garage - JavaScript client for garage_administration_api_v0garage_v0_8_0 Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks.

Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: v0.8.0
  • Package version: v0.8.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install garage_administration_api_v0garage_v0_8_0 --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your garage_administration_api_v0garage_v0_8_0 from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/garage-sdk/garage-admin-sdk-js then install it via:

    npm install garage-sdk/garage-admin-sdk-js --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var garage = require('garage_administration_api_v0garage_v0_8_0');

var defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"

var api = new garage.BucketApi()
var allowBucketKeyRequest = new garage.AllowBucketKeyRequest(); // {AllowBucketKeyRequest} Aliases to put on the new bucket 
api.allowBucketKey(allowBucketKeyRequest).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});


Documentation for API Endpoints

All URIs are relative to http://localhost:3903/v0

Class Method HTTP request Description
garage.BucketApi allowBucketKey POST /bucket/allow Allow key
garage.BucketApi createBucket POST /bucket Create a bucket
garage.BucketApi deleteBucket DELETE /bucket?id={bucket_id} Delete a bucket
garage.BucketApi deleteBucketGlobalAlias DELETE /bucket/alias/global Delete a global alias
garage.BucketApi deleteBucketLocalAlias DELETE /bucket/alias/local Delete a local alias
garage.BucketApi denyBucketKey POST /bucket/deny Deny key
garage.BucketApi findBucketInfo GET /bucket?globalAlias={alias} Find a bucket
garage.BucketApi getBucketInfo GET /bucket?id={bucket_id} Get a bucket
garage.BucketApi listBuckets GET /bucket List all buckets
garage.BucketApi putBucketGlobalAlias PUT /bucket/alias/global Add a global alias
garage.BucketApi putBucketLocalAlias PUT /bucket/alias/local Add a local alias
garage.BucketApi updateBucket PUT /bucket?id={bucket_id} Update a bucket
garage.KeyApi addKey POST /key Create a new API key
garage.KeyApi deleteKey DELETE /key?id={access_key} Delete a key
garage.KeyApi getKey GET /key?id={access_key} Get key information
garage.KeyApi importKey POST /key/import Import an existing key
garage.KeyApi listKeys GET /key List all keys
garage.KeyApi searchKey GET /key?search={pattern} Select key by pattern
garage.KeyApi updateKey POST /key?id={access_key} Update a key
garage.LayoutApi addLayout POST /layout Send modifications to the cluster layout
garage.LayoutApi applyLayout POST /layout/apply Apply staged layout
garage.LayoutApi getLayout GET /layout Details on the current and staged layout
garage.LayoutApi revertLayout POST /layout/revert Clear staged layout
garage.NodesApi addNode POST /connect Connect target node to other Garage nodes
garage.NodesApi getNodes GET /status Status of this node and other nodes in the cluster

Documentation for Models

Documentation for Authorization

bearerAuth

  • Type: Bearer authentication