github.com/ssdev-go/moby@v17.12.1-ce-rc2+incompatible/client/node_update.go (about)

     1  package client
     2  
     3  import (
     4  	"net/url"
     5  	"strconv"
     6  
     7  	"github.com/docker/docker/api/types/swarm"
     8  	"golang.org/x/net/context"
     9  )
    10  
    11  // NodeUpdate updates a Node.
    12  func (cli *Client) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error {
    13  	query := url.Values{}
    14  	query.Set("version", strconv.FormatUint(version.Index, 10))
    15  	resp, err := cli.post(ctx, "/nodes/"+nodeID+"/update", query, node, nil)
    16  	ensureReaderClosed(resp)
    17  	return err
    18  }