func (g *Cloud) CreateHealthCheck(hc *compute.HealthCheck) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("create")
	return mc.Observe(g.c.HealthChecks().Insert(ctx, meta.GlobalKey(hc.Name), hc))
}
CreateHealthCheck creates the given HealthCheck.
package gce
import (
	"k8s.io/klog/v2"
	computealpha "google.golang.org/api/compute/v0.alpha"
	computebeta "google.golang.org/api/compute/v0.beta"
	compute "google.golang.org/api/compute/v1"
	"github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud"
	"github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/filter"
	"github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta"
	v1 "k8s.io/api/core/v1"
	utilversion "k8s.io/apimachinery/pkg/util/version"
)
const (
	nodesHealthCheckPath = "/healthz"
	lbNodesHealthCheckPort = 10256
)
var (
	minNodesHealthCheckVersion *utilversion.Version
)
func init() {
	if v, err := utilversion.ParseGeneric("1.7.2"); err != nil {
		klog.Fatalf("Failed to parse version for minNodesHealthCheckVersion: %v", err)
	} else {
		minNodesHealthCheckVersion = v
	}
}
func newHealthcheckMetricContext(request string) *metricContext {
	return newHealthcheckMetricContextWithVersion(request, computeV1Version)
}
func newHealthcheckMetricContextWithVersion(request, version string) *metricContext {
	return newGenericMetricContext("healthcheck", request, unusedMetricLabel, unusedMetricLabel, version)
}
func (g *Cloud) GetHTTPHealthCheck(name string) (*compute.HttpHealthCheck, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("get_legacy")
	v, err := g.c.HttpHealthChecks().Get(ctx, meta.GlobalKey(name))
	return v, mc.Observe(err)
}
func (g *Cloud) UpdateHTTPHealthCheck(hc *compute.HttpHealthCheck) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("update_legacy")
	return mc.Observe(g.c.HttpHealthChecks().Update(ctx, meta.GlobalKey(hc.Name), hc))
}
func (g *Cloud) DeleteHTTPHealthCheck(name string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("delete_legacy")
	return mc.Observe(g.c.HttpHealthChecks().Delete(ctx, meta.GlobalKey(name)))
}
func (g *Cloud) CreateHTTPHealthCheck(hc *compute.HttpHealthCheck) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("create_legacy")
	return mc.Observe(g.c.HttpHealthChecks().Insert(ctx, meta.GlobalKey(hc.Name), hc))
}
func (g *Cloud) ListHTTPHealthChecks() ([]*compute.HttpHealthCheck, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("list_legacy")
	v, err := g.c.HttpHealthChecks().List(ctx, filter.None)
	return v, mc.Observe(err)
}
func (g *Cloud) GetHTTPSHealthCheck(name string) (*compute.HttpsHealthCheck, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("get_legacy")
	v, err := g.c.HttpsHealthChecks().Get(ctx, meta.GlobalKey(name))
	return v, mc.Observe(err)
}
func (g *Cloud) UpdateHTTPSHealthCheck(hc *compute.HttpsHealthCheck) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("update_legacy")
	return mc.Observe(g.c.HttpsHealthChecks().Update(ctx, meta.GlobalKey(hc.Name), hc))
}
func (g *Cloud) DeleteHTTPSHealthCheck(name string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("delete_legacy")
	return mc.Observe(g.c.HttpsHealthChecks().Delete(ctx, meta.GlobalKey(name)))
}
func (g *Cloud) CreateHTTPSHealthCheck(hc *compute.HttpsHealthCheck) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("create_legacy")
	return mc.Observe(g.c.HttpsHealthChecks().Insert(ctx, meta.GlobalKey(hc.Name), hc))
}
func (g *Cloud) ListHTTPSHealthChecks() ([]*compute.HttpsHealthCheck, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("list_legacy")
	v, err := g.c.HttpsHealthChecks().List(ctx, filter.None)
	return v, mc.Observe(err)
}
func (g *Cloud) GetHealthCheck(name string) (*compute.HealthCheck, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("get")
	v, err := g.c.HealthChecks().Get(ctx, meta.GlobalKey(name))
	return v, mc.Observe(err)
}
func (g *Cloud) GetAlphaHealthCheck(name string) (*computealpha.HealthCheck, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContextWithVersion("get", computeAlphaVersion)
	v, err := g.c.AlphaHealthChecks().Get(ctx, meta.GlobalKey(name))
	return v, mc.Observe(err)
}
func (g *Cloud) GetBetaHealthCheck(name string) (*computebeta.HealthCheck, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContextWithVersion("get", computeBetaVersion)
	v, err := g.c.BetaHealthChecks().Get(ctx, meta.GlobalKey(name))
	return v, mc.Observe(err)
}
func (g *Cloud) UpdateHealthCheck(hc *compute.HealthCheck) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("update")
	return mc.Observe(g.c.HealthChecks().Update(ctx, meta.GlobalKey(hc.Name), hc))
}
func (g *Cloud) UpdateAlphaHealthCheck(hc *computealpha.HealthCheck) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContextWithVersion("update", computeAlphaVersion)
	return mc.Observe(g.c.AlphaHealthChecks().Update(ctx, meta.GlobalKey(hc.Name), hc))
}
func (g *Cloud) UpdateBetaHealthCheck(hc *computebeta.HealthCheck) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContextWithVersion("update", computeBetaVersion)
	return mc.Observe(g.c.BetaHealthChecks().Update(ctx, meta.GlobalKey(hc.Name), hc))
}
func (g *Cloud) DeleteHealthCheck(name string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()
	mc := newHealthcheckMetricContext("delete")
	return mc.Observe(g.c.HealthChecks().Delete(ctx, meta.GlobalKey(name)))
}