garage-admin-sdk-js/README.md

201 lines
8.7 KiB
Markdown
Raw Permalink Normal View History

2023-11-22 17:30:42 +00:00
# garage_administration_api_v0garage_v0_9_0
2022-11-13 11:28:54 +00:00
2023-11-22 17:30:42 +00:00
garage - JavaScript client for garage_administration_api_v0garage_v0_9_0
2022-11-13 11:28:54 +00:00
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:
2023-11-22 17:30:42 +00:00
- API version: v0.9.0
- Package version: v0.9.0
2022-11-13 11:28:54 +00:00
- 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
2023-11-22 17:30:42 +00:00
npm install garage_administration_api_v0garage_v0_9_0 --save
2022-11-13 11:28:54 +00:00
```
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
```
2023-11-22 17:30:42 +00:00
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:
2022-11-13 11:28:54 +00:00
```shell
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```
Finally, you need to build the module:
```shell
npm run build
```
#### git
2022-11-13 14:53:41 +00:00
If the library is hosted at a git repository, e.g.https://github.com/garage-sdk/garage-admin-sdk-js
2022-11-13 11:28:54 +00:00
then install it via:
```shell
2022-11-13 14:53:41 +00:00
npm install garage-sdk/garage-admin-sdk-js --save
2022-11-13 11:28:54 +00:00
```
### 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
2023-11-22 17:30:42 +00:00
var garage = require('garage_administration_api_v0garage_v0_9_0');
2022-11-13 11:28:54 +00:00
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
2022-11-13 11:56:24 +00:00
api.allowBucketKey(allowBucketKeyRequest).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
2022-11-13 11:28:54 +00:00
```
## Documentation for API Endpoints
2023-11-22 17:30:42 +00:00
All URIs are relative to *http://localhost:3903/v1*
2022-11-13 11:28:54 +00:00
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
2023-11-22 20:18:18 +00:00
*garage.BucketApi* | [**deleteBucket**](docs/BucketApi.md#deleteBucket) | **DELETE** /bucket | Delete a bucket
2022-11-13 11:28:54 +00:00
*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
2023-11-22 20:18:18 +00:00
*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
2022-11-13 11:28:54 +00:00
*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
2023-11-22 20:18:18 +00:00
*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
2022-11-13 11:28:54 +00:00
*garage.KeyApi* | [**importKey**](docs/KeyApi.md#importKey) | **POST** /key/import | Import an existing key
2023-11-22 20:18:18 +00:00
*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
2022-11-13 11:28:54 +00:00
*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
2023-11-28 13:32:11 +00:00
*garage.NodesApi* | [**addNode**](docs/NodesApi.md#addNode) | **POST** /connect | Connect a new node
*garage.NodesApi* | [**getHealth**](docs/NodesApi.md#getHealth) | **GET** /health | Cluster health report
*garage.NodesApi* | [**getNodes**](docs/NodesApi.md#getNodes) | **GET** /status | Describe cluster
2022-11-13 11:28:54 +00:00
## Documentation for Models
- [garage.AddKeyRequest](docs/AddKeyRequest.md)
- [garage.AddNode200ResponseInner](docs/AddNode200ResponseInner.md)
- [garage.AllowBucketKeyRequest](docs/AllowBucketKeyRequest.md)
- [garage.AllowBucketKeyRequestPermissions](docs/AllowBucketKeyRequestPermissions.md)
2023-11-22 17:30:42 +00:00
- [garage.ApplyLayout200Response](docs/ApplyLayout200Response.md)
2022-11-13 11:28:54 +00:00
- [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)
2023-11-28 13:32:11 +00:00
- [garage.GetHealth200Response](docs/GetHealth200Response.md)
2022-11-13 11:28:54 +00:00
- [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)
2023-11-22 17:30:42 +00:00
- [garage.NodeRoleChange](docs/NodeRoleChange.md)
- [garage.NodeRoleRemove](docs/NodeRoleRemove.md)
- [garage.NodeRoleUpdate](docs/NodeRoleUpdate.md)
2022-11-13 11:28:54 +00:00
- [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