mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
1d274e9acf
This adds a new parameter insertDefaults to /services/{id}. When this is set, an empty field (such as UpdateConfig) will be populated with default values in the API response. Make "service inspect" use this, so that empty fields do not result in missing information when inspecting a service. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
36 lines
1.6 KiB
Go
36 lines
1.6 KiB
Go
package swarm
|
|
|
|
import (
|
|
basictypes "github.com/docker/docker/api/types"
|
|
"github.com/docker/docker/api/types/backend"
|
|
types "github.com/docker/docker/api/types/swarm"
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
// Backend abstracts a swarm manager.
|
|
type Backend interface {
|
|
Init(req types.InitRequest) (string, error)
|
|
Join(req types.JoinRequest) error
|
|
Leave(force bool) error
|
|
Inspect() (types.Swarm, error)
|
|
Update(uint64, types.Spec, types.UpdateFlags) error
|
|
GetUnlockKey() (string, error)
|
|
UnlockSwarm(req types.UnlockRequest) error
|
|
GetServices(basictypes.ServiceListOptions) ([]types.Service, error)
|
|
GetService(idOrName string, insertDefaults bool) (types.Service, error)
|
|
CreateService(types.ServiceSpec, string) (*basictypes.ServiceCreateResponse, error)
|
|
UpdateService(string, uint64, types.ServiceSpec, basictypes.ServiceUpdateOptions) (*basictypes.ServiceUpdateResponse, error)
|
|
RemoveService(string) error
|
|
ServiceLogs(context.Context, *backend.LogSelector, *basictypes.ContainerLogsOptions) (<-chan *backend.LogMessage, error)
|
|
GetNodes(basictypes.NodeListOptions) ([]types.Node, error)
|
|
GetNode(string) (types.Node, error)
|
|
UpdateNode(string, uint64, types.NodeSpec) error
|
|
RemoveNode(string, bool) error
|
|
GetTasks(basictypes.TaskListOptions) ([]types.Task, error)
|
|
GetTask(string) (types.Task, error)
|
|
GetSecrets(opts basictypes.SecretListOptions) ([]types.Secret, error)
|
|
CreateSecret(s types.SecretSpec) (string, error)
|
|
RemoveSecret(idOrName string) error
|
|
GetSecret(id string) (types.Secret, error)
|
|
UpdateSecret(idOrName string, version uint64, spec types.SecretSpec) error
|
|
}
|