github.com/jwhonce/docker@v0.6.7-0.20190327063223-da823cf3a5a3/client/node_remove.go (about)

     1  package client // import "github.com/docker/docker/client"
     2  
     3  import (
     4  	"context"
     5  	"net/url"
     6  
     7  	"github.com/docker/docker/api/types"
     8  )
     9  
    10  // NodeRemove removes a Node.
    11  func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error {
    12  	query := url.Values{}
    13  	if options.Force {
    14  		query.Set("force", "1")
    15  	}
    16  
    17  	resp, err := cli.delete(ctx, "/nodes/"+nodeID, query, nil)
    18  	defer ensureReaderClosed(resp)
    19  	return wrapResponseError(err, resp, "node", nodeID)
    20  }