Skip to content

list_executions async

list_executions(
    workflow_id: WorkflowId,
    *,
    config_overrides: Optional[AsyncTransferClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListExecutionsResponse

Lists all in-progress executions for the specified workflow.

If the specified workflow ID cannot be found, ListExecutions returns a ResourceNotFound exception.

Parameters:

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of items to return.

  • next_token (Optional[NextToken], default: None ) –

    ListExecutions returns the NextToken parameter in the output. You can then pass the NextToken parameter in a subsequent command to continue listing additional executions.

    This is useful for pagination, for instance. If you have 100 executions for a workflow, you might only want to list first 10. If so, call the API by specifying the max-results:

    aws transfer list-executions --max-results 10

    This returns details for the first 10 executions, as well as the pointer (NextToken) to the eleventh execution. You can now call the API again, supplying the NextToken value you received:

    aws transfer list-executions --max-results 10 --next-token $somePointerReturnedFromPreviousListResult

    This call returns the next 10 executions, the 11th through the 20th. You can then repeat the call until the details for all 100 executions have been returned.

  • workflow_id (WorkflowId) –

    A unique identifier for the workflow.

Raises:

Source code in docs_src/capo_transfer/_services/async_transfer.py
async def list_executions(
    self,
    workflow_id: "capo_transfer.types.workflow_id.WorkflowId",
    *,
    config_overrides: Optional[AsyncTransferClientConfig] = None,
    max_results: Optional["capo_transfer.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_transfer.types.next_token.NextToken"] = None,
) -> "capo_transfer.types.list_executions_response.ListExecutionsResponse":
    """<p>Lists all in-progress executions for the specified workflow.</p> <note> <p>If the specified workflow ID cannot be found, <code>ListExecutions</code> returns a <code>ResourceNotFound</code> exception.</p> </note>

    Args:
        max_results: <p>The maximum number of items to return.</p>
        next_token: <p> <code>ListExecutions</code> returns the <code>NextToken</code> parameter in the output. You can then pass the <code>NextToken</code> parameter in a subsequent command to continue listing additional executions.</p> <p> This is useful for pagination, for instance. If you have 100 executions for a workflow, you might only want to list first 10. If so, call the API by specifying the <code>max-results</code>: </p> <p> <code>aws transfer list-executions --max-results 10</code> </p> <p> This returns details for the first 10 executions, as well as the pointer (<code>NextToken</code>) to the eleventh execution. You can now call the API again, supplying the <code>NextToken</code> value you received: </p> <p> <code>aws transfer list-executions --max-results 10 --next-token $somePointerReturnedFromPreviousListResult</code> </p> <p> This call returns the next 10 executions, the 11th through the 20th. You can then repeat the call until the details for all 100 executions have been returned. </p>
        workflow_id: <p>A unique identifier for the workflow.</p>

    Raises:
        capo_transfer.errors.internal_service_error.InternalServiceError: <p>This exception is thrown when an error occurs in the Transfer Family service.</p>
        capo_transfer.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The <code>NextToken</code> parameter that was passed is invalid.</p>
        capo_transfer.errors.invalid_request_exception.InvalidRequestException: <p>This exception is thrown when the client submits a malformed request.</p>
        capo_transfer.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when a resource is not found by the Amazon Web ServicesTransfer Family service.</p>
        capo_transfer.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request has failed because the Amazon Web ServicesTransfer Family service is not available.</p>
        capo_transfer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_transfer.types.list_executions_request.ListExecutionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_transfer.types.list_executions_response.ListExecutionsResponse"
    ]:
        import capo_transfer._operations.transfer_service.list_executions

        (
            output,
            http_response,
        ) = await capo_transfer._operations.transfer_service.list_executions.async_list_executions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListExecutions")
    )
    input_: capo_transfer.types.list_executions_request.ListExecutionsRequest = {
        "workflow_id": workflow_id
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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