2016-06-13 22:52:49 -04:00
|
|
|
package executor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
2016-06-27 21:08:56 -04:00
|
|
|
"time"
|
2016-06-13 22:52:49 -04:00
|
|
|
|
2016-11-08 12:32:29 -05:00
|
|
|
"github.com/docker/distribution"
|
2016-09-06 14:18:12 -04:00
|
|
|
"github.com/docker/docker/api/types"
|
2016-10-26 04:14:15 -04:00
|
|
|
"github.com/docker/docker/api/types/backend"
|
2016-09-06 14:18:12 -04:00
|
|
|
"github.com/docker/docker/api/types/container"
|
|
|
|
"github.com/docker/docker/api/types/events"
|
|
|
|
"github.com/docker/docker/api/types/filters"
|
|
|
|
"github.com/docker/docker/api/types/network"
|
2016-11-15 10:04:36 -05:00
|
|
|
swarmtypes "github.com/docker/docker/api/types/swarm"
|
2016-06-13 22:52:49 -04:00
|
|
|
clustertypes "github.com/docker/docker/daemon/cluster/provider"
|
2016-11-08 02:59:55 -05:00
|
|
|
"github.com/docker/docker/reference"
|
2016-07-23 11:11:10 -04:00
|
|
|
"github.com/docker/libnetwork"
|
2016-06-13 22:52:49 -04:00
|
|
|
"github.com/docker/libnetwork/cluster"
|
|
|
|
networktypes "github.com/docker/libnetwork/types"
|
2016-11-15 10:04:36 -05:00
|
|
|
"github.com/docker/swarmkit/agent/exec"
|
2016-06-13 22:52:49 -04:00
|
|
|
"golang.org/x/net/context"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Backend defines the executor component for a swarm agent.
|
|
|
|
type Backend interface {
|
|
|
|
CreateManagedNetwork(clustertypes.NetworkCreateRequest) error
|
|
|
|
DeleteManagedNetwork(name string) error
|
2016-07-23 11:11:10 -04:00
|
|
|
FindNetwork(idName string) (libnetwork.Network, error)
|
2016-06-13 22:52:49 -04:00
|
|
|
SetupIngress(req clustertypes.NetworkCreateRequest, nodeIP string) error
|
|
|
|
PullImage(ctx context.Context, image, tag string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error
|
2016-10-20 18:56:27 -04:00
|
|
|
CreateManagedContainer(config types.ContainerCreateConfig, validateHostname bool) (container.ContainerCreateCreatedBody, error)
|
2016-09-19 12:01:16 -04:00
|
|
|
ContainerStart(name string, hostConfig *container.HostConfig, validateHostname bool, checkpoint string, checkpointDir string) error
|
2016-06-06 23:29:05 -04:00
|
|
|
ContainerStop(name string, seconds *int) error
|
2016-10-26 04:14:15 -04:00
|
|
|
ContainerLogs(context.Context, string, *backend.ContainerLogsConfig, chan struct{}) error
|
2016-06-13 22:52:49 -04:00
|
|
|
ConnectContainerToNetwork(containerName, networkName string, endpointConfig *network.EndpointSettings) error
|
2016-09-18 02:30:39 -04:00
|
|
|
ActivateContainerServiceBinding(containerName string) error
|
|
|
|
DeactivateContainerServiceBinding(containerName string) error
|
2016-06-13 22:52:49 -04:00
|
|
|
UpdateContainerServiceConfig(containerName string, serviceConfig *clustertypes.ServiceConfig) error
|
|
|
|
ContainerInspectCurrent(name string, size bool) (*types.ContainerJSON, error)
|
2016-06-14 14:11:43 -04:00
|
|
|
ContainerWaitWithContext(ctx context.Context, name string) error
|
2016-06-13 22:52:49 -04:00
|
|
|
ContainerRm(name string, config *types.ContainerRmConfig) error
|
|
|
|
ContainerKill(name string, sig uint64) error
|
2016-11-15 10:04:36 -05:00
|
|
|
SetContainerSecretStore(name string, store exec.SecretGetter) error
|
|
|
|
SetContainerSecretReferences(name string, refs []*swarmtypes.SecretReference) error
|
2016-06-13 22:52:49 -04:00
|
|
|
SystemInfo() (*types.Info, error)
|
|
|
|
VolumeCreate(name, driverName string, opts, labels map[string]string) (*types.Volume, error)
|
2016-08-20 08:14:26 -04:00
|
|
|
Containers(config *types.ContainerListOptions) ([]*types.Container, error)
|
2016-06-13 22:52:49 -04:00
|
|
|
SetNetworkBootstrapKeys([]*networktypes.EncryptionKey) error
|
|
|
|
SetClusterProvider(provider cluster.Provider)
|
2016-06-14 12:13:53 -04:00
|
|
|
IsSwarmCompatible() error
|
2016-06-27 21:08:56 -04:00
|
|
|
SubscribeToEvents(since, until time.Time, filter filters.Args) ([]events.Message, chan interface{})
|
|
|
|
UnsubscribeFromEvents(listener chan interface{})
|
2016-08-23 19:50:15 -04:00
|
|
|
UpdateAttachment(string, string, string, *network.NetworkingConfig) error
|
|
|
|
WaitForDetachment(context.Context, string, string, string, string) error
|
2016-11-08 12:32:29 -05:00
|
|
|
GetRepository(context.Context, reference.NamedTagged, *types.AuthConfig) (distribution.Repository, bool, error)
|
2016-11-10 16:51:52 -05:00
|
|
|
LookupImage(name string) (*types.ImageInspect, error)
|
2016-06-13 22:52:49 -04:00
|
|
|
}
|