You can call this operation to query the health status of an ECS instance.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request headers

This operation uses common request headers, instead of special request headers. For more information, see the "Common request headers" section in "Common request and response headers."

Request syntax

GET /pop/v1/wam/instance/health HTTP/1.1

Request parameters

Parameter Type Required? Example Description
InstanceId String Yes i-wz9hwvnwm5tlv3u*****

The ID of the ECS instance.

Response parameters

Parameter Type Example Description
Code String OK

The response code. The value is OK if the request is successful.

InstanceHealth

The health information about the ECS instance.

AgentStatus String CONNECTED

The agent connection status of the ECS instance.

AppStatus String UNKOWN

The status of the application.

DisconnectedTime Long 0

The total disconnection duration.

InstanceId String i-wz9hwvnwm5tlv3u*****

The ID of the ECS instance.

Message String success

The response message. The value is success if the request is successful.

RequestId String FFBBC86A-2A15-4460-8B9C-BBC8E3F*****

The ID of the request.

Examples

Sample request


http://webplus.cn-hangzhou.aliyuncs.com/pop/v1/wam/instance/health?ServiceCode=webx&Id=i-wz9hwvnwm5tlv3u*****&<Common request parameters>

Sample success response

XML format

<DescribeInstanceHealthResponse>
    <InstanceHealth>
        <DisconnectedTime>0</DisconnectedTime>
        <InstanceId>i-wz9hwvnwm5tlv3u*****</InstanceId>
        <AgentStatus>CONNECTED</AgentStatus>
        <AppStatus>UNKOWN</AppStatus>
    </InstanceHealth>
    <Message>success</Message>
    <RequestId>6618008B-8BDF-4284-802B-E1DA40A*****</RequestId>
    <Code>OK</Code>
</DescribeInstanceHealthResponse>

JSON format

{
	"Message":"success",
	"RequestId":"FFBBC86A-2A15-4460-8B9C-BBC8E3F*****",
	"Code":"OK",
	"InstanceHealth":{
		"DisconnectedTime":0,
		"InstanceId":"i-wz9hwvnwm5tlv3u*****",
		"AgentStatus":"CONNECTED",
		"AppStatus":"UNKOWN"
	}
}

Error codes

HTTP status code Error code Error message Description
400 InstanceIdParamInvalid The specified instance ID does not exist. The error message returned because the specified instance ID does not exist.
403 ResourceAuthFailed The specified resource does not exist or it does not belong to this Alibaba Cloud account. The error message returned because the specified resource does not exist or it does not belong to your Alibaba Cloud account.
404 InstanceNotExists The specified instance does not exist according to the Instance ID declared. The specified instance may have been released or the parameter passed in is invalid. The error message returned because the instance specified by the declared instance ID does not exist. The specified instance may have been released or the parameter passed in may be invalid.

For more information about error codes, see API Error Center.