Skip to content

list_executors async

list_executors(
    session_id: SessionId,
    *,
    config_overrides: Optional[AsyncAthenaClientConfig] = None,
    executor_state_filter: Optional[ExecutorState] = None,
    max_results: Optional[MaxListExecutorsCount] = None,
    next_token: Optional[SessionManagerToken] = None,
) -> ListExecutorsResponse

Lists, in descending order, the executors that joined a session. Newer executors are listed first; older executors are listed later. The result can be optionally filtered by state.

Parameters:

  • session_id (SessionId) –

    The session ID.

  • executor_state_filter (Optional[ExecutorState], default: None ) –

    A filter for a specific executor state. A description of each state follows.

    CREATING - The executor is being started, including acquiring resources.

    CREATED - The executor has been started.

    REGISTERED - The executor has been registered.

    TERMINATING - The executor is in the process of shutting down.

    TERMINATED - The executor is no longer running.

    FAILED - Due to a failure, the executor is no longer running.

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

    The maximum number of executors to return.

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

    A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

Raises:

Source code in docs_src/capo_athena/_services/async_athena.py
async def list_executors(
    self,
    session_id: "capo_athena.types.session_id.SessionId",
    *,
    config_overrides: Optional[AsyncAthenaClientConfig] = None,
    executor_state_filter: Optional[
        "capo_athena.types.executor_state.ExecutorState"
    ] = None,
    max_results: Optional[
        "capo_athena.types.max_list_executors_count.MaxListExecutorsCount"
    ] = None,
    next_token: Optional[
        "capo_athena.types.session_manager_token.SessionManagerToken"
    ] = None,
) -> "capo_athena.types.list_executors_response.ListExecutorsResponse":
    """<p>Lists, in descending order, the executors that joined a session. Newer executors are listed first; older executors are listed later. The result can be optionally filtered by state.</p>

    Args:
        session_id: <p>The session ID.</p>
        executor_state_filter: <p>A filter for a specific executor state. A description of each state follows.</p> <p> <code>CREATING</code> - The executor is being started, including acquiring resources.</p> <p> <code>CREATED</code> - The executor has been started.</p> <p> <code>REGISTERED</code> - The executor has been registered.</p> <p> <code>TERMINATING</code> - The executor is in the process of shutting down.</p> <p> <code>TERMINATED</code> - The executor is no longer running.</p> <p> <code>FAILED</code> - Due to a failure, the executor is no longer running.</p>
        max_results: <p>The maximum number of executors to return.</p>
        next_token: <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>

    Raises:
        capo_athena.errors.internal_server_exception.InternalServerException: <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
        capo_athena.errors.invalid_request_exception.InvalidRequestException: <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
        capo_athena.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource, such as a workgroup, was not found.</p>
        capo_athena.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_athena.types.list_executors_request.ListExecutorsRequest]",
    ) -> AsyncOperationResponse[
        "capo_athena.types.list_executors_response.ListExecutorsResponse"
    ]:
        import capo_athena._operations.amazon_athena.list_executors

        (
            output,
            http_response,
        ) = await capo_athena._operations.amazon_athena.list_executors.async_list_executors(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListExecutors")
    )
    input_: capo_athena.types.list_executors_request.ListExecutorsRequest = {
        "session_id": session_id
    }
    if executor_state_filter is not None:
        input_["executor_state_filter"] = executor_state_filter
    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