// RemoveNode puts the cluster into the "RESIZING" state and begins the job of
// removing the given node.
RemoveNode puts the cluster into the "RESIZING" state and begins the job of
removing the given node.
// RemoveNode puts the cluster into the " RESIZING " state and begins the job of // removing the given node .
func (api *API) RemoveNode(id string) (*Node, error) {
	if err := api.validate(apiRemoveNode); err != nil {
		return nil, errors.Wrap(err, "validating api method")
	}
	removeNode := api.cluster.nodeByID(id)
	if removeNode == nil {
		if !api.cluster.topologyContainsNode(id) {
			return nil, errors.Wrap(ErrNodeIDNotExists, "finding node to remove")
		}
		removeNode = &Node{
			ID: id,
		}
	}
	err := api.cluster.nodeLeave(id)
	if err != nil {
		return removeNode, errors.Wrap(err, "calling node leave")
	}
	return removeNode, nil
}
func ( api * API ) RemoveNode ( id string ) ( * Node , error ) { if err := api . validate ( apiRemoveNode ) ; err != nil { return nil , errors . Wrap ( err , " " ) } removeNode := api . cluster . nodeByID ( id ) if removeNode == nil { if ! api . cluster . topologyContainsNode ( id ) { return nil , errors . Wrap ( ErrNodeIDNotExists , " " ) } removeNode = & Node { ID : id , } } err := api . cluster . nodeLeave ( id ) if err != nil { return removeNode , errors . Wrap ( err , " " ) } return removeNode , nil }
RemoveNode puts the cluster into the "RESIZING" state and begins the job of
removing the given node.
RemoveNode puts the cluster into the " RESIZING " state and begins the job of removing the given node .
// Start the resize process (similar to NodeJoin)