mirror of https://github.com/docker/docs.git
Vendor engine-api to 6facb3f3c38717b8f618dcedc4c8ce20d1bfc61e
This fix updates engine-api to 6facb3f3c38717b8f618dcedc4c8ce20d1bfc61e. This fix is related to #23090. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
parent
4b86651053
commit
1dab9af5d5
|
|
@ -60,7 +60,7 @@ clone git golang.org/x/net 78cb2c067747f08b343f20614155233ab4ea2ad3 https://gith
|
||||||
clone git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git
|
clone git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git
|
||||||
clone git github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3
|
clone git github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3
|
||||||
clone git github.com/docker/go-connections v0.2.0
|
clone git github.com/docker/go-connections v0.2.0
|
||||||
clone git github.com/docker/engine-api 12fbeb3ac3ca5dc5d0f01d6bac9bda518d46d983
|
clone git github.com/docker/engine-api 6facb3f3c38717b8f618dcedc4c8ce20d1bfc61e
|
||||||
clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837
|
clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837
|
||||||
clone git github.com/imdario/mergo 0.2.1
|
clone git github.com/imdario/mergo 0.2.1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,11 @@ import (
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
|
|
||||||
distreference "github.com/docker/distribution/reference"
|
distreference "github.com/docker/distribution/reference"
|
||||||
"github.com/docker/engine-api/types"
|
|
||||||
"github.com/docker/engine-api/types/reference"
|
"github.com/docker/engine-api/types/reference"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ImageTag tags an image in the docker host
|
// ImageTag tags an image in the docker host
|
||||||
func (cli *Client) ImageTag(ctx context.Context, imageID, ref string, options types.ImageTagOptions) error {
|
func (cli *Client) ImageTag(ctx context.Context, imageID, ref string) error {
|
||||||
distributionRef, err := distreference.ParseNamed(ref)
|
distributionRef, err := distreference.ParseNamed(ref)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error parsing reference: %q is not a valid repository/tag", ref)
|
return fmt.Errorf("Error parsing reference: %q is not a valid repository/tag", ref)
|
||||||
|
|
@ -28,9 +27,6 @@ func (cli *Client) ImageTag(ctx context.Context, imageID, ref string, options ty
|
||||||
query := url.Values{}
|
query := url.Values{}
|
||||||
query.Set("repo", distributionRef.Name())
|
query.Set("repo", distributionRef.Name())
|
||||||
query.Set("tag", tag)
|
query.Set("tag", tag)
|
||||||
if options.Force {
|
|
||||||
query.Set("force", "1")
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := cli.post(ctx, "/images/"+imageID+"/tag", query, nil, nil)
|
resp, err := cli.post(ctx, "/images/"+imageID+"/tag", query, nil, nil)
|
||||||
ensureReaderClosed(resp)
|
ensureReaderClosed(resp)
|
||||||
|
|
|
||||||
|
|
@ -61,12 +61,13 @@ type APIClient interface {
|
||||||
ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDelete, error)
|
ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDelete, error)
|
||||||
ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error)
|
ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error)
|
||||||
ImageSave(ctx context.Context, images []string) (io.ReadCloser, error)
|
ImageSave(ctx context.Context, images []string) (io.ReadCloser, error)
|
||||||
ImageTag(ctx context.Context, image, ref string, options types.ImageTagOptions) error
|
ImageTag(ctx context.Context, image, ref string) error
|
||||||
Info(ctx context.Context) (types.Info, error)
|
Info(ctx context.Context) (types.Info, error)
|
||||||
NetworkConnect(ctx context.Context, networkID, container string, config *network.EndpointSettings) error
|
NetworkConnect(ctx context.Context, networkID, container string, config *network.EndpointSettings) error
|
||||||
NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error)
|
NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error)
|
||||||
NetworkDisconnect(ctx context.Context, networkID, container string, force bool) error
|
NetworkDisconnect(ctx context.Context, networkID, container string, force bool) error
|
||||||
NetworkInspect(ctx context.Context, networkID string) (types.NetworkResource, error)
|
NetworkInspect(ctx context.Context, networkID string) (types.NetworkResource, error)
|
||||||
|
NetworkInspectWithRaw(ctx context.Context, networkID string) (types.NetworkResource, []byte, error)
|
||||||
NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error)
|
NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error)
|
||||||
NetworkRemove(ctx context.Context, networkID string) error
|
NetworkRemove(ctx context.Context, networkID string) error
|
||||||
RegistryLogin(ctx context.Context, auth types.AuthConfig) (types.AuthResponse, error)
|
RegistryLogin(ctx context.Context, auth types.AuthConfig) (types.AuthResponse, error)
|
||||||
|
|
@ -74,6 +75,7 @@ type APIClient interface {
|
||||||
UpdateClientVersion(v string)
|
UpdateClientVersion(v string)
|
||||||
VolumeCreate(ctx context.Context, options types.VolumeCreateRequest) (types.Volume, error)
|
VolumeCreate(ctx context.Context, options types.VolumeCreateRequest) (types.Volume, error)
|
||||||
VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error)
|
VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error)
|
||||||
|
VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error)
|
||||||
VolumeList(ctx context.Context, filter filters.Args) (types.VolumesListResponse, error)
|
VolumeList(ctx context.Context, filter filters.Args) (types.VolumesListResponse, error)
|
||||||
VolumeRemove(ctx context.Context, volumeID string) error
|
VolumeRemove(ctx context.Context, volumeID string) error
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/docker/engine-api/types"
|
"github.com/docker/engine-api/types"
|
||||||
|
|
@ -10,15 +12,27 @@ import (
|
||||||
|
|
||||||
// NetworkInspect returns the information for a specific network configured in the docker host.
|
// NetworkInspect returns the information for a specific network configured in the docker host.
|
||||||
func (cli *Client) NetworkInspect(ctx context.Context, networkID string) (types.NetworkResource, error) {
|
func (cli *Client) NetworkInspect(ctx context.Context, networkID string) (types.NetworkResource, error) {
|
||||||
|
networkResource, _, err := cli.NetworkInspectWithRaw(ctx, networkID)
|
||||||
|
return networkResource, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetworkInspectWithRaw returns the information for a specific network configured in the docker host and it's raw representation.
|
||||||
|
func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string) (types.NetworkResource, []byte, error) {
|
||||||
var networkResource types.NetworkResource
|
var networkResource types.NetworkResource
|
||||||
resp, err := cli.get(ctx, "/networks/"+networkID, nil, nil)
|
resp, err := cli.get(ctx, "/networks/"+networkID, nil, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if resp.statusCode == http.StatusNotFound {
|
if resp.statusCode == http.StatusNotFound {
|
||||||
return networkResource, networkNotFoundError{networkID}
|
return networkResource, nil, networkNotFoundError{networkID}
|
||||||
}
|
}
|
||||||
return networkResource, err
|
return networkResource, nil, err
|
||||||
}
|
}
|
||||||
err = json.NewDecoder(resp.body).Decode(&networkResource)
|
defer ensureReaderClosed(resp)
|
||||||
ensureReaderClosed(resp)
|
|
||||||
return networkResource, err
|
body, err := ioutil.ReadAll(resp.body)
|
||||||
|
if err != nil {
|
||||||
|
return networkResource, nil, err
|
||||||
|
}
|
||||||
|
rdr := bytes.NewReader(body)
|
||||||
|
err = json.NewDecoder(rdr).Decode(&networkResource)
|
||||||
|
return networkResource, body, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/docker/engine-api/types"
|
"github.com/docker/engine-api/types"
|
||||||
|
|
@ -10,15 +12,27 @@ import (
|
||||||
|
|
||||||
// VolumeInspect returns the information about a specific volume in the docker host.
|
// VolumeInspect returns the information about a specific volume in the docker host.
|
||||||
func (cli *Client) VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error) {
|
func (cli *Client) VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error) {
|
||||||
|
volume, _, err := cli.VolumeInspectWithRaw(ctx, volumeID)
|
||||||
|
return volume, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// VolumeInspectWithRaw returns the information about a specific volume in the docker host and it's raw representation
|
||||||
|
func (cli *Client) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) {
|
||||||
var volume types.Volume
|
var volume types.Volume
|
||||||
resp, err := cli.get(ctx, "/volumes/"+volumeID, nil, nil)
|
resp, err := cli.get(ctx, "/volumes/"+volumeID, nil, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if resp.statusCode == http.StatusNotFound {
|
if resp.statusCode == http.StatusNotFound {
|
||||||
return volume, volumeNotFoundError{volumeID}
|
return volume, nil, volumeNotFoundError{volumeID}
|
||||||
}
|
}
|
||||||
return volume, err
|
return volume, nil, err
|
||||||
}
|
}
|
||||||
err = json.NewDecoder(resp.body).Decode(&volume)
|
defer ensureReaderClosed(resp)
|
||||||
ensureReaderClosed(resp)
|
|
||||||
return volume, err
|
body, err := ioutil.ReadAll(resp.body)
|
||||||
|
if err != nil {
|
||||||
|
return volume, nil, err
|
||||||
|
}
|
||||||
|
rdr := bytes.NewReader(body)
|
||||||
|
err = json.NewDecoder(rdr).Decode(&volume)
|
||||||
|
return volume, body, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -215,11 +215,6 @@ type ImageSearchOptions struct {
|
||||||
Filters filters.Args
|
Filters filters.Args
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImageTagOptions holds parameters to tag an image
|
|
||||||
type ImageTagOptions struct {
|
|
||||||
Force bool
|
|
||||||
}
|
|
||||||
|
|
||||||
// ResizeOptions holds parameters to resize a tty.
|
// ResizeOptions holds parameters to resize a tty.
|
||||||
// It can be used to resize container ttys and
|
// It can be used to resize container ttys and
|
||||||
// exec process ttys too.
|
// exec process ttys too.
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ type ContainerExecCreateResponse struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerUpdateResponse contains response of Remote API:
|
// ContainerUpdateResponse contains response of Remote API:
|
||||||
// POST /containers/{name:.*}/update
|
// POST "/containers/{name:.*}/update"
|
||||||
type ContainerUpdateResponse struct {
|
type ContainerUpdateResponse struct {
|
||||||
// Warnings are any warnings encountered during the updating of the container.
|
// Warnings are any warnings encountered during the updating of the container.
|
||||||
Warnings []string `json:"Warnings"`
|
Warnings []string `json:"Warnings"`
|
||||||
|
|
@ -352,13 +352,13 @@ type SummaryNetworkSettings struct {
|
||||||
|
|
||||||
// NetworkSettingsBase holds basic information about networks
|
// NetworkSettingsBase holds basic information about networks
|
||||||
type NetworkSettingsBase struct {
|
type NetworkSettingsBase struct {
|
||||||
Bridge string
|
Bridge string // Bridge is the Bridge name the network uses(e.g. `docker0`)
|
||||||
SandboxID string
|
SandboxID string // SandboxID uniquely represents a container's network stack
|
||||||
HairpinMode bool
|
HairpinMode bool // HairpinMode specifies if hairpin NAT should be enabled on the virtual interface
|
||||||
LinkLocalIPv6Address string
|
LinkLocalIPv6Address string // LinkLocalIPv6Address is an IPv6 unicast address using the link-local prefix
|
||||||
LinkLocalIPv6PrefixLen int
|
LinkLocalIPv6PrefixLen int // LinkLocalIPv6PrefixLen is the prefix length of an IPv6 unicast address
|
||||||
Ports nat.PortMap
|
Ports nat.PortMap // Ports is a collection of PortBinding indexed by Port
|
||||||
SandboxKey string
|
SandboxKey string // SandboxKey identifies the sandbox
|
||||||
SecondaryIPAddresses []network.Address
|
SecondaryIPAddresses []network.Address
|
||||||
SecondaryIPv6Addresses []network.Address
|
SecondaryIPv6Addresses []network.Address
|
||||||
}
|
}
|
||||||
|
|
@ -367,14 +367,14 @@ type NetworkSettingsBase struct {
|
||||||
// during the 2 release deprecation period.
|
// during the 2 release deprecation period.
|
||||||
// It will be removed in Docker 1.11.
|
// It will be removed in Docker 1.11.
|
||||||
type DefaultNetworkSettings struct {
|
type DefaultNetworkSettings struct {
|
||||||
EndpointID string
|
EndpointID string // EndpointID uniquely represents a service endpoint in a Sandbox
|
||||||
Gateway string
|
Gateway string // Gateway holds the gateway address for the network
|
||||||
GlobalIPv6Address string
|
GlobalIPv6Address string // GlobalIPv6Address holds network's global IPv6 address
|
||||||
GlobalIPv6PrefixLen int
|
GlobalIPv6PrefixLen int // GlobalIPv6PrefixLen represents mask length of network's global IPv6 address
|
||||||
IPAddress string
|
IPAddress string // IPAddress holds the IPv4 address for the network
|
||||||
IPPrefixLen int
|
IPPrefixLen int // IPPrefixLen represents mask length of network's IPv4 address
|
||||||
IPv6Gateway string
|
IPv6Gateway string // IPv6Gateway holds gateway address specific for IPv6
|
||||||
MacAddress string
|
MacAddress string // MacAddress holds the MAC address for the network
|
||||||
}
|
}
|
||||||
|
|
||||||
// MountPoint represents a mount point configuration inside the container.
|
// MountPoint represents a mount point configuration inside the container.
|
||||||
|
|
@ -416,16 +416,16 @@ type VolumeCreateRequest struct {
|
||||||
|
|
||||||
// NetworkResource is the body of the "get network" http response message
|
// NetworkResource is the body of the "get network" http response message
|
||||||
type NetworkResource struct {
|
type NetworkResource struct {
|
||||||
Name string
|
Name string // Name is the requested name of the network
|
||||||
ID string `json:"Id"`
|
ID string `json:"Id"` // ID uniquely indentifies a network on a single machine
|
||||||
Scope string
|
Scope string // Scope describes the level at which the network exists (e.g. `global` for cluster-wide or `local` for machine level)
|
||||||
Driver string
|
Driver string // Driver is the Driver name used to create the network (e.g. `bridge`, `overlay`)
|
||||||
EnableIPv6 bool
|
EnableIPv6 bool // EnableIPv6 represents whether to enable IPv6
|
||||||
IPAM network.IPAM
|
IPAM network.IPAM // IPAM is the network's IP Address Management
|
||||||
Internal bool
|
Internal bool // Internal respresents if the network is used internal only
|
||||||
Containers map[string]EndpointResource
|
Containers map[string]EndpointResource // Containers contains endpoints belonging to the network
|
||||||
Options map[string]string
|
Options map[string]string // Options holds the network specific options to use for when creating the network
|
||||||
Labels map[string]string
|
Labels map[string]string // Labels holds metadata specific to the network being created
|
||||||
}
|
}
|
||||||
|
|
||||||
// EndpointResource contains network resources allocated and used for a container in a network
|
// EndpointResource contains network resources allocated and used for a container in a network
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue