зеркало из https://github.com/docker/engine-api.git
fix lowercase, remove eject and fix order type/consts
Signed-off-by: Victor Vieux <vieux@docker.com> Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com> Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
Родитель
10997922a2
Коммит
690cb2d08c
|
@ -20,9 +20,9 @@ type MountType string
|
|||
|
||||
const (
|
||||
// MountTypeBind BIND
|
||||
MountTypeBind MountType = "BIND"
|
||||
MountTypeBind MountType = "bind"
|
||||
// MountTypeVolume VOLUME
|
||||
MountTypeVolume MountType = "VOLUME"
|
||||
MountTypeVolume MountType = "volume"
|
||||
)
|
||||
|
||||
// Mount represents a mount (volume).
|
||||
|
@ -41,19 +41,20 @@ type MountPropagation string
|
|||
|
||||
const (
|
||||
// MountPropagationRPrivate RPRIVATE
|
||||
MountPropagationRPrivate MountPropagation = "RPRIVATE"
|
||||
MountPropagationRPrivate MountPropagation = "rprivate"
|
||||
// MountPropagationPrivate PRIVATE
|
||||
MountPropagationPrivate MountPropagation = "PRIVATE"
|
||||
MountPropagationPrivate MountPropagation = "private"
|
||||
// MountPropagationRShared RSHARED
|
||||
MountPropagationRShared MountPropagation = "RSHARED"
|
||||
MountPropagationRShared MountPropagation = "rshared"
|
||||
// MountPropagationShared SHARED
|
||||
MountPropagationShared MountPropagation = "SHARED"
|
||||
MountPropagationShared MountPropagation = "shared"
|
||||
// MountPropagationRSlave RSLAVE
|
||||
MountPropagationRSlave MountPropagation = "RSLAVE"
|
||||
MountPropagationRSlave MountPropagation = "rslave"
|
||||
// MountPropagationSlave SLAVE
|
||||
MountPropagationSlave MountPropagation = "SLAVE"
|
||||
MountPropagationSlave MountPropagation = "slave"
|
||||
)
|
||||
|
||||
// BindOptions define options specific to mounts of type "bind".
|
||||
type BindOptions struct {
|
||||
Propagation MountPropagation `json:",omitempty"`
|
||||
}
|
||||
|
@ -62,5 +63,5 @@ type BindOptions struct {
|
|||
type VolumeOptions struct {
|
||||
Populate bool `json:",omitempty"`
|
||||
Labels map[string]string `json:",omitempty"`
|
||||
DriverConfig Driver `json:",omitempty"`
|
||||
DriverConfig *Driver `json:",omitempty"`
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@ package swarm
|
|||
|
||||
// Endpoint represents an endpoint.
|
||||
type Endpoint struct {
|
||||
Spec EndpointSpec `json:",omitempty"`
|
||||
ExposedPorts []PortConfig `json:",omitempty"`
|
||||
VirtualIPs []EndpointVirtualIP `json:",omitempty"`
|
||||
Spec EndpointSpec `json:",omitempty"`
|
||||
Ports []PortConfig `json:",omitempty"`
|
||||
VirtualIPs []EndpointVirtualIP `json:",omitempty"`
|
||||
}
|
||||
|
||||
// EndpointSpec represents the spec of an endpoint.
|
||||
|
@ -18,9 +18,9 @@ type ResolutionMode string
|
|||
|
||||
const (
|
||||
// ResolutionModeVIP VIP
|
||||
ResolutionModeVIP ResolutionMode = "VIP"
|
||||
ResolutionModeVIP ResolutionMode = "vip"
|
||||
// ResolutionModeDNSRR DNSRR
|
||||
ResolutionModeDNSRR ResolutionMode = "DNSRR"
|
||||
ResolutionModeDNSRR ResolutionMode = "dnsrr"
|
||||
)
|
||||
|
||||
// PortConfig represents the config of a port.
|
||||
|
@ -31,18 +31,18 @@ type PortConfig struct {
|
|||
PublishedPort uint32 `json:",omitempty"`
|
||||
}
|
||||
|
||||
// PortConfigProtocol represents the protocol of a port.
|
||||
type PortConfigProtocol string
|
||||
|
||||
const (
|
||||
// TODO(stevvooe): These should be used generally, not just for PortConfig.
|
||||
|
||||
// PortConfigProtocolTCP TCP
|
||||
PortConfigProtocolTCP PortConfigProtocol = "TCP"
|
||||
PortConfigProtocolTCP PortConfigProtocol = "tcp"
|
||||
// PortConfigProtocolUDP UDP
|
||||
PortConfigProtocolUDP PortConfigProtocol = "UDP"
|
||||
PortConfigProtocolUDP PortConfigProtocol = "udp"
|
||||
)
|
||||
|
||||
// PortConfigProtocol represents the protocol of a port.
|
||||
type PortConfigProtocol string
|
||||
|
||||
// EndpointVirtualIP represents the virtual ip of a port.
|
||||
type EndpointVirtualIP struct {
|
||||
NetworkID string `json:",omitempty"`
|
||||
|
@ -69,7 +69,8 @@ type NetworkSpec struct {
|
|||
|
||||
// NetworkAttachmentConfig represents the configuration of a network attachement.
|
||||
type NetworkAttachmentConfig struct {
|
||||
Target string `json:",omitempty"`
|
||||
Target string `json:",omitempty"`
|
||||
Aliases []string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// NetworkAttachment represents a network attchement.
|
||||
|
|
|
@ -19,40 +19,38 @@ type NodeSpec struct {
|
|||
Availability NodeAvailability `json:",omitempty"`
|
||||
}
|
||||
|
||||
const (
|
||||
// NodeRoleWorker WORKER
|
||||
NodeRoleWorker NodeRole = "WORKER"
|
||||
// NodeRoleManager MANAGER
|
||||
NodeRoleManager NodeRole = "MANAGER"
|
||||
)
|
||||
|
||||
// NodeRole represents the role of a node.
|
||||
type NodeRole string
|
||||
|
||||
const (
|
||||
// NodeMembershipPending PENDING
|
||||
NodeMembershipPending NodeMembership = "PENDING"
|
||||
// NodeMembershipAccepted ACCEPTED
|
||||
NodeMembershipAccepted NodeMembership = "ACCEPTED"
|
||||
// NodeMembershipRejected REJECTED
|
||||
NodeMembershipRejected NodeMembership = "REJECTED"
|
||||
// NodeRoleWorker WORKER
|
||||
NodeRoleWorker NodeRole = "worker"
|
||||
// NodeRoleManager MANAGER
|
||||
NodeRoleManager NodeRole = "manager"
|
||||
)
|
||||
|
||||
// NodeMembership represents the membership of a node.
|
||||
type NodeMembership string
|
||||
|
||||
const (
|
||||
// NodeAvailabilityActive ACTIVE
|
||||
NodeAvailabilityActive NodeAvailability = "ACTIVE"
|
||||
// NodeAvailabilityPause PAUSE
|
||||
NodeAvailabilityPause NodeAvailability = "PAUSE"
|
||||
// NodeAvailabilityDrain DRAIN
|
||||
NodeAvailabilityDrain NodeAvailability = "DRAIN"
|
||||
// NodeMembershipPending PENDING
|
||||
NodeMembershipPending NodeMembership = "pending"
|
||||
// NodeMembershipAccepted ACCEPTED
|
||||
NodeMembershipAccepted NodeMembership = "accepted"
|
||||
)
|
||||
|
||||
// NodeAvailability represents the availability of a node.
|
||||
type NodeAvailability string
|
||||
|
||||
const (
|
||||
// NodeAvailabilityActive ACTIVE
|
||||
NodeAvailabilityActive NodeAvailability = "active"
|
||||
// NodeAvailabilityPause PAUSE
|
||||
NodeAvailabilityPause NodeAvailability = "pause"
|
||||
// NodeAvailabilityDrain DRAIN
|
||||
NodeAvailabilityDrain NodeAvailability = "drain"
|
||||
)
|
||||
|
||||
// NodeDescription represents the description of a node.
|
||||
type NodeDescription struct {
|
||||
Hostname string `json:",omitempty"`
|
||||
|
@ -86,36 +84,35 @@ type NodeStatus struct {
|
|||
Message string `json:",omitempty"`
|
||||
}
|
||||
|
||||
const (
|
||||
// ReachabilityUnknown UNKNOWN
|
||||
ReachabilityUnknown Reachability = "UNKNOWN"
|
||||
// ReachabilityUnreachable UNREACHABLE
|
||||
ReachabilityUnreachable Reachability = "UNREACHABLE"
|
||||
// ReachabilityReachable REACHABLE
|
||||
ReachabilityReachable Reachability = "REACHABLE"
|
||||
)
|
||||
|
||||
// Reachability represents the reachability of a node.
|
||||
type Reachability string
|
||||
|
||||
const (
|
||||
// ReachabilityUnknown UNKNOWN
|
||||
ReachabilityUnknown Reachability = "unknown"
|
||||
// ReachabilityUnreachable UNREACHABLE
|
||||
ReachabilityUnreachable Reachability = "unreachable"
|
||||
// ReachabilityReachable REACHABLE
|
||||
ReachabilityReachable Reachability = "reachable"
|
||||
)
|
||||
|
||||
// ManagerStatus represents the status of a manager.
|
||||
type ManagerStatus struct {
|
||||
Leader bool `json:",omitempty"`
|
||||
Reachability Reachability `json:",omitempty"`
|
||||
Message string `json:",omitempty"`
|
||||
Addr string `json:",omitempty"`
|
||||
}
|
||||
|
||||
const (
|
||||
// NodeStateUnknown UNKNOWN
|
||||
NodeStateUnknown NodeState = "UNKNOWN"
|
||||
// NodeStateDown DOWN
|
||||
NodeStateDown NodeState = "DOWN"
|
||||
// NodeStateReady READY
|
||||
NodeStateReady NodeState = "READY"
|
||||
// NodeStateDisconnected DISCONNECTED
|
||||
NodeStateDisconnected NodeState = "DISCONNECTED"
|
||||
)
|
||||
|
||||
// NodeState represents the state of a node.
|
||||
type NodeState string
|
||||
|
||||
const (
|
||||
// NodeStateUnknown UNKNOWN
|
||||
NodeStateUnknown NodeState = "unknown"
|
||||
// NodeStateDown DOWN
|
||||
NodeStateDown NodeState = "down"
|
||||
// NodeStateReady READY
|
||||
NodeStateReady NodeState = "ready"
|
||||
// NodeStateDisconnected DISCONNECTED
|
||||
NodeStateDisconnected NodeState = "disconnected"
|
||||
)
|
||||
|
|
|
@ -65,27 +65,27 @@ type InitRequest struct {
|
|||
|
||||
// JoinRequest is the request used to join a swarm.
|
||||
type JoinRequest struct {
|
||||
ListenAddr string
|
||||
RemoteAddr string
|
||||
Secret string // accept by secret
|
||||
CACertHash string
|
||||
Manager bool
|
||||
ListenAddr string
|
||||
RemoteAddrs []string
|
||||
Secret string // accept by secret
|
||||
CACertHash string
|
||||
Manager bool
|
||||
}
|
||||
|
||||
const (
|
||||
// LocalNodeStateInactive INACTIVE
|
||||
LocalNodeStateInactive LocalNodeState = "INACTIVE"
|
||||
// LocalNodeStatePending PENDING
|
||||
LocalNodeStatePending LocalNodeState = "PENDING"
|
||||
// LocalNodeStateActive ACTIVE
|
||||
LocalNodeStateActive LocalNodeState = "ACTIVE"
|
||||
// LocalNodeStateError ERROR
|
||||
LocalNodeStateError LocalNodeState = "ERROR"
|
||||
)
|
||||
|
||||
// LocalNodeState represents the state of the local node.
|
||||
type LocalNodeState string
|
||||
|
||||
const (
|
||||
// LocalNodeStateInactive INACTIVE
|
||||
LocalNodeStateInactive LocalNodeState = "inactive"
|
||||
// LocalNodeStatePending PENDING
|
||||
LocalNodeStatePending LocalNodeState = "pending"
|
||||
// LocalNodeStateActive ACTIVE
|
||||
LocalNodeStateActive LocalNodeState = "active"
|
||||
// LocalNodeStateError ERROR
|
||||
LocalNodeStateError LocalNodeState = "error"
|
||||
)
|
||||
|
||||
// Info represents generic information about swarm.
|
||||
type Info struct {
|
||||
NodeID string
|
||||
|
|
|
@ -2,38 +2,38 @@ package swarm
|
|||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
// TaskStateNew NEW
|
||||
TaskStateNew TaskState = "NEW"
|
||||
// TaskStateAllocated ALLOCATED
|
||||
TaskStateAllocated TaskState = "ALLOCATED"
|
||||
// TaskStatePending PENDING
|
||||
TaskStatePending TaskState = "PENDING"
|
||||
// TaskStateAssigned ASSIGNED
|
||||
TaskStateAssigned TaskState = "ASSIGNED"
|
||||
// TaskStateAccepted ACCEPTED
|
||||
TaskStateAccepted TaskState = "ACCEPTED"
|
||||
// TaskStatePreparing PREPARING
|
||||
TaskStatePreparing TaskState = "PREPARING"
|
||||
// TaskStateReady READY
|
||||
TaskStateReady TaskState = "READY"
|
||||
// TaskStateStarting STARTING
|
||||
TaskStateStarting TaskState = "STARTING"
|
||||
// TaskStateRunning RUNNING
|
||||
TaskStateRunning TaskState = "RUNNING"
|
||||
// TaskStateComplete COMPLETE
|
||||
TaskStateComplete TaskState = "COMPLETE"
|
||||
// TaskStateShutdown SHUTDOWN
|
||||
TaskStateShutdown TaskState = "SHUTDOWN"
|
||||
// TaskStateFailed FAILED
|
||||
TaskStateFailed TaskState = "FAILED"
|
||||
// TaskStateRejected REJECTED
|
||||
TaskStateRejected TaskState = "REJECTED"
|
||||
)
|
||||
|
||||
// TaskState represents the state of a task.
|
||||
type TaskState string
|
||||
|
||||
const (
|
||||
// TaskStateNew NEW
|
||||
TaskStateNew TaskState = "new"
|
||||
// TaskStateAllocated ALLOCATED
|
||||
TaskStateAllocated TaskState = "allocated"
|
||||
// TaskStatePending PENDING
|
||||
TaskStatePending TaskState = "pending"
|
||||
// TaskStateAssigned ASSIGNED
|
||||
TaskStateAssigned TaskState = "assigned"
|
||||
// TaskStateAccepted ACCEPTED
|
||||
TaskStateAccepted TaskState = "accepted"
|
||||
// TaskStatePreparing PREPARING
|
||||
TaskStatePreparing TaskState = "preparing"
|
||||
// TaskStateReady READY
|
||||
TaskStateReady TaskState = "ready"
|
||||
// TaskStateStarting STARTING
|
||||
TaskStateStarting TaskState = "starting"
|
||||
// TaskStateRunning RUNNING
|
||||
TaskStateRunning TaskState = "running"
|
||||
// TaskStateComplete COMPLETE
|
||||
TaskStateComplete TaskState = "complete"
|
||||
// TaskStateShutdown SHUTDOWN
|
||||
TaskStateShutdown TaskState = "shutdown"
|
||||
// TaskStateFailed FAILED
|
||||
TaskStateFailed TaskState = "failed"
|
||||
// TaskStateRejected REJECTED
|
||||
TaskStateRejected TaskState = "rejected"
|
||||
)
|
||||
|
||||
// Task represents a task.
|
||||
type Task struct {
|
||||
ID string
|
||||
|
@ -41,7 +41,7 @@ type Task struct {
|
|||
|
||||
Spec TaskSpec `json:",omitempty"`
|
||||
ServiceID string `json:",omitempty"`
|
||||
Instance int `json:",omitempty"`
|
||||
Slot int `json:",omitempty"`
|
||||
NodeID string `json:",omitempty"`
|
||||
Status TaskStatus `json:",omitempty"`
|
||||
DesiredState TaskState `json:",omitempty"`
|
||||
|
@ -81,18 +81,18 @@ type RestartPolicy struct {
|
|||
Window *time.Duration `json:",omitempty"`
|
||||
}
|
||||
|
||||
const (
|
||||
// RestartPolicyConditionNone NONE
|
||||
RestartPolicyConditionNone RestartPolicyCondition = "NONE"
|
||||
// RestartPolicyConditionOnFailure ON_FAILURE
|
||||
RestartPolicyConditionOnFailure RestartPolicyCondition = "ON_FAILURE"
|
||||
// RestartPolicyConditionAny ANY
|
||||
RestartPolicyConditionAny RestartPolicyCondition = "ANY"
|
||||
)
|
||||
|
||||
// RestartPolicyCondition represents when to restart.
|
||||
type RestartPolicyCondition string
|
||||
|
||||
const (
|
||||
// RestartPolicyConditionNone NONE
|
||||
RestartPolicyConditionNone RestartPolicyCondition = "none"
|
||||
// RestartPolicyConditionOnFailure ON_FAILURE
|
||||
RestartPolicyConditionOnFailure RestartPolicyCondition = "on_failure"
|
||||
// RestartPolicyConditionAny ANY
|
||||
RestartPolicyConditionAny RestartPolicyCondition = "any"
|
||||
)
|
||||
|
||||
// TaskStatus represents the status of a task.
|
||||
type TaskStatus struct {
|
||||
Timestamp time.Time `json:",omitempty"`
|
||||
|
|
Загрузка…
Ссылка в новой задаче