Obtains the screenshots of an Elastic Compute Service (ECS) instance.
Usage notes
After ECS returns a Base64-encoded instance screenshot in the JPG format, you must decode the screenshot. We recommend that you call this operation for troubleshooting and diagnostics. Take note of the following items:
- The instance must be in the Running state.
- For instances of the retired instance types, you cannot obtain screenshots. For more information, see Retired instance types.
- If you call this operation on an instance for multiple times, the call interval must be at least 10 seconds. Otherwise, the
Throttling
error is returned.
Debugging
Request parameters
Parameter |
Type |
Required |
Example |
Description |
Action | String | Yes | GetInstanceScreenshot | The operation that you want to perform. Set the value to GetInstanceScreenshot. |
RegionId | String | Yes | cn-shenzhen | The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list. |
InstanceId | String | Yes | i-bp1gbz20g229bvu5**** | The ID of the instance. |
WakeUp | Boolean | No | false | Specifies whether to wake up the instance that is in sleep mode. Valid values:
Default value: false. |
Response parameters
Parameter |
Type |
Example |
Description |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E | The ID of the request. |
InstanceId | String | i-bp1gbz20g229bvu5**** | The ID of the instance. |
Screenshot | String | iVBORw0KGgoA...AAABJRU5ErkJggg== | The Base64-encoded instance screenshot in the JPG format. |
Examples
Sample requests
http://ecs-cn-hangzhou.example.com/?Action=GetInstanceScreenshot
&InstanceId=i-bp1gbz20g229bvu5****
&RegionId=cn-shenzhen
&WakeUp=false
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<GetInstanceScreenshotResponse>
<RequestId>22A1933F-AD02-4560-A6A7-53CF2231D942</RequestId>
<InstanceId>i-bp1gbz20g229bvu5****</InstanceId>
<Screenshot>iVBORw0KGgoA...AAABJRU5ErkJggg==</Screenshot>
</GetInstanceScreenshotResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "22A1933F-AD02-4560-A6A7-53CF2231D942",
"InstanceId" : "i-bp1gbz20g229bvu5****",
"Screenshot" : "iVBORw0KGgoA...AAABJRU5ErkJggg=="
}
Error codes
HTTP status code |
Error code |
Error message |
Description |
400 | MissingParameter | %s | A required parameter is not specified. |
404 | InvalidParameter | %s | Invalid parameter value. |
405 | IncorrectInstanceStatus | %s | This operation cannot be performed on the instance in the current state. |
405 | NotSupported | %s | Your operation is invalid. |
429 | Throttling | %s | The request is denied due to throttling. |
For a list of error codes, see Service error codes.