mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
24 lines
433 B
Go
24 lines
433 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
"net/url"
|
|
)
|
|
|
|
// NodeRemove removes a Node.
|
|
func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options NodeRemoveOptions) error {
|
|
nodeID, err := trimID("node", nodeID)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
query := url.Values{}
|
|
if options.Force {
|
|
query.Set("force", "1")
|
|
}
|
|
|
|
resp, err := cli.delete(ctx, "/nodes/"+nodeID, query, nil)
|
|
defer ensureReaderClosed(resp)
|
|
return err
|
|
}
|