зеркало из https://github.com/docker/engine-api.git
Merge pull request #29 from mavenugo/netdisconnect
an option to disconnect an endpoint from a network forcefully
This commit is contained in:
Коммит
9a05c21449
|
@ -60,7 +60,7 @@ type APIClient interface {
|
|||
Info() (types.Info, error)
|
||||
NetworkConnect(networkID, containerID string, config *network.EndpointSettings) error
|
||||
NetworkCreate(options types.NetworkCreate) (types.NetworkCreateResponse, error)
|
||||
NetworkDisconnect(networkID, containerID string) error
|
||||
NetworkDisconnect(networkID, containerID string, force bool) error
|
||||
NetworkInspect(networkID string) (types.NetworkResource, error)
|
||||
NetworkList(options types.NetworkListOptions) ([]types.NetworkResource, error)
|
||||
NetworkRemove(networkID string) error
|
||||
|
|
|
@ -42,9 +42,9 @@ func (cli *Client) NetworkConnect(networkID, containerID string, config *network
|
|||
}
|
||||
|
||||
// NetworkDisconnect disconnects a container from an existent network in the docker host.
|
||||
func (cli *Client) NetworkDisconnect(networkID, containerID string) error {
|
||||
nc := types.NetworkConnect{Container: containerID}
|
||||
resp, err := cli.post("/networks/"+networkID+"/disconnect", nil, nc, nil)
|
||||
func (cli *Client) NetworkDisconnect(networkID, containerID string, force bool) error {
|
||||
nd := types.NetworkDisconnect{Container: containerID, Force: force}
|
||||
resp, err := cli.post("/networks/"+networkID+"/disconnect", nil, nd, nil)
|
||||
ensureReaderClosed(resp)
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -422,4 +422,5 @@ type NetworkConnect struct {
|
|||
// NetworkDisconnect represents the data to be used to disconnect a container from the network
|
||||
type NetworkDisconnect struct {
|
||||
Container string
|
||||
Force bool
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче