gopkg.in/docker/docker.v20@v20.10.27/client/node_update.go (about)

     1  package client // import "github.com/docker/docker/client"
     2  
     3  import (
     4  	"context"
     5  	"net/url"
     6  	"strconv"
     7  
     8  	"github.com/docker/docker/api/types/swarm"
     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  }