From cd02aa6a189b795e2a9f87859b4699e246eae7aa Mon Sep 17 00:00:00 2001 From: Cihangir Besiktas Date: Wed, 2 Aug 2017 15:25:57 +0100 Subject: [PATCH] residency field support is added --- application.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/application.go b/application.go index 36f5184..c130c1f 100644 --- a/application.go +++ b/application.go @@ -69,6 +69,7 @@ type Application struct { Executor *string `json:"executor,omitempty"` HealthChecks *[]HealthCheck `json:"healthChecks,omitempty"` ReadinessChecks *[]ReadinessCheck `json:"readinessChecks,omitempty"` + Residency *Residency `json:"residency,omitempty"` Instances *int `json:"instances,omitempty"` Mem *float64 `json:"mem,omitempty"` Tasks []*Task `json:"tasks,omitempty"` @@ -463,6 +464,20 @@ func (r *Application) EmptyReadinessChecks() *Application { return r } +// SetResidency sets the upgrade strategy. +func (r *Application) SetResidency(us Residency) *Application { + r.Residency = &us + return r +} + +// EmptyResidency explicitly empties the residency -- use this if +// you need to empty the residency of an application that already has +// the residency set (setting it to nil will keep the current value). +func (r *Application) EmptyResidency() *Application { + r.Residency = &Residency{} + return r +} + // DeploymentIDs retrieves the application deployments IDs func (r *Application) DeploymentIDs() []*DeploymentID { var deployments []*DeploymentID