Skip to content

put_launch_action async

put_launch_action(
    resource_id: LaunchActionResourceId,
    action_code: SsmDocumentName,
    order: LaunchActionOrder,
    action_id: LaunchActionId,
    optional: bool,
    active: bool,
    name: LaunchActionName,
    action_version: LaunchActionVersion,
    category: LaunchActionCategory,
    description: LaunchActionDescription,
    *,
    config_overrides: Optional[AsyncdrsClientConfig] = None,
    parameters: Optional[LaunchActionParameters] = None,
) -> PutLaunchActionResponse

Puts a resource launch action.

Parameters:

  • action_code (SsmDocumentName) –

    Launch action code.

  • optional (bool) –

    Whether the launch will not be marked as failed if this action fails.

  • active (bool) –

    Whether the launch action is active.

Raises:

Source code in docs_src/capo_drs/_services/async_drs.py
async def put_launch_action(
    self,
    resource_id: "capo_drs.types.launch_action_resource_id.LaunchActionResourceId",
    action_code: "capo_drs.types.ssm_document_name.SsmDocumentName",
    order: "capo_drs.types.launch_action_order.LaunchActionOrder",
    action_id: "capo_drs.types.launch_action_id.LaunchActionId",
    optional: bool,
    active: bool,
    name: "capo_drs.types.launch_action_name.LaunchActionName",
    action_version: "capo_drs.types.launch_action_version.LaunchActionVersion",
    category: "capo_drs.types.launch_action_category.LaunchActionCategory",
    description: "capo_drs.types.launch_action_description.LaunchActionDescription",
    *,
    config_overrides: Optional[AsyncdrsClientConfig] = None,
    parameters: Optional[
        "capo_drs.types.launch_action_parameters.LaunchActionParameters"
    ] = None,
) -> "capo_drs.types.put_launch_action_response.PutLaunchActionResponse":
    """<p>Puts a resource launch action.</p>

    Args:
        action_code: <p>Launch action code.</p>
        optional: <p>Whether the launch will not be marked as failed if this action fails.</p>
        active: <p>Whether the launch action is active.</p>

    Raises:
        capo_drs.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the target resource.</p>
        capo_drs.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_drs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource for this operation was not found.</p>
        capo_drs.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_drs.errors.uninitialized_account_exception.UninitializedAccountException: <p>The account performing the request has not been initialized.</p>
        capo_drs.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the AWS service.</p>
        capo_drs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_drs.types.put_launch_action_request.PutLaunchActionRequest]",
    ) -> AsyncOperationResponse[
        "capo_drs.types.put_launch_action_response.PutLaunchActionResponse"
    ]:
        import capo_drs._operations.elastic_disaster_recovery_service.put_launch_action

        (
            output,
            http_response,
        ) = await capo_drs._operations.elastic_disaster_recovery_service.put_launch_action.async_put_launch_action(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutLaunchAction")
    )
    input_: capo_drs.types.put_launch_action_request.PutLaunchActionRequest = {
        "resource_id": resource_id,
        "action_code": action_code,
        "order": order,
        "action_id": action_id,
        "optional": optional,
        "active": active,
        "name": name,
        "action_version": action_version,
        "category": category,
        "description": description,
    }
    if parameters is not None:
        input_["parameters"] = parameters

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