|
@@ -6,8 +6,9 @@ import "time"
|
|
type Service struct {
|
|
type Service struct {
|
|
ID string
|
|
ID string
|
|
Meta
|
|
Meta
|
|
- Spec ServiceSpec `json:",omitempty"`
|
|
|
|
- Endpoint Endpoint `json:",omitempty"`
|
|
|
|
|
|
+ Spec ServiceSpec `json:",omitempty"`
|
|
|
|
+ Endpoint Endpoint `json:",omitempty"`
|
|
|
|
+ UpdateStatus UpdateStatus `json:",omitempty"`
|
|
}
|
|
}
|
|
|
|
|
|
// ServiceSpec represents the spec of a service.
|
|
// ServiceSpec represents the spec of a service.
|
|
@@ -29,6 +30,26 @@ type ServiceMode struct {
|
|
Global *GlobalService `json:",omitempty"`
|
|
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.
|
|
// ReplicatedService is a kind of ServiceMode.
|
|
type ReplicatedService struct {
|
|
type ReplicatedService struct {
|
|
Replicas *uint64 `json:",omitempty"`
|
|
Replicas *uint64 `json:",omitempty"`
|
|
@@ -37,8 +58,16 @@ type ReplicatedService struct {
|
|
// GlobalService is a kind of ServiceMode.
|
|
// GlobalService is a kind of ServiceMode.
|
|
type GlobalService struct{}
|
|
type GlobalService struct{}
|
|
|
|
|
|
|
|
+const (
|
|
|
|
+ // UpdateFailureActionPause PAUSE
|
|
|
|
+ UpdateFailureActionPause = "pause"
|
|
|
|
+ // UpdateFailureActionContinue CONTINUE
|
|
|
|
+ UpdateFailureActionContinue = "continue"
|
|
|
|
+)
|
|
|
|
+
|
|
// UpdateConfig represents the update configuration.
|
|
// UpdateConfig represents the update configuration.
|
|
type UpdateConfig struct {
|
|
type UpdateConfig struct {
|
|
- Parallelism uint64 `json:",omitempty"`
|
|
|
|
- Delay time.Duration `json:",omitempty"`
|
|
|
|
|
|
+ Parallelism uint64 `json:",omitempty"`
|
|
|
|
+ Delay time.Duration `json:",omitempty"`
|
|
|
|
+ FailureAction string `json:",omitempty"`
|
|
}
|
|
}
|