You need to enable JavaScript to run this app.
文档中心
云服务器

云服务器

复制全文
下载 pdf
运维
GetConsoleOutput - 获取命令行输出
复制全文
下载 pdf
GetConsoleOutput - 获取命令行输出
调用 GetConsoleOutput 获取实例最近启动、重启或者关机时的系统命令行输出。
使用说明
云服务器无法接入显示设备、无法截屏时,您可以调用该接口,获取最近64KB的系统命令行输出。
注意事项
  • 暂不支持Windows实例。
  • 暂不支持弹性裸金属型规格的实例。
  • 仅支持获取运行中状态实例的系统日志。
  • 本接口存在请求频率限制,建议两次请求间隔10S左右,避免请求频率超过接口限制。
调试
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
请求参数
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数
Action string 必选 示例值:GetConsoleOutput
要执行的操作,取值:GetConsoleOutput。
Version string 必选 示例值:2020-04-01
API的版本,取值:2020-04-01。
InstanceId string 必选 示例值:i-3tiefmkskq3vj0******
实例ID。您可以调用DescribeInstances接口查询获取。
返回参数
下表仅列出本接口特有的返回参数。更多信息请参见返回结构
InstanceId string 示例值:i-3tiefmkskq3vj0******
实例ID。
LastUpdateAt string 示例值:2017-12-08T00:00:00.00Z
最近一次Console输出更新的时间。
Output string 示例值:WzUg3NzY5LjgxMjQ4NF0gUlNQOiAwMDJiOjAwMDAwMGMwMD*******
Base64编码后的实例的系统命令行输出。
请求示例
GET /?Action=GetConsoleOutput&Version=2020-04-01&InstanceId=i-3tiefmkskq3vj0****** HTTP/1.1
Host: ecs.cn-beijing.volcengineapi.com
Region: cn-beijing
ServiceName: ecs
返回示例
{
"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*******"
}
}
错误码
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。
状态码
错误码
错误信息
说明
400
InvalidInstanceStatus
The status of the specified instance does not support this request.
当前实例的状态不支持此操作。
400
InvalidInstanceTypeForGetConsoleOutput.Unsupported
The specified InstanceType does not support get instance console output.
指定的实例类型不支获取实例系统日志。
400
InvalidOperationForWindows.Unsupported
The OSType of this specified instance is Windows, which does not support the operation.
指定的实例是Windows操作系统,不支持该操作。
400
MissingParameter.InstanceId
The required parameter InstanceId is not supplied.
参数实例ID不能为空。
404
InvalidInstance.NotFound
The specified instance does not exist.
指定的实例不存在。
429
FlowLimitExceeded
You've reach the limit on request rate of resources.
您已超过资源请求限速。
500
InternalError
An internal error has occurred.
内部错误,请重试。如果多次尝试失败,请提交工单。
最近更新时间:2025.09.04 16:54:57
这个页面对您有帮助吗?
有用
有用
无用
无用