You can call this operation to set the health status of the ECS instances in a scaling group.

Description

The scaling group performs health checks and removes unhealthy ECS instances. If you want to reserve an ECS instances, you can switch the ECS instance to the standby or protected state. For more information, see EnterStandby and SetInstancesProtection.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
HealthStatus String Yes Healthy

Specifies the health status of the ECS instance. Valid values:

  • Healthy
  • Unhealthy
InstanceId String Yes i-bp1ap6bro51a7fsa****

The ID of the ECS instance in a scaling group.

Action String No SetInstanceHealth

The operation that you want to perform. Set the value to SetInstanceHealth.

Response parameters

Parameter Type Example Description
RequestId String B755AE57-6093-43E4-938E-DEA422A9B10F

The ID of the request.

Examples

Sample requests


http(s)://ess.aliyuncs.com/? Action=SetInstanceHealth
&HealthStatus=Unhealthy
&InstanceId=i-bp1ap6bro51a7fsa****
&<Common request parameters>

Sample success responses

XML format

<SetInstanceHealthResponse>
        <RequestId>B755AE57-6093-43E4-938E-DEA422A9B10F</RequestId>
</SetInstanceHealthResponse>

JSON format

{
	"RequestId":"B755AE57-6093-43E4-938E-DEA422A9B10F"
}

Error codes

For a list of error codes, visit the API Error Center.

HTTP status code

Error code

Error message

Description

400

InvalidInstanceId.NotFound

Instance "XXX" does not exist.

The error message returned because the specified instance does not exist in the scaling group.

400

InvalidParameter

The specified value of parameter "%s" is not valid.

The error message returned because the specified parameter is invalid.