Skip to content

get_console_screenshot async

get_console_screenshot(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    instance_id: Optional[InstanceId] = None,
    wake_up: Optional[Boolean] = None,
) -> GetConsoleScreenshotResult

Retrieve a JPG-format screenshot of a running instance to help with troubleshooting.

The returned content is Base64-encoded.

For more information, see Instance console output in the Amazon EC2 User Guide.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • instance_id (Optional[InstanceId], default: None ) –

    The ID of the instance.

  • wake_up (Optional[Boolean], default: None ) –

    When set to true, acts as keystroke input and wakes up an instance that's in standby or "sleep" mode.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def get_console_screenshot(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    instance_id: Optional["capo_ec2.types.instance_id.InstanceId"] = None,
    wake_up: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.get_console_screenshot_result.GetConsoleScreenshotResult":
    """<p>Retrieve a JPG-format screenshot of a running instance to help with troubleshooting.</p> <p>The returned content is Base64-encoded.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/troubleshoot-unreachable-instance.html#instance-console-console-output">Instance console output</a> in the <i>Amazon EC2 User Guide</i>.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        instance_id: <p>The ID of the instance.</p>
        wake_up: <p>When set to <code>true</code>, acts as keystroke input and wakes up an instance that's in standby or "sleep" mode.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.get_console_screenshot_request.GetConsoleScreenshotRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.get_console_screenshot_result.GetConsoleScreenshotResult"
    ]:
        import capo_ec2._operations.amazon_ec2.get_console_screenshot

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.get_console_screenshot.async_get_console_screenshot(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetConsoleScreenshot")
    )
    input_: capo_ec2.types.get_console_screenshot_request.GetConsoleScreenshotRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if instance_id is not None:
        input_["instance_id"] = instance_id
    if wake_up is not None:
        input_["wake_up"] = wake_up

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output