198 lines
8.6 KiB
Markdown
198 lines
8.6 KiB
Markdown
# garage_administration_api_v0garage_v0_9_0
|
|
|
|
garage - JavaScript client for garage_administration_api_v0garage_v0_9_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](https://openapi-generator.tech) project:
|
|
|
|
- API version: v0.9.0
|
|
- Package version: v0.9.0
|
|
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
|
|
|
|
## Installation
|
|
|
|
### For [Node.js](https://nodejs.org/)
|
|
|
|
#### npm
|
|
|
|
To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
|
|
|
|
Then install it via:
|
|
|
|
```shell
|
|
npm install garage_administration_api_v0garage_v0_9_0 --save
|
|
```
|
|
|
|
Finally, you need to build the module:
|
|
|
|
```shell
|
|
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:
|
|
|
|
```shell
|
|
npm install
|
|
```
|
|
|
|
Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:
|
|
|
|
```shell
|
|
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_9_0 from, and run:
|
|
|
|
```shell
|
|
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
|
|
```
|
|
|
|
Finally, you need to build the module:
|
|
|
|
```shell
|
|
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:
|
|
|
|
```shell
|
|
npm install garage-sdk/garage-admin-sdk-js --save
|
|
```
|
|
|
|
### For browser
|
|
|
|
The library also works in the browser environment via npm and [browserify](http://browserify.org/). 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):
|
|
|
|
```shell
|
|
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:
|
|
|
|
```javascript
|
|
module: {
|
|
rules: [
|
|
{
|
|
parser: {
|
|
amd: false
|
|
}
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## Getting Started
|
|
|
|
Please follow the [installation](#installation) instruction and execute the following JS code:
|
|
|
|
```javascript
|
|
var garage = require('garage_administration_api_v0garage_v0_9_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/v1*
|
|
|
|
Class | Method | HTTP request | Description
|
|
------------ | ------------- | ------------- | -------------
|
|
*garage.BucketApi* | [**allowBucketKey**](docs/BucketApi.md#allowBucketKey) | **POST** /bucket/allow | Allow key
|
|
*garage.BucketApi* | [**createBucket**](docs/BucketApi.md#createBucket) | **POST** /bucket | Create a bucket
|
|
*garage.BucketApi* | [**deleteBucket**](docs/BucketApi.md#deleteBucket) | **DELETE** /bucket | Delete a bucket
|
|
*garage.BucketApi* | [**deleteBucketGlobalAlias**](docs/BucketApi.md#deleteBucketGlobalAlias) | **DELETE** /bucket/alias/global | Delete a global alias
|
|
*garage.BucketApi* | [**deleteBucketLocalAlias**](docs/BucketApi.md#deleteBucketLocalAlias) | **DELETE** /bucket/alias/local | Delete a local alias
|
|
*garage.BucketApi* | [**denyBucketKey**](docs/BucketApi.md#denyBucketKey) | **POST** /bucket/deny | Deny key
|
|
*garage.BucketApi* | [**getBucketInfo**](docs/BucketApi.md#getBucketInfo) | **GET** /bucket | Get a bucket
|
|
*garage.BucketApi* | [**listBuckets**](docs/BucketApi.md#listBuckets) | **GET** /bucket?list | List all buckets
|
|
*garage.BucketApi* | [**putBucketGlobalAlias**](docs/BucketApi.md#putBucketGlobalAlias) | **PUT** /bucket/alias/global | Add a global alias
|
|
*garage.BucketApi* | [**putBucketLocalAlias**](docs/BucketApi.md#putBucketLocalAlias) | **PUT** /bucket/alias/local | Add a local alias
|
|
*garage.BucketApi* | [**updateBucket**](docs/BucketApi.md#updateBucket) | **PUT** /bucket | Update a bucket
|
|
*garage.KeyApi* | [**addKey**](docs/KeyApi.md#addKey) | **POST** /key?list | Create a new API key
|
|
*garage.KeyApi* | [**deleteKey**](docs/KeyApi.md#deleteKey) | **DELETE** /key | Delete a key
|
|
*garage.KeyApi* | [**getKey**](docs/KeyApi.md#getKey) | **GET** /key | Get key information
|
|
*garage.KeyApi* | [**importKey**](docs/KeyApi.md#importKey) | **POST** /key/import | Import an existing key
|
|
*garage.KeyApi* | [**listKeys**](docs/KeyApi.md#listKeys) | **GET** /key?list | List all keys
|
|
*garage.KeyApi* | [**updateKey**](docs/KeyApi.md#updateKey) | **POST** /key | Update a key
|
|
*garage.LayoutApi* | [**addLayout**](docs/LayoutApi.md#addLayout) | **POST** /layout | Send modifications to the cluster layout
|
|
*garage.LayoutApi* | [**applyLayout**](docs/LayoutApi.md#applyLayout) | **POST** /layout/apply | Apply staged layout
|
|
*garage.LayoutApi* | [**getLayout**](docs/LayoutApi.md#getLayout) | **GET** /layout | Details on the current and staged layout
|
|
*garage.LayoutApi* | [**revertLayout**](docs/LayoutApi.md#revertLayout) | **POST** /layout/revert | Clear staged layout
|
|
*garage.NodesApi* | [**addNode**](docs/NodesApi.md#addNode) | **POST** /connect | Connect target node to other Garage nodes
|
|
*garage.NodesApi* | [**getNodes**](docs/NodesApi.md#getNodes) | **GET** /status | Status of this node and other nodes in the cluster
|
|
|
|
|
|
## Documentation for Models
|
|
|
|
- [garage.AddKeyRequest](docs/AddKeyRequest.md)
|
|
- [garage.AddNode200ResponseInner](docs/AddNode200ResponseInner.md)
|
|
- [garage.AllowBucketKeyRequest](docs/AllowBucketKeyRequest.md)
|
|
- [garage.AllowBucketKeyRequestPermissions](docs/AllowBucketKeyRequestPermissions.md)
|
|
- [garage.ApplyLayout200Response](docs/ApplyLayout200Response.md)
|
|
- [garage.BucketInfo](docs/BucketInfo.md)
|
|
- [garage.BucketInfoQuotas](docs/BucketInfoQuotas.md)
|
|
- [garage.BucketInfoWebsiteConfig](docs/BucketInfoWebsiteConfig.md)
|
|
- [garage.BucketKeyInfo](docs/BucketKeyInfo.md)
|
|
- [garage.ClusterLayout](docs/ClusterLayout.md)
|
|
- [garage.CreateBucketRequest](docs/CreateBucketRequest.md)
|
|
- [garage.CreateBucketRequestLocalAlias](docs/CreateBucketRequestLocalAlias.md)
|
|
- [garage.CreateBucketRequestLocalAliasAllow](docs/CreateBucketRequestLocalAliasAllow.md)
|
|
- [garage.GetNodes200Response](docs/GetNodes200Response.md)
|
|
- [garage.ImportKeyRequest](docs/ImportKeyRequest.md)
|
|
- [garage.KeyInfo](docs/KeyInfo.md)
|
|
- [garage.KeyInfoBucketsInner](docs/KeyInfoBucketsInner.md)
|
|
- [garage.KeyInfoBucketsInnerPermissions](docs/KeyInfoBucketsInnerPermissions.md)
|
|
- [garage.KeyInfoPermissions](docs/KeyInfoPermissions.md)
|
|
- [garage.LayoutVersion](docs/LayoutVersion.md)
|
|
- [garage.ListBuckets200ResponseInner](docs/ListBuckets200ResponseInner.md)
|
|
- [garage.ListBuckets200ResponseInnerLocalAliasesInner](docs/ListBuckets200ResponseInnerLocalAliasesInner.md)
|
|
- [garage.ListKeys200ResponseInner](docs/ListKeys200ResponseInner.md)
|
|
- [garage.NodeClusterInfo](docs/NodeClusterInfo.md)
|
|
- [garage.NodeNetworkInfo](docs/NodeNetworkInfo.md)
|
|
- [garage.NodeRoleChange](docs/NodeRoleChange.md)
|
|
- [garage.NodeRoleRemove](docs/NodeRoleRemove.md)
|
|
- [garage.NodeRoleUpdate](docs/NodeRoleUpdate.md)
|
|
- [garage.UpdateBucketRequest](docs/UpdateBucketRequest.md)
|
|
- [garage.UpdateBucketRequestQuotas](docs/UpdateBucketRequestQuotas.md)
|
|
- [garage.UpdateBucketRequestWebsiteAccess](docs/UpdateBucketRequestWebsiteAccess.md)
|
|
- [garage.UpdateKeyRequest](docs/UpdateKeyRequest.md)
|
|
- [garage.UpdateKeyRequestAllow](docs/UpdateKeyRequestAllow.md)
|
|
- [garage.UpdateKeyRequestDeny](docs/UpdateKeyRequestDeny.md)
|
|
|
|
|
|
## Documentation for Authorization
|
|
|
|
|
|
|
|
### bearerAuth
|
|
|
|
- **Type**: Bearer authentication
|
|
|