garage-admin-sdk-js/docs/NodesApi.md

148 lines
3.7 KiB
Markdown
Raw Permalink Normal View History

2022-11-13 11:28:54 +00:00
# garage.NodesApi
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
Method | HTTP request | Description
------------- | ------------- | -------------
2023-11-28 13:32:11 +00:00
[**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
2022-11-13 11:28:54 +00:00
## addNode
> [AddNode200ResponseInner] addNode(requestBody)
2023-11-28 13:32:11 +00:00
Connect a new node
2022-11-13 11:28:54 +00:00
Instructs this Garage node to connect to other Garage nodes at specified `<node_id>@<net_address>`. `node_id` is generated automatically on node start.
### Example
```javascript
2023-11-22 17:30:42 +00:00
import garage from 'garage_administration_api_v0garage_v0_9_0';
2022-11-13 11:28:54 +00:00
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();
let requestBody = ["null"]; // [String] |
2022-11-13 11:56:24 +00:00
apiInstance.addNode(requestBody).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
2022-11-13 11:28:54 +00:00
});
2022-11-13 11:56:24 +00:00
2022-11-13 11:28:54 +00:00
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**requestBody** | [**[String]**](String.md)| |
### Return type
[**[AddNode200ResponseInner]**](AddNode200ResponseInner.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
2023-11-28 13:32:11 +00:00
## getHealth
> GetHealth200Response getHealth()
Cluster health report
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_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
2022-11-13 11:28:54 +00:00
## getNodes
> GetNodes200Response getNodes()
2023-11-28 13:32:11 +00:00
Describe cluster
2022-11-13 11:28:54 +00:00
2023-11-22 17:30:42 +00:00
Returns the cluster'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*
2022-11-13 11:28:54 +00:00
### Example
```javascript
2023-11-22 17:30:42 +00:00
import garage from 'garage_administration_api_v0garage_v0_9_0';
2022-11-13 11:28:54 +00:00
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();
2022-11-13 11:56:24 +00:00
apiInstance.getNodes().then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
2022-11-13 11:28:54 +00:00
});
2022-11-13 11:56:24 +00:00
2022-11-13 11:28:54 +00:00
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**GetNodes200Response**](GetNodes200Response.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json