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

3.2 KiB

\NodesApi

All URIs are relative to http://localhost:3903/v1

Method HTTP request Description
AddNode Post /connect Connect target node to other Garage nodes
GetNodes Get /status Status of this node and other nodes in the cluster

AddNode

[]AddNode200ResponseInner AddNode(ctx).RequestBody(requestBody).Execute()

Connect target node to other Garage nodes

Example

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

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetNodes

GetNodes200Response GetNodes(ctx).Execute()

Status of this node and other nodes in the cluster

Example

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

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]