Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 3585026c3a01928a0e5a22e893af5f52c75e1a85)
Signed-off-by: Tibor Vass <tibor@docker.com>
... | ... |
@@ -60,7 +60,7 @@ clone git golang.org/x/net 2beffdc2e92c8a3027590f898fe88f69af48a3f8 https://gith |
60 | 60 |
clone git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git |
61 | 61 |
clone git github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3 |
62 | 62 |
clone git github.com/docker/go-connections fa2850ff103453a9ad190da0df0af134f0314b3d |
63 |
-clone git github.com/docker/engine-api ebb728a1346926edc2ad9418f9b6045901810b20 |
|
63 |
+clone git github.com/docker/engine-api 53b6b19ee622c8584c28fdde0e3893383b290da3 |
|
64 | 64 |
clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837 |
65 | 65 |
clone git github.com/imdario/mergo 0.2.1 |
66 | 66 |
|
... | ... |
@@ -6,8 +6,9 @@ import "time" |
6 | 6 |
type Service struct { |
7 | 7 |
ID string |
8 | 8 |
Meta |
9 |
- Spec ServiceSpec `json:",omitempty"` |
|
10 |
- Endpoint Endpoint `json:",omitempty"` |
|
9 |
+ Spec ServiceSpec `json:",omitempty"` |
|
10 |
+ Endpoint Endpoint `json:",omitempty"` |
|
11 |
+ UpdateStatus UpdateStatus `json:",omitempty"` |
|
11 | 12 |
} |
12 | 13 |
|
13 | 14 |
// ServiceSpec represents the spec of a service. |
... | ... |
@@ -29,6 +30,26 @@ type ServiceMode struct { |
29 | 29 |
Global *GlobalService `json:",omitempty"` |
30 | 30 |
} |
31 | 31 |
|
32 |
+// UpdateState is the state of a service update. |
|
33 |
+type UpdateState string |
|
34 |
+ |
|
35 |
+const ( |
|
36 |
+ // UpdateStateUpdating is the updating state. |
|
37 |
+ UpdateStateUpdating UpdateState = "updating" |
|
38 |
+ // UpdateStatePaused is the paused state. |
|
39 |
+ UpdateStatePaused UpdateState = "paused" |
|
40 |
+ // UpdateStateCompleted is the completed state. |
|
41 |
+ UpdateStateCompleted UpdateState = "completed" |
|
42 |
+) |
|
43 |
+ |
|
44 |
+// UpdateStatus reports the status of a service update. |
|
45 |
+type UpdateStatus struct { |
|
46 |
+ State UpdateState `json:",omitempty"` |
|
47 |
+ StartedAt time.Time `json:",omitempty"` |
|
48 |
+ CompletedAt time.Time `json:",omitempty"` |
|
49 |
+ Message string `json:",omitempty"` |
|
50 |
+} |
|
51 |
+ |
|
32 | 52 |
// ReplicatedService is a kind of ServiceMode. |
33 | 53 |
type ReplicatedService struct { |
34 | 54 |
Replicas *uint64 `json:",omitempty"` |
... | ... |
@@ -37,8 +58,16 @@ type ReplicatedService struct { |
37 | 37 |
// GlobalService is a kind of ServiceMode. |
38 | 38 |
type GlobalService struct{} |
39 | 39 |
|
40 |
+const ( |
|
41 |
+ // UpdateFailureActionPause PAUSE |
|
42 |
+ UpdateFailureActionPause = "pause" |
|
43 |
+ // UpdateFailureActionContinue CONTINUE |
|
44 |
+ UpdateFailureActionContinue = "continue" |
|
45 |
+) |
|
46 |
+ |
|
40 | 47 |
// UpdateConfig represents the update configuration. |
41 | 48 |
type UpdateConfig struct { |
42 |
- Parallelism uint64 `json:",omitempty"` |
|
43 |
- Delay time.Duration `json:",omitempty"` |
|
49 |
+ Parallelism uint64 `json:",omitempty"` |
|
50 |
+ Delay time.Duration `json:",omitempty"` |
|
51 |
+ FailureAction string `json:",omitempty"` |
|
44 | 52 |
} |