updateInstanceCustomHealthStatus
abstract suspend fun updateInstanceCustomHealthStatus(input: UpdateInstanceCustomHealthStatusRequest): UpdateInstanceCustomHealthStatusResponse
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.
Samples
import aws.sdk.kotlin.services.servicediscovery.model.CustomHealthStatus
fun main() {
//sampleStart
// Updates instance custom health status using a service ARN instead of service ID, useful when working
// with shared namespaces.
val resp = serviceDiscoveryClient.updateInstanceCustomHealthStatus {
instanceId = "i-abcd1234xmpl5678"
serviceId = "arn:aws:servicediscovery:us-west-2:123456789012:service/srv-abcd1234xmpl5678"
status = CustomHealthStatus.fromValue("HEALTHY")
}
//sampleEnd
}
import aws.sdk.kotlin.services.servicediscovery.model.CustomHealthStatus
fun main() {
//sampleStart
// This example submits a request to change the health status of an instance associated with a service
// with a custom health check to HEALTHY.
serviceDiscoveryClient.updateInstanceCustomHealthStatus {
instanceId = "i-abcd1234"
serviceId = "srv-e4anhexample0004"
status = CustomHealthStatus.fromValue("HEALTHY")
}
//sampleEnd
}