AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Submits a request to change the health status of a custom health check to healthy or unhealthy.
You can use UpdateInstanceCustomHealthStatus
to change the status only for
custom health checks, which you define using HealthCheckCustomConfig
when you
create a service. You can't use it to change the status for RouteĀ 53 health checks,
which you define using HealthCheckConfig
.
For more information, see HealthCheckCustomConfig.
For .NET Core this operation is only available in asynchronous form. Please refer to UpdateInstanceCustomHealthStatusAsync.
Namespace: Amazon.ServiceDiscovery
Assembly: AWSSDK.ServiceDiscovery.dll
Version: 3.x.y.z
public virtual UpdateInstanceCustomHealthStatusResponse UpdateInstanceCustomHealthStatus( UpdateInstanceCustomHealthStatusRequest request )
Container for the necessary parameters to execute the UpdateInstanceCustomHealthStatus service method.
Exception | Condition |
---|---|
CustomHealthNotFoundException | The health check for the instance that's specified by ServiceId and InstanceId isn't a custom health check. |
InstanceNotFoundException | No instance exists with the specified ID, or the instance was recently registered, and information about the instance hasn't propagated yet. |
InvalidInputException | One or more specified values aren't valid. For example, a required value might be missing, a numeric value might be outside the allowed range, or a string value might exceed length constraints. |
ServiceNotFoundException | No service exists with the specified ID. |
This example submits a request to change the health status of an instance associated with a service with a custom health check to HEALTHY.
var client = new AmazonServiceDiscoveryClient(); var response = client.UpdateInstanceCustomHealthStatus(new UpdateInstanceCustomHealthStatusRequest { InstanceId = "i-abcd1234", ServiceId = "srv-e4anhexample0004", Status = "HEALTHY" });
.NET Framework:
Supported in: 4.5, 4.0, 3.5