View, update, and delete Composite Health resources
This page describes how to manage your Composite Health resources after you have created them. You can list, describe, update, and delete health aggregation policies, health sources, and composite health checks.
Manage health aggregation policies
This section describes how to manage health aggregation policies.
List health aggregation policies
You can list the health aggregation policies that you have configured.
Console
In the Google Cloud console, go to the Composite Health page:
Click Health aggregation policies.
gcloud
To list all health aggregation policies in a region, use the
gcloud compute health-aggregation-policies list command.
gcloud compute health-aggregation-policies list \
--regions=REGION
Replace REGION with the region of the health aggregation
policies.
API
To list all health aggregation policies in a region, send a request to the
regionHealthAggregationPolicies.list method.
HTTP method and URL:
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/healthAggregationPolicies
Replace the following:
PROJECT_ID: the project ID for the health aggregation policy.REGION: the region of the health aggregation policies.
Describe a health aggregation policy
You can describe a health aggregation policy to view its details.
Console
In the Google Cloud console, go to the Composite Health page:
Click Health aggregation policies.
Click the name of the health aggregation policy that you want to describe.
gcloud
Use the
gcloud compute health-aggregation-policies describe command.
gcloud compute health-aggregation-policies describe POLICY \
--region=REGION
Replace the following:
POLICY: the name of the health aggregation policyREGION: the region of the health aggregation policy
API
Send a request to the
regionHealthAggregationPolicies.get method.
HTTP method and URL:
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/healthAggregationPolicies/POLICY
Replace the following:
PROJECT_ID: the project ID for the health aggregation policy.REGION: the region of the health aggregation policy.POLICY: the name of the health aggregation policy.
Update a health aggregation policy
You can update the description, percentage healthy threshold, or minimum healthy threshold of a health aggregation policy.
Console
In the Google Cloud console, go to the Composite Health page:
Click Health aggregation policies.
Click the name of the health aggregation policy that you want to update.
Click Edit.
Update the fields that you want to change.
Click Save.
gcloud
Use the
gcloud compute health-aggregation-policies update command.
Omit the flags for properties that you don't want to update.
gcloud compute health-aggregation-policies update POLICY \
--region=REGION \
--description="DESCRIPTION" \
--healthy-percent-threshold=PERCENT_HEALTHY \
--min-healthy-threshold=MINIMUM_HEALTHY
Replace the following:
POLICY: the name of the health aggregation policy to updateREGION: the region of the health aggregation policyDESCRIPTION: an updated description for the policyPERCENT_HEALTHY: the updated minimum percentage of endpoints in a backend service that must be healthy for the health source to be considered healthy—for example,75MINIMUM_HEALTHY: the updated minimum number of endpoints in a backend service that must be healthy for the health source to be considered healthy—for example,2
API
Describe the health aggregation policy and note the value for the
fingerprintkey, which you will use in the next step.Send a request to the
regionHealthAggregationPolicies.patchmethod. Omit the fields for properties that you don't want to update.HTTP method and URL:
PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/healthAggregationPolicies/POLICY
Request JSON body:
{ "description": "DESCRIPTION", "healthyPercentThreshold": PERCENT_HEALTHY, "minHealthyThreshold": MINIMUM_HEALTHY, "fingerprint": "FINGERPRINT" }Replace the following:
PROJECT_ID: the project ID for the health aggregation policy.REGION: the region of the health aggregation policy.POLICY: the name of the health aggregation policy to update.DESCRIPTION: an updated description for the policy.PERCENT_HEALTHY: the updated minimum percentage of endpoints in a backend service that must be healthy for the health source to be considered healthy—for example,75.MINIMUM_HEALTHY: the updated minimum number of endpoints in a backend service that must be healthy for the health source to be considered healthy—for example,2.FINGERPRINT: the up-to-date value for thefingerprintkey that you found in the previous step.
Delete a health aggregation policy
You can delete a health aggregation policy if it isn't associated with an existing health source.
Console
In the Google Cloud console, go to the Composite Health page:
Click Health aggregation policies.
Select the checkbox next to the health aggregation policy that you want to delete.
Click Delete.
To confirm, click Delete.
gcloud
Use the
gcloud compute health-aggregation-policies delete command.
gcloud compute health-aggregation-policies delete POLICY \
--region=REGION
Replace the following:
POLICY: the name of the health aggregation policy to deleteREGION: the region of the health aggregation policy
API
Send a request to the
regionHealthAggregationPolicies.delete method.
HTTP method and URL:
DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/healthAggregationPolicies/POLICY
Replace the following:
PROJECT_ID: the project ID for the health aggregation policy.REGION: the region of the health aggregation policy.POLICY: the name of the health aggregation policy to delete.
Manage health sources
The following sections describe how to manage your health sources.
List health sources
You can list the health sources that you have configured.
Console
In the Google Cloud console, go to the Composite Health page:
Click Health sources.
gcloud
To list all health sources in a region, use the
gcloud compute health-sources list command.
gcloud compute health-sources list \
--regions=REGION
Replace REGION with the region of the health sources.
API
To list all health sources in a region, send a request to the
regionHealthSources.list method.
HTTP method and URL:
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/healthSources
Replace the following:
PROJECT_ID: the project ID for the health source.REGION: the region of the health sources.
Describe a health source
You can describe a health source to view its details.
Console
In the Google Cloud console, go to the Composite Health page:
Click Health sources.
Click the name of the health source that you want to describe.
gcloud
Use the
gcloud compute health-sources describe command.
gcloud compute health-sources describe HEALTH_SOURCE \
--region=REGION
Replace the following:
HEALTH_SOURCE: the name of the health sourceREGION: the region of the health source
API
Send a request to the
regionHealthSources.get method.
HTTP method and URL:
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/healthSources/HEALTH_SOURCE
Replace the following:
PROJECT_ID: the project ID for the health source.REGION: the region of the health source.HEALTH_SOURCE: the name of the health source.
Update a health source
You can update the description, backend service, or health aggregation policy of an existing health source.
Console
In the Google Cloud console, go to the Composite Health page:
Click Health sources.
Click the name of the health source that you want to update.
Click Edit.
Update the fields that you want to change.
Click Save.
gcloud
Use the gcloud compute health-sources update command.
Omit the flags for properties that you don't want to update.
gcloud compute health-sources update HEALTH_SOURCE \
--region=REGION \
--description="DESCRIPTION" \
--sources=BACKEND_SERVICE \
--health-aggregation-policy=POLICY
Replace the following:
HEALTH_SOURCE: the name of the health source to updateREGION: the region of the health sourceDESCRIPTION: an updated description for the health sourceBACKEND_SERVICE: the name of a backend service to use as the source of healthThe backend service must fulfill the following requirements:
- It must have a load balancing scheme of
INTERNALorINTERNAL_MANAGED. - It must be in the same region as the health source you are creating.
- Its backends must be instance groups or
network endpoint groups of type
GCE_VM_IPorGCE_VM_IP_PORT.
- It must have a load balancing scheme of
POLICY: the name of an updated health aggregation policy to apply to this health source.
API
- Describe the health source
and note the value for the
fingerprintkey, which you will use in the next step. Send a request to the
regionHealthSources.patchmethod. Omit the fields for properties that you don't want to update.HTTP method and URL:
PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/healthSources/HEALTH_SOURCE
Request JSON body:
{ "description": "DESCRIPTION", "sources": [ "projects/PROJECT_ID/regions/REGION/backendServices/BACKEND_SERVICE" ], "healthAggregationPolicy": "projects/PROJECT_ID/regions/REGION/healthAggregationPolicies/POLICY", "fingerprint": "FINGERPRINT" }Replace the following:
PROJECT_ID: the project ID for the health source.REGION: the region of the health source.HEALTH_SOURCE: the name of the health source to update.DESCRIPTION: an updated description for the health source.BACKEND_SERVICE: the name of a backend service to use as the source of health.The backend service must fulfill the following requirements:
- It must have a load balancing scheme of
INTERNALorINTERNAL_MANAGED. - It must be in the same region as the health source you are creating.
- Its backends must be instance groups or
network endpoint groups of type
GCE_VM_IPorGCE_VM_IP_PORT.
- It must have a load balancing scheme of
POLICY: an updated health aggregation policy to apply to this health source.FINGERPRINT: the up-to-date value for thefingerprintkey that you found in the previous step.
Delete a health source
You can delete a health source if it isn't associated with an existing composite health check.
Console
In the Google Cloud console, go to the Composite Health page:
Click Health sources.
Select the checkbox next to the health source that you want to delete.
Click Delete.
To confirm, click Delete.
gcloud
Use the gcloud compute health-sources delete command.
gcloud compute health-sources delete HEALTH_SOURCE \
--region=REGION
Replace the following:
HEALTH_SOURCE: the name of the health source to deleteREGION: the region of the health source
API
Send a request to the
regionHealthSources.delete method.
HTTP method and URL:
DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/healthSources/HEALTH_SOURCE
Replace the following:
PROJECT_ID: the project ID for the health source.REGION: the region of the health source.HEALTH_SOURCE: the name of the health source to delete.
Manage composite health checks
The following sections describe how to manage your composite health checks.
List composite health checks
You can list the composite health checks that you have configured.
Console
In the Google Cloud console, go to the Composite Health page:
Click Composite health checks.
gcloud
To list all composite health checks in a region, use the
gcloud compute composite-health-checks list command.
gcloud compute composite-health-checks list \
--regions=REGION
Replace REGION with the region of the composite health checks.
API
To list all composite health checks in a region, send a request to the
regionCompositeHealthChecks.list method.
HTTP method and URL:
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/compositeHealthChecks
Replace the following:
PROJECT_ID: the project ID for the composite health check.REGION: the region of the composite health checks.
Describe a composite health check
You can describe a composite health check to view its details.
Console
In the Google Cloud console, go to the Composite Health page:
Click Composite health checks.
Click the name of the composite health check that you want to describe.
gcloud
Use the
gcloud compute composite-health-checks describe command.
gcloud compute composite-health-checks describe COMPOSITE_HEALTH_CHECK \
--region=REGION
Replace the following:
COMPOSITE_HEALTH_CHECK: the name of the composite health checkREGION: the region of the composite health check
API
Send a request to the
regionCompositeHealthChecks.get method.
HTTP method and URL:
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/compositeHealthChecks/COMPOSITE_HEALTH_CHECK
Replace the following:
PROJECT_ID: the project ID for the composite health check.REGION: the region of the composite health check.COMPOSITE_HEALTH_CHECK: the name of the composite health check.
Update a composite health check
You can update the description, health sources, or health destination of a composite health check.
Console
In the Google Cloud console, go to the Composite Health page:
Click Composite health checks.
Click the name of the composite health check that you want to update.
Click Edit.
Update the fields that you want to change.
Click Save.
gcloud
Use the
gcloud compute composite-health-checks update command.
Omit the flags for properties that you don't want to update.
gcloud compute composite-health-checks update COMPOSITE_HEALTH_CHECK \
--region=REGION \
--description="DESCRIPTION" \
--health-sources=HEALTH_SOURCES \
--health-destination=HEALTH_DESTINATION
Replace the following:
COMPOSITE_HEALTH_CHECK: the name of the composite health check to updateREGION: the region of the composite health checkDESCRIPTION: an updated descriptionHEALTH_SOURCES: the names of one or more health sources to associate with the composite health checkYou can include multiple health sources in a comma-separated list.
HEALTH_DESTINATION: the URI of the forwarding rule that receives the composite health state from this composite health check—for example,projects/PROJECT_ID/regions/REGION/forwardingRules/FORWARDING_RULE.The forwarding rule must be associated with a producer load balancer that supports Composite Health and fulfills the following requirements:
- It must have a load balancing scheme of
INTERNALorINTERNAL_MANAGED. - It must be in the same region as the composite health check.
- It must have a load balancing scheme of
API
Describe the composite health check and note the value for the
fingerprintkey, which you will use in the next step.Send a request to the
regionCompositeHealthChecks.patchmethod. Omit the fields for properties that you don't want to update.HTTP method and URL:
PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/compositeHealthChecks/COMPOSITE_HEALTH_CHECK
Request JSON body:
{ "description": "DESCRIPTION", "healthSources": [ "projects/PROJECT_ID/regions/REGION/healthSources/HEALTH_SOURCE" ], "healthDestination": "projects/PROJECT_ID/regions/REGION/forwardingRules/FORWARDING_RULE", "fingerprint": "FINGERPRINT" }Replace the following:
PROJECT_ID: the project ID for the composite health check.REGION: the region of the composite health check.COMPOSITE_HEALTH_CHECK: the name of the composite health check to update.DESCRIPTION: an updated description.HEALTH_SOURCE: the name of a health source to associate with the composite health check. To associate multiple health sources, add each source to thehealthSourcesarray.FORWARDING_RULE: the forwarding rule that receives the composite health state from this composite health check.FINGERPRINT: the up-to-date value for thefingerprintkey that you found in the previous step.
Delete a composite health check
You can delete a composite health check.
Console
In the Google Cloud console, go to the Composite Health page:
Click Composite health checks.
Select the checkbox next to the composite health check that you want to delete.
Click Delete.
To confirm, click Delete.
gcloud
Use the
gcloud compute composite-health-checks delete command.
gcloud compute composite-health-checks delete COMPOSITE_HEALTH_CHECK \
--region=REGION
Replace the following:
COMPOSITE_HEALTH_CHECK: the name of the composite health check to deleteREGION: the region of the composite health check
API
Send a request to the
regionCompositeHealthChecks.delete method.
HTTP method and URL:
DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/compositeHealthChecks/COMPOSITE_HEALTH_CHECK
Replace the following:
PROJECT_ID: the project ID for the composite health check.COMPOSITE_HEALTH_CHECK: the name of the composite health check to delete.REGION: the region of the composite health check.