garage-admin-sdk-js/docs/NodesApi.md
2022-11-13 12:28:54 +01:00

105 lines
2.7 KiB
Markdown

# garage.NodesApi
All URIs are relative to *http://localhost:3903/v0*
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
> [AddNode200ResponseInner] addNode(requestBody)
Connect target node to other Garage nodes
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
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.NodesApi();
let requestBody = ["null"]; // [String] |
apiInstance.addNode(requestBody, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### 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
## getNodes
> GetNodes200Response getNodes()
Status of this node and other nodes in the cluster
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
### 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.NodesApi();
apiInstance.getNodes((error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### 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