Skip to content

start_execution_preview async

start_execution_preview(
    document_name: DocumentName,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    document_version: Optional[DocumentVersion] = None,
    execution_inputs: Optional[ExecutionInputs] = None,
) -> StartExecutionPreviewResponse

Initiates the process of creating a preview showing the effects that running a specified Automation runbook would have on the targeted resources.

Parameters:

  • document_name (DocumentName) –

    The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.

  • document_version (Optional[DocumentVersion], default: None ) –

    The version of the Automation runbook to run. The default value is $DEFAULT.

  • execution_inputs (Optional[ExecutionInputs], default: None ) –

    Information about the inputs that can be specified for the preview operation.

Raises:

Examples:

StartExecutionPreview This example illustrates one usage of StartExecutionPreview

>>> await client.start_execution_preview(document_name='AWS-StartEC2Instance')
Source code in docs_src/capo_ssm/_services/async_ssm.py
async def start_execution_preview(
    self,
    document_name: "capo_ssm.types.document_name.DocumentName",
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    document_version: Optional[
        "capo_ssm.types.document_version.DocumentVersion"
    ] = None,
    execution_inputs: Optional[
        "capo_ssm.types.execution_inputs.ExecutionInputs"
    ] = None,
) -> (
    "capo_ssm.types.start_execution_preview_response.StartExecutionPreviewResponse"
):
    """<p>Initiates the process of creating a preview showing the effects that running a specified Automation runbook would have on the targeted resources.</p>

    Args:
        document_name: <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
        document_version: <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
        execution_inputs: <p>Information about the inputs that can be specified for the preview operation. </p>

    Raises:
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.validation_exception.ValidationException: <p>The request isn't valid. Verify that you entered valid contents for the command and try again.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        StartExecutionPreview
        This example illustrates one usage of StartExecutionPreview

        >>> await client.start_execution_preview(document_name='AWS-StartEC2Instance')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm.types.start_execution_preview_request.StartExecutionPreviewRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.start_execution_preview_response.StartExecutionPreviewResponse"
    ]:
        import capo_ssm._operations.amazon_ssm.start_execution_preview

        (
            output,
            http_response,
        ) = await capo_ssm._operations.amazon_ssm.start_execution_preview.async_start_execution_preview(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartExecutionPreview")
    )
    input_: capo_ssm.types.start_execution_preview_request.StartExecutionPreviewRequest = {
        "document_name": document_name
    }
    if document_version is not None:
        input_["document_version"] = document_version
    if execution_inputs is not None:
        input_["execution_inputs"] = execution_inputs

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