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

200 lines
4.4 KiB
Markdown
Raw Normal View History

2022-11-13 13:22:00 +00:00
# \NodesApi
2023-11-22 17:28:14 +00:00
All URIs are relative to *http://localhost:3903/v1*
2022-11-13 13:22:00 +00:00
Method | HTTP request | Description
------------- | ------------- | -------------
2023-11-28 13:32:46 +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 13:22:00 +00:00
## AddNode
> []AddNode200ResponseInner AddNode(ctx).RequestBody(requestBody).Execute()
2023-11-28 13:32:46 +00:00
Connect a new node
2022-11-13 13:22:00 +00:00
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
requestBody := []string{"Property_example"} // []string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.NodesApi.AddNode(context.Background()).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NodesApi.AddNode``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AddNode`: []AddNode200ResponseInner
fmt.Fprintf(os.Stdout, "Response from `NodesApi.AddNode`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiAddNodeRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**requestBody** | **[]string** | |
### Return type
[**[]AddNode200ResponseInner**](AddNode200ResponseInner.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
2023-11-28 13:32:46 +00:00
## GetHealth
> GetHealth200Response GetHealth(ctx).Execute()
Cluster health report
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.NodesApi.GetHealth(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NodesApi.GetHealth``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetHealth`: GetHealth200Response
fmt.Fprintf(os.Stdout, "Response from `NodesApi.GetHealth`: %v\n", resp)
}
```
### Path Parameters
This endpoint does not need any parameter.
### Other Parameters
Other parameters are passed through a pointer to a apiGetHealthRequest struct via the builder pattern
### Return type
[**GetHealth200Response**](GetHealth200Response.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
2022-11-13 13:22:00 +00:00
## GetNodes
> GetNodes200Response GetNodes(ctx).Execute()
2023-11-28 13:32:46 +00:00
Describe cluster
2022-11-13 13:22:00 +00:00
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.NodesApi.GetNodes(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NodesApi.GetNodes``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetNodes`: GetNodes200Response
fmt.Fprintf(os.Stdout, "Response from `NodesApi.GetNodes`: %v\n", resp)
}
```
### Path Parameters
This endpoint does not need any parameter.
### Other Parameters
Other parameters are passed through a pointer to a apiGetNodesRequest struct via the builder pattern
### Return type
[**GetNodes200Response**](GetNodes200Response.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)