Skip to content

Latest commit

 

History

History
105 lines (78 loc) · 4.14 KB

README.md

File metadata and controls

105 lines (78 loc) · 4.14 KB

ScaleOutRelay

(ScaleOutRelay)

Overview

Requires that the scale-out-relay plugin is installed on the server.

Manage relays.

Available Operations

DemoteToNode

Demote a relay to a simple node.

Example Usage

package main

import(
	rudder "github.com/infra-rdc/rudder-go"
	"context"
	"log"
)

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )
    var nodeID string = "9a1773c9-0889-40b6-be89-f6504443ac1b"
    ctx := context.Background()
    res, err := s.ScaleOutRelay.DemoteToNode(ctx, nodeID)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
nodeID string ✔️ Id of the target node 9a1773c9-0889-40b6-be89-f6504443ac1b

Response

*operations.DemoteToNodeResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

PromoteToRelay

Promote a node to relay

Example Usage

package main

import(
	rudder "github.com/infra-rdc/rudder-go"
	"context"
	"log"
)

func main() {
    s := rudder.New(
        rudder.WithSecurity("<YOUR_API_KEY_HERE>"),
    )
    var nodeID string = "9a1773c9-0889-40b6-be89-f6504443ac1b"
    ctx := context.Background()
    res, err := s.ScaleOutRelay.PromoteToRelay(ctx, nodeID)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
nodeID string ✔️ Id of the target node 9a1773c9-0889-40b6-be89-f6504443ac1b

Response

*operations.PromoteToRelayResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /