1
0
mirror of https://github.com/containers/skopeo.git synced 2025-05-03 05:26:32 +00:00
skopeo/vendor/github.com/docker/engine-api/client/container_rename.go
Antonio Murdaca 69e08d78ad
Pull in schema1 and docker-daemon
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-10-21 16:48:39 +02:00

17 lines
411 B
Go

package client
import (
"net/url"
"golang.org/x/net/context"
)
// ContainerRename changes the name of a given container.
func (cli *Client) ContainerRename(ctx context.Context, containerID, newContainerName string) error {
query := url.Values{}
query.Set("name", newContainerName)
resp, err := cli.post(ctx, "/containers/"+containerID+"/rename", query, nil, nil)
ensureReaderClosed(resp)
return err
}