Revendor engine-api

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 3585026c3a)
Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
Aaron Lehmann 2016-07-22 11:12:27 -07:00 committed by Tibor Vass
parent c166b2c9da
commit 92cbdfece9
2 changed files with 34 additions and 5 deletions

View file

@ -60,7 +60,7 @@ clone git golang.org/x/net 2beffdc2e92c8a3027590f898fe88f69af48a3f8 https://gith
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-connections fa2850ff103453a9ad190da0df0af134f0314b3d
clone git github.com/docker/engine-api ebb728a1346926edc2ad9418f9b6045901810b20
clone git github.com/docker/engine-api 53b6b19ee622c8584c28fdde0e3893383b290da3
clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837
clone git github.com/imdario/mergo 0.2.1

View file

@ -8,6 +8,7 @@ type Service struct {
Meta
Spec ServiceSpec `json:",omitempty"`
Endpoint Endpoint `json:",omitempty"`
UpdateStatus UpdateStatus `json:",omitempty"`
}
// ServiceSpec represents the spec of a service.
@ -29,6 +30,26 @@ type ServiceMode struct {
Global *GlobalService `json:",omitempty"`
}
// UpdateState is the state of a service update.
type UpdateState string
const (
// UpdateStateUpdating is the updating state.
UpdateStateUpdating UpdateState = "updating"
// UpdateStatePaused is the paused state.
UpdateStatePaused UpdateState = "paused"
// UpdateStateCompleted is the completed state.
UpdateStateCompleted UpdateState = "completed"
)
// UpdateStatus reports the status of a service update.
type UpdateStatus struct {
State UpdateState `json:",omitempty"`
StartedAt time.Time `json:",omitempty"`
CompletedAt time.Time `json:",omitempty"`
Message string `json:",omitempty"`
}
// ReplicatedService is a kind of ServiceMode.
type ReplicatedService struct {
Replicas *uint64 `json:",omitempty"`
@ -37,8 +58,16 @@ type ReplicatedService struct {
// GlobalService is a kind of ServiceMode.
type GlobalService struct{}
const (
// UpdateFailureActionPause PAUSE
UpdateFailureActionPause = "pause"
// UpdateFailureActionContinue CONTINUE
UpdateFailureActionContinue = "continue"
)
// UpdateConfig represents the update configuration.
type UpdateConfig struct {
Parallelism uint64 `json:",omitempty"`
Delay time.Duration `json:",omitempty"`
FailureAction string `json:",omitempty"`
}