(ScaleOutRelay)
Requires that the scale-out-relay
plugin is installed on the server.
Manage relays.
- DemoteToNode - Demote a relay to simple node
- PromoteToRelay - Promote a node to relay
Demote a relay to a simple node.
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
}
}
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 |
*operations.DemoteToNodeResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Promote a node to relay
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
}
}
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 |
*operations.PromoteToRelayResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |