Skip to content

delete_command_execution async

delete_command_execution(
    execution_id: CommandExecutionId,
    target_arn: TargetArn,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
) -> DeleteCommandExecutionResponse

Delete a command execution.

Only command executions that enter a terminal state can be deleted from your account.

Parameters:

  • execution_id (CommandExecutionId) –

    The unique identifier of the command execution that you want to delete from your account.

  • target_arn (TargetArn) –

    The Amazon Resource Number (ARN) of the target device for which you want to delete command executions.

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def delete_command_execution(
    self,
    execution_id: "capo_iot.types.command_execution_id.CommandExecutionId",
    target_arn: "capo_iot.types.target_arn.TargetArn",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
) -> "capo_iot.types.delete_command_execution_response.DeleteCommandExecutionResponse":
    """<p>Delete a command execution.</p> <note> <p>Only command executions that enter a terminal state can be deleted from your account.</p> </note>

    Args:
        execution_id: <p>The unique identifier of the command execution that you want to delete from your account.</p>
        target_arn: <p>The Amazon Resource Number (ARN) of the target device for which you want to delete command executions.</p>

    Raises:
        capo_iot.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_iot.errors.internal_server_exception.InternalServerException: <p>Internal error from the service that indicates an unexpected error or that the service is unavailable.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.validation_exception.ValidationException: <p>The request is not valid.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot.types.delete_command_execution_request.DeleteCommandExecutionRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.delete_command_execution_response.DeleteCommandExecutionResponse"
    ]:
        import capo_iot._operations.aws_iot_service.delete_command_execution

        (
            output,
            http_response,
        ) = await capo_iot._operations.aws_iot_service.delete_command_execution.async_delete_command_execution(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteCommandExecution")
    )
    input_: capo_iot.types.delete_command_execution_request.DeleteCommandExecutionRequest = {
        "execution_id": execution_id,
        "target_arn": target_arn,
    }

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