Migrate existing health check settings

This commit is contained in:
Nick Sardo 2017-06-14 16:14:15 -07:00
parent e3c7f070eb
commit f65b35f766
4 changed files with 76 additions and 13 deletions

View file

@ -125,6 +125,12 @@ func (h *HealthChecks) Get(port int64) (*HealthCheck, error) {
return NewHealthCheck(hc), err
}
// GetLegacy deletes legacy HTTP health checks
func (h *HealthChecks) GetLegacy(port int64) (*compute.HttpHealthCheck, error) {
name := h.namer.BeName(port)
return h.cloud.GetHttpHealthCheck(name)
}
// DeleteLegacy deletes legacy HTTP health checks
func (h *HealthChecks) DeleteLegacy(port int64) error {
name := h.namer.BeName(port)

View file

@ -41,5 +41,6 @@ type HealthChecker interface {
Sync(hc *HealthCheck) (string, error)
Delete(port int64) error
Get(port int64) (*HealthCheck, error)
GetLegacy(port int64) (*compute.HttpHealthCheck, error)
DeleteLegacy(port int64) error
}