mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-03 11:02:11 +08:00
add enable/disable failover in nmctl command (#2857)
This commit is contained in:
18
cli/functions/failover.go
Normal file
18
cli/functions/failover.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package functions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/gravitl/netmaker/models"
|
||||
)
|
||||
|
||||
// EnableNodeFailover - Enable failover for a given Node
|
||||
func EnableNodeFailover(nodeID string) *models.SuccessResponse {
|
||||
return request[models.SuccessResponse](http.MethodPost, fmt.Sprintf("/api/v1/node/%s/failover", nodeID), nil)
|
||||
}
|
||||
|
||||
// DisableNodeFailover - Disable failover for a given Node
|
||||
func DisableNodeFailover(nodeID string) *models.SuccessResponse {
|
||||
return request[models.SuccessResponse](http.MethodDelete, fmt.Sprintf("/api/v1/node/%s/failover", nodeID), nil)
|
||||
}
|
||||
Reference in New Issue
Block a user