You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
O&M
GetConsoleOutput - Obtains command-line output
Copy page
Download PDF
GetConsoleOutput - Obtains command-line output
Call the GetConsoleOutput API to retrieve the system command-line output at the latest start, restart, or shutdown of an instance.​
Usage notes​
When you cannot access a display device for the ECS instance or capture screenshots of the instance, you can call this operation to obtain the latest system command-line output, up to 64 KB in size.​
Usage notes​
  • Windows instances currently do not support this feature.​
  • Elastic Bare Metal (EBM) instances currently do not support this feature.​
  • This API action is only applicable to instances in the Running state.​
  • This operation has a request limit in frequency. The recommended interval between requests is around 10s to avoid exceeding the operation frequency limit.​
Debugging​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
Only the request parameters specific to this operation and some common parameters are listed below. For more information, refer to Common parameters.​
Action string required Sample value: GetConsoleOutput​
The action that you want to perform. Value: GetConsoleOutput.​
​
Version string required Sample value: 2020-04-01​
The version of the API. Valid value: 2020-04-01.​
​
InstanceId string required Sample value: i-3tiefmkskq3vj0******​
The instance ID. To query the instance ID, call the DescribeInstances operation.​
​
​
​
Response parameters​
Only the response parameters specific to this operation are listed below. For more information, refer to response structure.​
InstanceId string Sample value: i-3tiefmkskq3vj0******​
Instance ID​
​
LastUpdateAt string Sample value: 2017-12-08T00:00:00.00Z​
The update time of the latest Console output.​
​
Output string Sample value: WzUg3NzY5LjgxMjQ4NF0gUlNQOiAwMDJiOjAwMDAwMGMwMD*******​
The Base64-encoded output of the system command line in the instance.​
​
​
​
Sample request​
​
GET /?Action=GetConsoleOutput&Version=2020-04-01&InstanceId=i-3tiefmkskq3vj0****** HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
ServiceName: ecs​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "202106111445100102252431000052****",​
"Action": "GetConsoleOutput",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {​
"InstanceId": "i-3tiefmkskq3vj0******",​
"LastUpdateAt": "2017-12-08T00:00:00.00Z",​
"Output": "WzUg3NzY5LjgxMjQ4NF0gUlNQOiAwMDJiOjAwMDAwMGMwMD*******"​
}​
}​
​
Error codes​
The table below lists the business-related error codes of the operation. For more information, refer to Common error codes.​
​
Status code​
Error code​
Error message​
Description​
400​
InvalidInstanceStatus​
The status of the specified instance does not support this request.​
The current status of the instance does not support this operation.​
400​
InvalidInstanceTypeForGetConsoleOutput.Unsupported​
The specified InstanceType does not support get instance console output.​
The specified instance type does not support obtaining instance console output.​
400​
InvalidOperationForWindows.Unsupported​
The OSType of this specified instance is Windows, which does not support the operation.​
The specified instance is based on the Windows operating system and does not support this operation.​
400​
MissingParameter.InstanceId​
The required parameter InstanceId is not supplied.​
The instance ID cannot be left empty.​
404​
InvalidInstance.NotFound​
The specified instance does not exist.​
The specified instance does not exist.​
429​
FlowLimitExceeded​
You've reached the limit on request rate of resources.​
Request rate of resources exceeds the limit.​
500​
InternalError​
An internal error has occurred.​
An internal error occurred. Try again. If multiple attempts fail, submit a ticket.​
​
​
​
​
Status code​
Error code​
Error message​
Description​
400​
InvalidInstanceStatus​
The status of the specified instance does not support this request.​
The current status of the instance does not support this operation.​
400​
InvalidInstanceTypeForGetConsoleOutput.Unsupported​
The specified InstanceType does not support get instance console output.​
The specified instance type does not support obtaining instance console output.​
400​
InvalidOperationForWindows.Unsupported​
The OSType of this specified instance is Windows, which does not support the operation.​
The specified instance is based on the Windows operating system and does not support this operation.​
400​
MissingParameter.InstanceId​
The required parameter InstanceId is not supplied.​
The instance ID cannot be left empty.​
404​
InvalidInstance.NotFound​
The specified instance does not exist.​
The specified instance does not exist.​
429​
FlowLimitExceeded​
You've reached the limit on request rate of resources.​
Request rate of resources exceeds the limit.​
500​
InternalError​
An internal error has occurred.​
An internal error occurred. Try again. If multiple attempts fail, submit a ticket.​
​
​
Last updated: 2026.06.18 17:48:25