Merge pull request 'api-v1, javascript' (#1) from v0.9.x into main

Reviewed-on: #1
This commit is contained in:
Quentin 2023-11-28 15:36:32 +00:00
commit 271b951449
63 changed files with 1602 additions and 558 deletions

View file

@ -6,6 +6,7 @@ docs/AddKeyRequest.md
docs/AddNode200ResponseInner.md
docs/AllowBucketKeyRequest.md
docs/AllowBucketKeyRequestPermissions.md
docs/ApplyLayout200Response.md
docs/BucketApi.md
docs/BucketInfo.md
docs/BucketInfoQuotas.md
@ -15,6 +16,7 @@ docs/ClusterLayout.md
docs/CreateBucketRequest.md
docs/CreateBucketRequestLocalAlias.md
docs/CreateBucketRequestLocalAliasAllow.md
docs/GetHealth200Response.md
docs/GetNodes200Response.md
docs/ImportKeyRequest.md
docs/KeyApi.md
@ -29,6 +31,9 @@ docs/ListBuckets200ResponseInnerLocalAliasesInner.md
docs/ListKeys200ResponseInner.md
docs/NodeClusterInfo.md
docs/NodeNetworkInfo.md
docs/NodeRoleChange.md
docs/NodeRoleRemove.md
docs/NodeRoleUpdate.md
docs/NodesApi.md
docs/UpdateBucketRequest.md
docs/UpdateBucketRequestQuotas.md
@ -49,6 +54,7 @@ src/model/AddKeyRequest.js
src/model/AddNode200ResponseInner.js
src/model/AllowBucketKeyRequest.js
src/model/AllowBucketKeyRequestPermissions.js
src/model/ApplyLayout200Response.js
src/model/BucketInfo.js
src/model/BucketInfoQuotas.js
src/model/BucketInfoWebsiteConfig.js
@ -57,6 +63,7 @@ src/model/ClusterLayout.js
src/model/CreateBucketRequest.js
src/model/CreateBucketRequestLocalAlias.js
src/model/CreateBucketRequestLocalAliasAllow.js
src/model/GetHealth200Response.js
src/model/GetNodes200Response.js
src/model/ImportKeyRequest.js
src/model/KeyInfo.js
@ -69,9 +76,13 @@ src/model/ListBuckets200ResponseInnerLocalAliasesInner.js
src/model/ListKeys200ResponseInner.js
src/model/NodeClusterInfo.js
src/model/NodeNetworkInfo.js
src/model/NodeRoleChange.js
src/model/NodeRoleRemove.js
src/model/NodeRoleUpdate.js
src/model/UpdateBucketRequest.js
src/model/UpdateBucketRequestQuotas.js
src/model/UpdateBucketRequestWebsiteAccess.js
src/model/UpdateKeyRequest.js
src/model/UpdateKeyRequestAllow.js
src/model/UpdateKeyRequestDeny.js
test/model/GetHealth200Response.spec.js

View file

@ -1,14 +1,14 @@
# garage_administration_api_v0garage_v0_8_0
# garage_administration_api_v0garage_v0_9_0
garage - JavaScript client for garage_administration_api_v0garage_v0_8_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.8.0
- Package version: v0.8.0
- API version: v0.9.0
- Package version: v0.9.0
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
## Installation
@ -22,7 +22,7 @@ To publish the library as a [npm](https://www.npmjs.com/), please follow the pro
Then install it via:
```shell
npm install garage_administration_api_v0garage_v0_8_0 --save
npm install garage_administration_api_v0garage_v0_9_0 --save
```
Finally, you need to build the module:
@ -45,7 +45,7 @@ Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the follow
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:
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>
@ -101,7 +101,7 @@ module: {
Please follow the [installation](#installation) instruction and execute the following JS code:
```javascript
var garage = require('garage_administration_api_v0garage_v0_8_0');
var garage = require('garage_administration_api_v0garage_v0_9_0');
var defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
@ -121,35 +121,34 @@ api.allowBucketKey(allowBucketKeyRequest).then(function(data) {
## Documentation for API Endpoints
All URIs are relative to *http://localhost:3903/v0*
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?id&#x3D;{bucket_id} | Delete 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* | [**findBucketInfo**](docs/BucketApi.md#findBucketInfo) | **GET** /bucket?globalAlias&#x3D;{alias} | Find a bucket
*garage.BucketApi* | [**getBucketInfo**](docs/BucketApi.md#getBucketInfo) | **GET** /bucket?id&#x3D;{bucket_id} | Get a bucket
*garage.BucketApi* | [**listBuckets**](docs/BucketApi.md#listBuckets) | **GET** /bucket | List all buckets
*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?id&#x3D;{bucket_id} | Update a bucket
*garage.KeyApi* | [**addKey**](docs/KeyApi.md#addKey) | **POST** /key | Create a new API key
*garage.KeyApi* | [**deleteKey**](docs/KeyApi.md#deleteKey) | **DELETE** /key?id&#x3D;{access_key} | Delete a key
*garage.KeyApi* | [**getKey**](docs/KeyApi.md#getKey) | **GET** /key?id&#x3D;{access_key} | Get key information
*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 all keys
*garage.KeyApi* | [**searchKey**](docs/KeyApi.md#searchKey) | **GET** /key?search&#x3D;{pattern} | Select key by pattern
*garage.KeyApi* | [**updateKey**](docs/KeyApi.md#updateKey) | **POST** /key?id&#x3D;{access_key} | Update a 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
*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
## Documentation for Models
@ -158,6 +157,7 @@ Class | Method | HTTP request | Description
- [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)
@ -166,6 +166,7 @@ Class | Method | HTTP request | Description
- [garage.CreateBucketRequest](docs/CreateBucketRequest.md)
- [garage.CreateBucketRequestLocalAlias](docs/CreateBucketRequestLocalAlias.md)
- [garage.CreateBucketRequestLocalAliasAllow](docs/CreateBucketRequestLocalAliasAllow.md)
- [garage.GetHealth200Response](docs/GetHealth200Response.md)
- [garage.GetNodes200Response](docs/GetNodes200Response.md)
- [garage.ImportKeyRequest](docs/ImportKeyRequest.md)
- [garage.KeyInfo](docs/KeyInfo.md)
@ -178,6 +179,9 @@ Class | Method | HTTP request | Description
- [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)

View file

@ -0,0 +1,10 @@
# garage.ApplyLayout200Response
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**message** | **[String]** | |
**layout** | [**ClusterLayout**](ClusterLayout.md) | |

View file

@ -1,21 +1,20 @@
# garage.BucketApi
All URIs are relative to *http://localhost:3903/v0*
All URIs are relative to *http://localhost:3903/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**allowBucketKey**](BucketApi.md#allowBucketKey) | **POST** /bucket/allow | Allow key
[**createBucket**](BucketApi.md#createBucket) | **POST** /bucket | Create a bucket
[**deleteBucket**](BucketApi.md#deleteBucket) | **DELETE** /bucket?id&#x3D;{bucket_id} | Delete a bucket
[**deleteBucket**](BucketApi.md#deleteBucket) | **DELETE** /bucket | Delete a bucket
[**deleteBucketGlobalAlias**](BucketApi.md#deleteBucketGlobalAlias) | **DELETE** /bucket/alias/global | Delete a global alias
[**deleteBucketLocalAlias**](BucketApi.md#deleteBucketLocalAlias) | **DELETE** /bucket/alias/local | Delete a local alias
[**denyBucketKey**](BucketApi.md#denyBucketKey) | **POST** /bucket/deny | Deny key
[**findBucketInfo**](BucketApi.md#findBucketInfo) | **GET** /bucket?globalAlias&#x3D;{alias} | Find a bucket
[**getBucketInfo**](BucketApi.md#getBucketInfo) | **GET** /bucket?id&#x3D;{bucket_id} | Get a bucket
[**listBuckets**](BucketApi.md#listBuckets) | **GET** /bucket | List all buckets
[**getBucketInfo**](BucketApi.md#getBucketInfo) | **GET** /bucket | Get a bucket
[**listBuckets**](BucketApi.md#listBuckets) | **GET** /bucket?list | List all buckets
[**putBucketGlobalAlias**](BucketApi.md#putBucketGlobalAlias) | **PUT** /bucket/alias/global | Add a global alias
[**putBucketLocalAlias**](BucketApi.md#putBucketLocalAlias) | **PUT** /bucket/alias/local | Add a local alias
[**updateBucket**](BucketApi.md#updateBucket) | **PUT** /bucket?id&#x3D;{bucket_id} | Update a bucket
[**updateBucket**](BucketApi.md#updateBucket) | **PUT** /bucket | Update a bucket
@ -30,7 +29,7 @@ Allow key
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -78,7 +77,7 @@ Creates a new bucket, either with a global alias, a local one, or no alias at al
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -117,7 +116,7 @@ Name | Type | Description | Notes
## deleteBucket
> deleteBucket(bucketId)
> deleteBucket(id)
Delete a bucket
@ -126,15 +125,15 @@ Delete a bucket.Deletes a storage bucket. A bucket cannot be deleted if it is no
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.BucketApi();
let bucketId = b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87; // String | The exact bucket identifier, a 32 bytes hexadecimal string
apiInstance.deleteBucket(bucketId).then(() => {
let id = b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87; // String | The exact bucket identifier, a 32 bytes hexadecimal string
apiInstance.deleteBucket(id).then(() => {
console.log('API called successfully.');
}, (error) => {
console.error(error);
@ -147,7 +146,7 @@ apiInstance.deleteBucket(bucketId).then(() => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**bucketId** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string |
**id** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string |
### Return type
@ -174,7 +173,7 @@ Delete a global alias from the target bucket
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -224,7 +223,7 @@ Delete a local alias, bound to specified account, from the target bucket
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -276,7 +275,7 @@ Deny key
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -313,74 +312,29 @@ Name | Type | Description | Notes
- **Accept**: application/json
## findBucketInfo
> BucketInfo findBucketInfo(alias)
Find a bucket
Find a bucket by its global alias
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.BucketApi();
let alias = my_documents; // String | The exact global alias of one of the existing buckets
apiInstance.findBucketInfo(alias).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**alias** | **String**| The exact global alias of one of the existing buckets |
### Return type
[**BucketInfo**](BucketInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## getBucketInfo
> BucketInfo getBucketInfo(bucketId)
> BucketInfo getBucketInfo(opts)
Get a bucket
Given a bucket identifier, get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
Given a bucket identifier (&#x60;id&#x60;) or a global alias (&#x60;alias&#x60;), get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.BucketApi();
let bucketId = b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87; // String | The exact bucket identifier, a 32 bytes hexadecimal string
apiInstance.getBucketInfo(bucketId).then((data) => {
let opts = {
'id': b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87, // String | The exact bucket identifier, a 32 bytes hexadecimal string. Incompatible with `alias`.
'alias': my_documents // String | The exact global alias of one of the existing buckets. Incompatible with `id`.
};
apiInstance.getBucketInfo(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
@ -393,7 +347,8 @@ apiInstance.getBucketInfo(bucketId).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**bucketId** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string |
**id** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string. Incompatible with &#x60;alias&#x60;. | [optional]
**alias** | **String**| The exact global alias of one of the existing buckets. Incompatible with &#x60;id&#x60;. | [optional]
### Return type
@ -420,7 +375,7 @@ List all the buckets on the cluster with their UUID and their global and local a
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -464,7 +419,7 @@ Add a global alias to the target bucket
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -514,7 +469,7 @@ Add a local alias, bound to specified account, to the target bucket
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -557,25 +512,25 @@ Name | Type | Description | Notes
## updateBucket
> BucketInfo updateBucket(bucketId, updateBucketRequest)
> BucketInfo updateBucket(id, updateBucketRequest)
Update a bucket
All fields (&#x60;websiteAccess&#x60; and &#x60;quotas&#x60;) are optionnal. If they are present, the corresponding modifications are applied to the bucket, otherwise nothing is changed. In &#x60;websiteAccess&#x60;: if &#x60;enabled&#x60; is &#x60;true&#x60;, &#x60;indexDocument&#x60; must be specified. The field &#x60;errorDocument&#x60; is optional, if no error document is set a generic error message is displayed when errors happen. Conversely, if &#x60;enabled&#x60; is &#x60;false&#x60;, neither &#x60;indexDocument&#x60; nor &#x60;errorDocument&#x60; must be specified. In &#x60;quotas&#x60;: new values of &#x60;maxSize&#x60; and &#x60;maxObjects&#x60; must both be specified, or set to &#x60;null&#x60; to remove the quotas. An absent value will be considered the same as a &#x60;null&#x60;. It is not possible to change only one of the two quotas.
All fields (&#x60;websiteAccess&#x60; and &#x60;quotas&#x60;) are optional. If they are present, the corresponding modifications are applied to the bucket, otherwise nothing is changed. In &#x60;websiteAccess&#x60;: if &#x60;enabled&#x60; is &#x60;true&#x60;, &#x60;indexDocument&#x60; must be specified. The field &#x60;errorDocument&#x60; is optional, if no error document is set a generic error message is displayed when errors happen. Conversely, if &#x60;enabled&#x60; is &#x60;false&#x60;, neither &#x60;indexDocument&#x60; nor &#x60;errorDocument&#x60; must be specified. In &#x60;quotas&#x60;: new values of &#x60;maxSize&#x60; and &#x60;maxObjects&#x60; must both be specified, or set to &#x60;null&#x60; to remove the quotas. An absent value will be considered the same as a &#x60;null&#x60;. It is not possible to change only one of the two quotas.
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.BucketApi();
let bucketId = b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87; // String | The exact bucket identifier, a 32 bytes hexadecimal string
let id = b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87; // String | The exact bucket identifier, a 32 bytes hexadecimal string
let updateBucketRequest = new garage.UpdateBucketRequest(); // UpdateBucketRequest | Requested changes on the bucket. Both root fields are optionals.
apiInstance.updateBucket(bucketId, updateBucketRequest).then((data) => {
apiInstance.updateBucket(id, updateBucketRequest).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
@ -588,7 +543,7 @@ apiInstance.updateBucket(bucketId, updateBucketRequest).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**bucketId** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string |
**id** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string |
**updateBucketRequest** | [**UpdateBucketRequest**](UpdateBucketRequest.md)| Requested changes on the bucket. Both root fields are optionals. |
### Return type

View file

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**version** | **Number** | |
**roles** | [**{String: NodeClusterInfo}**](NodeClusterInfo.md) | |
**stagedRoleChanges** | [**{String: NodeClusterInfo}**](NodeClusterInfo.md) | |
**roles** | [**[NodeClusterInfo]**](NodeClusterInfo.md) | |
**stagedRoleChanges** | [**[NodeRoleChange]**](NodeRoleChange.md) | |

View file

@ -0,0 +1,16 @@
# garage.GetHealth200Response
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**status** | **String** | |
**knownNodes** | **Number** | |
**connectedNodes** | **Number** | |
**storageNodes** | **Number** | |
**storageNodesOk** | **Number** | |
**partitions** | **Number** | |
**partitionsQuorum** | **Number** | |
**partitionsAllOk** | **Number** | |

View file

@ -6,7 +6,10 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**node** | **String** | |
**garageVersion** | **String** | |
**knownNodes** | [**{String: NodeNetworkInfo}**](NodeNetworkInfo.md) | |
**garageFeatures** | **[String]** | |
**rustVersion** | **String** | |
**dbEngine** | **String** | |
**knownNodes** | [**[NodeNetworkInfo]**](NodeNetworkInfo.md) | |
**layout** | [**ClusterLayout**](ClusterLayout.md) | |

View file

@ -1,16 +1,15 @@
# garage.KeyApi
All URIs are relative to *http://localhost:3903/v0*
All URIs are relative to *http://localhost:3903/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**addKey**](KeyApi.md#addKey) | **POST** /key | Create a new API key
[**deleteKey**](KeyApi.md#deleteKey) | **DELETE** /key?id&#x3D;{access_key} | Delete a key
[**getKey**](KeyApi.md#getKey) | **GET** /key?id&#x3D;{access_key} | Get key information
[**addKey**](KeyApi.md#addKey) | **POST** /key?list | Create a new API key
[**deleteKey**](KeyApi.md#deleteKey) | **DELETE** /key | Delete a key
[**getKey**](KeyApi.md#getKey) | **GET** /key | Get key information
[**importKey**](KeyApi.md#importKey) | **POST** /key/import | Import an existing key
[**listKeys**](KeyApi.md#listKeys) | **GET** /key | List all keys
[**searchKey**](KeyApi.md#searchKey) | **GET** /key?search&#x3D;{pattern} | Select key by pattern
[**updateKey**](KeyApi.md#updateKey) | **POST** /key?id&#x3D;{access_key} | Update a key
[**listKeys**](KeyApi.md#listKeys) | **GET** /key?list | List all keys
[**updateKey**](KeyApi.md#updateKey) | **POST** /key | Update a key
@ -25,14 +24,14 @@ Creates a new API access key.
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.KeyApi();
let addKeyRequest = new garage.AddKeyRequest(); // AddKeyRequest | \"You can set a friendly name for this key, send an empty string instead\"
let addKeyRequest = new garage.AddKeyRequest(); // AddKeyRequest | You can set a friendly name for this key. If you don't want to, you can set the name to `null`. *Note: the secret key is returned in the response.*
apiInstance.addKey(addKeyRequest).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
@ -46,7 +45,7 @@ apiInstance.addKey(addKeyRequest).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**addKeyRequest** | [**AddKeyRequest**](AddKeyRequest.md)| \&quot;You can set a friendly name for this key, send an empty string instead\&quot; |
**addKeyRequest** | [**AddKeyRequest**](AddKeyRequest.md)| You can set a friendly name for this key. If you don&#39;t want to, you can set the name to &#x60;null&#x60;. *Note: the secret key is returned in the response.* |
### Return type
@ -64,7 +63,7 @@ Name | Type | Description | Notes
## deleteKey
> deleteKey(accessKey)
> deleteKey(id)
Delete a key
@ -73,15 +72,15 @@ Delete a key from the cluster. Its access will be removed from all the buckets.
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.KeyApi();
let accessKey = GK31c2f218a2e44f485b94239e; // String | The exact API access key generated by Garage
apiInstance.deleteKey(accessKey).then(() => {
let id = GK31c2f218a2e44f485b94239e; // String | The exact API access key generated by Garage
apiInstance.deleteKey(id).then(() => {
console.log('API called successfully.');
}, (error) => {
console.error(error);
@ -94,7 +93,7 @@ apiInstance.deleteKey(accessKey).then(() => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accessKey** | **String**| The exact API access key generated by Garage |
**id** | **String**| The exact API access key generated by Garage |
### Return type
@ -112,24 +111,28 @@ null (empty response body)
## getKey
> KeyInfo getKey(accessKey)
> KeyInfo getKey(opts)
Get key information
Return information about a specific key and return its information
Return information about a specific key like its identifiers, its permissions and buckets on which it has permissions. You can search by specifying the exact key identifier (&#x60;id&#x60;) or by specifying a pattern (&#x60;search&#x60;). For confidentiality reasons, the secret key is not returned by default: you must pass the &#x60;showSecretKey&#x60; query parameter to get it.
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.KeyApi();
let accessKey = GK31c2f218a2e44f485b94239e; // String | The exact API access key generated by Garage
apiInstance.getKey(accessKey).then((data) => {
let opts = {
'id': GK31c2f218a2e44f485b94239e, // String | The exact API access key generated by Garage. Incompatible with `search`.
'search': test-k, // String | A pattern (beginning or full string) corresponding to a key identifier or friendly name. Incompatible with `id`.
'showSecretKey': true // String | Wether or not the secret key should be returned in the response
};
apiInstance.getKey(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
@ -142,7 +145,9 @@ apiInstance.getKey(accessKey).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accessKey** | **String**| The exact API access key generated by Garage |
**id** | **String**| The exact API access key generated by Garage. Incompatible with &#x60;search&#x60;. | [optional]
**search** | **String**| A pattern (beginning or full string) corresponding to a key identifier or friendly name. Incompatible with &#x60;id&#x60;. | [optional]
**showSecretKey** | **String**| Wether or not the secret key should be returned in the response | [optional] [default to &#39;false&#39;]
### Return type
@ -169,7 +174,7 @@ Imports an existing API key. This feature must only be used for migrations and b
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -217,7 +222,7 @@ Returns all API access keys in the cluster.
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -250,75 +255,27 @@ This endpoint does not need any parameter.
- **Accept**: application/json
## searchKey
> KeyInfo searchKey(pattern)
Select key by pattern
Find the first key matching the given pattern based on its identifier aor friendly name and return its information.
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.KeyApi();
let pattern = test-k; // String | A pattern (beginning or full string) corresponding to a key identifier or friendly name
apiInstance.searchKey(pattern).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pattern** | **String**| A pattern (beginning or full string) corresponding to a key identifier or friendly name |
### Return type
[**KeyInfo**](KeyInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## updateKey
> KeyInfo updateKey(accessKey, updateKeyRequest)
> KeyInfo updateKey(id, updateKeyRequest)
Update a key
Updates information about the specified API access key.
Updates information about the specified API access key. *Note: the secret key is not returned in the response, &#x60;null&#x60; is sent instead.*
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.KeyApi();
let accessKey = GK31c2f218a2e44f485b94239e; // String | The exact API access key generated by Garage
let id = GK31c2f218a2e44f485b94239e; // String | The exact API access key generated by Garage
let updateKeyRequest = new garage.UpdateKeyRequest(); // UpdateKeyRequest | For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove
apiInstance.updateKey(accessKey, updateKeyRequest).then((data) => {
apiInstance.updateKey(id, updateKeyRequest).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
@ -331,7 +288,7 @@ apiInstance.updateKey(accessKey, updateKeyRequest).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accessKey** | **String**| The exact API access key generated by Garage |
**id** | **String**| The exact API access key generated by Garage |
**updateKeyRequest** | [**UpdateKeyRequest**](UpdateKeyRequest.md)| For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove |
### Return type

View file

@ -1,6 +1,6 @@
# garage.LayoutApi
All URIs are relative to *http://localhost:3903/v0*
All URIs are relative to *http://localhost:3903/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
@ -13,25 +13,25 @@ Method | HTTP request | Description
## addLayout
> addLayout(requestBody)
> ClusterLayout addLayout(nodeRoleChange)
Send modifications to the cluster layout
Send modifications to the cluster layout. These modifications will be included in the staged role changes, visible in subsequent calls of &#x60;GET /layout&#x60;. Once the set of staged changes is satisfactory, the user may call &#x60;POST /layout/apply&#x60; to apply the changed changes, or &#x60;POST /layout/revert&#x60; to clear all of the staged changes in the layout. Note that setting the capacity to &#x60;null&#x60; will configure the node as a gateway.
Send modifications to the cluster layout. These modifications will be included in the staged role changes, visible in subsequent calls of &#x60;GET /layout&#x60;. Once the set of staged changes is satisfactory, the user may call &#x60;POST /layout/apply&#x60; to apply the changed changes, or &#x60;POST /layout/revert&#x60; to clear all of the staged changes in the layout. Setting the capacity to &#x60;null&#x60; will configure the node as a gateway. Otherwise, capacity must be now set in bytes (before Garage 0.9 it was arbitrary weights). For example to declare 100GB, you must set &#x60;capacity: 100000000000&#x60;. Garage uses internally the International System of Units (SI), it assumes that 1kB &#x3D; 1000 bytes, and displays storage as kB, MB, GB (and not KiB, MiB, GiB that assume 1KiB &#x3D; 1024 bytes).
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.LayoutApi();
let requestBody = {key: new garage.NodeClusterInfo()}; // {String: NodeClusterInfo} | To add a new node to the layout or to change the configuration of an existing node, simply set the values you want. To remove a node, set it to `null` instead of passing a configuration object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified.
apiInstance.addLayout(requestBody).then(() => {
console.log('API called successfully.');
let nodeRoleChange = [new garage.NodeRoleChange()]; // [NodeRoleChange] | To add a new node to the layout or to change the configuration of an existing node, simply set the values you want (`zone`, `capacity`, and `tags`). To remove a node, simply pass the `remove: true` field. This logic is represented in OpenAPI with a \"One Of\" object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified.
apiInstance.addLayout(nodeRoleChange).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
@ -43,11 +43,11 @@ apiInstance.addLayout(requestBody).then(() => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**requestBody** | [**{String: NodeClusterInfo}**](NodeClusterInfo.md)| To add a new node to the layout or to change the configuration of an existing node, simply set the values you want. To remove a node, set it to &#x60;null&#x60; instead of passing a configuration object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified. |
**nodeRoleChange** | [**[NodeRoleChange]**](NodeRoleChange.md)| To add a new node to the layout or to change the configuration of an existing node, simply set the values you want (&#x60;zone&#x60;, &#x60;capacity&#x60;, and &#x60;tags&#x60;). To remove a node, simply pass the &#x60;remove: true&#x60; field. This logic is represented in OpenAPI with a \&quot;One Of\&quot; object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified. |
### Return type
null (empty response body)
[**ClusterLayout**](ClusterLayout.md)
### Authorization
@ -56,21 +56,21 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
- **Accept**: application/json
## applyLayout
> applyLayout(layoutVersion)
> ApplyLayout200Response applyLayout(layoutVersion)
Apply staged layout
Applies to the cluster the layout changes currently registered as staged layout changes.
Applies to the cluster the layout changes currently registered as staged layout changes. *Note: do not try to parse the &#x60;message&#x60; field of the response, it is given as an array of string specifically because its format is not stable.*
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -78,8 +78,8 @@ bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.LayoutApi();
let layoutVersion = new garage.LayoutVersion(); // LayoutVersion | Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster.
apiInstance.applyLayout(layoutVersion).then(() => {
console.log('API called successfully.');
apiInstance.applyLayout(layoutVersion).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
@ -95,7 +95,7 @@ Name | Type | Description | Notes
### Return type
null (empty response body)
[**ApplyLayout200Response**](ApplyLayout200Response.md)
### Authorization
@ -104,7 +104,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
- **Accept**: application/json
## getLayout
@ -113,12 +113,12 @@ null (empty response body)
Details on the current and staged layout
Returns the cluster&#39;s current layout, including: - Currently configured cluster layout - Staged changes to the cluster layout *The info returned by this endpoint is a subset of the info returned by &#x60;GET /status&#x60;.*
Returns the cluster&#39;s current layout, including: - Currently configured cluster layout - Staged changes to the cluster layout *Capacity is given in bytes* *The info returned by this endpoint is a subset of the info returned by &#x60;GET /status&#x60;.*
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -162,7 +162,7 @@ Clears all of the staged layout changes.
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];

View file

@ -4,6 +4,6 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**version** | **Number** | | [optional]
**version** | **Number** | |

View file

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**zone** | **String** | |
**capacity** | **Number** | |
**capacity** | **Number** | | [optional]
**tags** | **[String]** | User defined tags, put whatever makes sense for you, these tags are not interpreted by Garage |

View file

@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional]
**addr** | **String** | |
**isUp** | **Boolean** | |
**lastSeenSecsAgo** | **Number** | |

13
docs/NodeRoleChange.md Normal file
View file

@ -0,0 +1,13 @@
# garage.NodeRoleChange
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | |
**remove** | **Boolean** | |
**zone** | **String** | |
**capacity** | **Number** | |
**tags** | **[String]** | |

10
docs/NodeRoleRemove.md Normal file
View file

@ -0,0 +1,10 @@
# garage.NodeRoleRemove
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | |
**remove** | **Boolean** | |

12
docs/NodeRoleUpdate.md Normal file
View file

@ -0,0 +1,12 @@
# garage.NodeRoleUpdate
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | |
**zone** | **String** | |
**capacity** | **Number** | |
**tags** | **[String]** | |

View file

@ -1,11 +1,12 @@
# garage.NodesApi
All URIs are relative to *http://localhost:3903/v0*
All URIs are relative to *http://localhost:3903/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**addNode**](NodesApi.md#addNode) | **POST** /connect | Connect target node to other Garage nodes
[**getNodes**](NodesApi.md#getNodes) | **GET** /status | Status of this node and other nodes in the cluster
[**addNode**](NodesApi.md#addNode) | **POST** /connect | Connect a new node
[**getHealth**](NodesApi.md#getHealth) | **GET** /health | Cluster health report
[**getNodes**](NodesApi.md#getNodes) | **GET** /status | Describe cluster
@ -13,14 +14,14 @@ Method | HTTP request | Description
> [AddNode200ResponseInner] addNode(requestBody)
Connect target node to other Garage nodes
Connect a new node
Instructs this Garage node to connect to other Garage nodes at specified &#x60;&lt;node_id&gt;@&lt;net_address&gt;&#x60;. &#x60;node_id&#x60; is generated automatically on node start.
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
@ -57,18 +58,62 @@ Name | Type | Description | Notes
- **Accept**: application/json
## getNodes
## getHealth
> GetNodes200Response getNodes()
> GetHealth200Response getHealth()
Status of this node and other nodes in the cluster
Cluster health report
Returns the cluster&#39;s current status, including: - ID of the node being queried and its version of the Garage daemon - Live nodes - Currently configured cluster layout - Staged changes to the cluster layout
Returns the global status of the cluster, the number of connected nodes (over the number of known ones), the number of healthy storage nodes (over the declared ones), and the number of healthy partitions (over the total).
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_8_0';
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.NodesApi();
apiInstance.getHealth().then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**GetHealth200Response**](GetHealth200Response.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## getNodes
> GetNodes200Response getNodes()
Describe cluster
Returns the cluster&#39;s current status, including: - ID of the node being queried and its version of the Garage daemon - Live nodes - Currently configured cluster layout - Staged changes to the cluster layout *Capacity is given in bytes*
### Example
```javascript
import garage from 'garage_administration_api_v0garage_v0_9_0';
let defaultClient = garage.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];

View file

@ -1,6 +1,6 @@
{
"name": "garage_administration_api_v0garage_v0_8_0",
"version": "v0.8.0",
"name": "garage_administration_api_v0garage_v0_9_0",
"version": "v0.9.0",
"description": "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!* ",
"license": "Unlicense",
"main": "dist/index.js",

View file

@ -1,8 +1,8 @@
/**
* Garage Administration API v0+garage-v0.8.0
* Garage Administration API v0+garage-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!*
*
* The version of the OpenAPI document: v0.8.0
* The version of the OpenAPI document: v0.9.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -17,7 +17,7 @@ import querystring from "querystring";
/**
* @module ApiClient
* @version v0.8.0
* @version v0.9.0
*/
/**
@ -33,11 +33,11 @@ class ApiClient {
* Overrides the default value set in spec file if present
* @param {String} basePath
*/
constructor(basePath = 'http://localhost:3903/v0') {
constructor(basePath = 'http://localhost:3903/v1') {
/**
* The base URL against which to resolve every API call's (relative) path.
* @type {String}
* @default http://localhost:3903/v0
* @default http://localhost:3903/v1
*/
this.basePath = basePath.replace(/\/+$/, '');
@ -55,7 +55,7 @@ class ApiClient {
* @default {}
*/
this.defaultHeaders = {
'User-Agent': 'OpenAPI-Generator/v0.8.0/Javascript'
'User-Agent': 'OpenAPI-Generator/v0.9.0/Javascript'
};
/**
@ -594,7 +594,7 @@ class ApiClient {
hostSettings() {
return [
{
'url': "http://localhost:3903/v0",
'url': "http://localhost:3903/v1",
'description': "A local server",
}
];

View file

@ -1,8 +1,8 @@
/**
* Garage Administration API v0+garage-v0.8.0
* Garage Administration API v0+garage-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!*
*
* The version of the OpenAPI document: v0.8.0
* The version of the OpenAPI document: v0.9.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -22,7 +22,7 @@ import UpdateBucketRequest from '../model/UpdateBucketRequest';
/**
* Bucket service.
* @module api/BucketApi
* @version v0.8.0
* @version v0.9.0
*/
export default class BucketApi {
@ -136,20 +136,20 @@ export default class BucketApi {
/**
* Delete a bucket
* Delete a bucket.Deletes a storage bucket. A bucket cannot be deleted if it is not empty. **Warning:** this will delete all aliases associated with the bucket!
* @param {String} bucketId The exact bucket identifier, a 32 bytes hexadecimal string
* @param {String} id The exact bucket identifier, a 32 bytes hexadecimal string
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
deleteBucketWithHttpInfo(bucketId) {
deleteBucketWithHttpInfo(id) {
let postBody = null;
// verify the required parameter 'bucketId' is set
if (bucketId === undefined || bucketId === null) {
throw new Error("Missing the required parameter 'bucketId' when calling deleteBucket");
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling deleteBucket");
}
let pathParams = {
'bucket_id': bucketId
};
let queryParams = {
'id': id
};
let headerParams = {
};
@ -161,7 +161,7 @@ export default class BucketApi {
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/bucket?id={bucket_id}', 'DELETE',
'/bucket', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
@ -170,11 +170,11 @@ export default class BucketApi {
/**
* Delete a bucket
* Delete a bucket.Deletes a storage bucket. A bucket cannot be deleted if it is not empty. **Warning:** this will delete all aliases associated with the bucket!
* @param {String} bucketId The exact bucket identifier, a 32 bytes hexadecimal string
* @param {String} id The exact bucket identifier, a 32 bytes hexadecimal string
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
deleteBucket(bucketId) {
return this.deleteBucketWithHttpInfo(bucketId)
deleteBucket(id) {
return this.deleteBucketWithHttpInfo(id)
.then(function(response_and_data) {
return response_and_data.data;
});
@ -346,22 +346,22 @@ export default class BucketApi {
/**
* Find a bucket
* Find a bucket by its global alias
* @param {String} alias The exact global alias of one of the existing buckets
* Get a bucket
* Given a bucket identifier (`id`) or a global alias (`alias`), get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
* @param {Object} opts Optional parameters
* @param {String} opts.id The exact bucket identifier, a 32 bytes hexadecimal string. Incompatible with `alias`.
* @param {String} opts.alias The exact global alias of one of the existing buckets. Incompatible with `id`.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
*/
findBucketInfoWithHttpInfo(alias) {
getBucketInfoWithHttpInfo(opts) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'alias' is set
if (alias === undefined || alias === null) {
throw new Error("Missing the required parameter 'alias' when calling findBucketInfo");
}
let pathParams = {
'alias': alias
};
let queryParams = {
'id': opts['id'],
'alias': opts['alias']
};
let headerParams = {
};
@ -373,55 +373,7 @@ export default class BucketApi {
let accepts = ['application/json'];
let returnType = BucketInfo;
return this.apiClient.callApi(
'/bucket?globalAlias={alias}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Find a bucket
* Find a bucket by its global alias
* @param {String} alias The exact global alias of one of the existing buckets
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
*/
findBucketInfo(alias) {
return this.findBucketInfoWithHttpInfo(alias)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Get a bucket
* Given a bucket identifier, get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
* @param {String} bucketId The exact bucket identifier, a 32 bytes hexadecimal string
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
*/
getBucketInfoWithHttpInfo(bucketId) {
let postBody = null;
// verify the required parameter 'bucketId' is set
if (bucketId === undefined || bucketId === null) {
throw new Error("Missing the required parameter 'bucketId' when calling getBucketInfo");
}
let pathParams = {
'bucket_id': bucketId
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = ['bearerAuth'];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = BucketInfo;
return this.apiClient.callApi(
'/bucket?id={bucket_id}', 'GET',
'/bucket', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
@ -429,12 +381,14 @@ export default class BucketApi {
/**
* Get a bucket
* Given a bucket identifier, get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
* @param {String} bucketId The exact bucket identifier, a 32 bytes hexadecimal string
* Given a bucket identifier (`id`) or a global alias (`alias`), get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
* @param {Object} opts Optional parameters
* @param {String} opts.id The exact bucket identifier, a 32 bytes hexadecimal string. Incompatible with `alias`.
* @param {String} opts.alias The exact global alias of one of the existing buckets. Incompatible with `id`.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
*/
getBucketInfo(bucketId) {
return this.getBucketInfoWithHttpInfo(bucketId)
getBucketInfo(opts) {
return this.getBucketInfoWithHttpInfo(opts)
.then(function(response_and_data) {
return response_and_data.data;
});
@ -463,7 +417,7 @@ export default class BucketApi {
let accepts = ['application/json'];
let returnType = [ListBuckets200ResponseInner];
return this.apiClient.callApi(
'/bucket', 'GET',
'/bucket?list', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
@ -601,16 +555,16 @@ export default class BucketApi {
/**
* Update a bucket
* All fields (`websiteAccess` and `quotas`) are optionnal. If they are present, the corresponding modifications are applied to the bucket, otherwise nothing is changed. In `websiteAccess`: if `enabled` is `true`, `indexDocument` must be specified. The field `errorDocument` is optional, if no error document is set a generic error message is displayed when errors happen. Conversely, if `enabled` is `false`, neither `indexDocument` nor `errorDocument` must be specified. In `quotas`: new values of `maxSize` and `maxObjects` must both be specified, or set to `null` to remove the quotas. An absent value will be considered the same as a `null`. It is not possible to change only one of the two quotas.
* @param {String} bucketId The exact bucket identifier, a 32 bytes hexadecimal string
* All fields (`websiteAccess` and `quotas`) are optional. If they are present, the corresponding modifications are applied to the bucket, otherwise nothing is changed. In `websiteAccess`: if `enabled` is `true`, `indexDocument` must be specified. The field `errorDocument` is optional, if no error document is set a generic error message is displayed when errors happen. Conversely, if `enabled` is `false`, neither `indexDocument` nor `errorDocument` must be specified. In `quotas`: new values of `maxSize` and `maxObjects` must both be specified, or set to `null` to remove the quotas. An absent value will be considered the same as a `null`. It is not possible to change only one of the two quotas.
* @param {String} id The exact bucket identifier, a 32 bytes hexadecimal string
* @param {module:model/UpdateBucketRequest} updateBucketRequest Requested changes on the bucket. Both root fields are optionals.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
*/
updateBucketWithHttpInfo(bucketId, updateBucketRequest) {
updateBucketWithHttpInfo(id, updateBucketRequest) {
let postBody = updateBucketRequest;
// verify the required parameter 'bucketId' is set
if (bucketId === undefined || bucketId === null) {
throw new Error("Missing the required parameter 'bucketId' when calling updateBucket");
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling updateBucket");
}
// verify the required parameter 'updateBucketRequest' is set
if (updateBucketRequest === undefined || updateBucketRequest === null) {
@ -618,9 +572,9 @@ export default class BucketApi {
}
let pathParams = {
'bucket_id': bucketId
};
let queryParams = {
'id': id
};
let headerParams = {
};
@ -632,7 +586,7 @@ export default class BucketApi {
let accepts = ['application/json'];
let returnType = BucketInfo;
return this.apiClient.callApi(
'/bucket?id={bucket_id}', 'PUT',
'/bucket', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
@ -640,13 +594,13 @@ export default class BucketApi {
/**
* Update a bucket
* All fields (`websiteAccess` and `quotas`) are optionnal. If they are present, the corresponding modifications are applied to the bucket, otherwise nothing is changed. In `websiteAccess`: if `enabled` is `true`, `indexDocument` must be specified. The field `errorDocument` is optional, if no error document is set a generic error message is displayed when errors happen. Conversely, if `enabled` is `false`, neither `indexDocument` nor `errorDocument` must be specified. In `quotas`: new values