Skip to content

list_tasks

list_tasks(
    *,
    config_overrides: Optional[DataSyncClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    filters: Optional[TaskFilters] = None,
) -> ListTasksResponse

Returns a list of the DataSync tasks you created.

Parameters:

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

    The maximum number of tasks to return.

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

    An opaque string that indicates the position at which to begin the next list of tasks.

  • filters (Optional[TaskFilters], default: None ) –

    You can use API filters to narrow down the list of resources returned by ListTasks. For example, to retrieve all tasks on a specific source location, you can use ListTasks with filter name LocationId and Operator Equals with the ARN for the location.

Raises:

Source code in docs_src/capo_datasync/_services/data_sync.py
def list_tasks(
    self,
    *,
    config_overrides: Optional[DataSyncClientConfig] = None,
    max_results: Optional["capo_datasync.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_datasync.types.next_token.NextToken"] = None,
    filters: Optional["capo_datasync.types.task_filters.TaskFilters"] = None,
) -> "capo_datasync.types.list_tasks_response.ListTasksResponse":
    """<p>Returns a list of the DataSync tasks you created.</p>

    Args:
        max_results: <p>The maximum number of tasks to return.</p>
        next_token: <p>An opaque string that indicates the position at which to begin the next list of tasks.</p>
        filters: <p>You can use API filters to narrow down the list of resources returned by <code>ListTasks</code>. For example, to retrieve all tasks on a specific source location, you can use <code>ListTasks</code> with filter name <code>LocationId</code> and <code>Operator Equals</code> with the ARN for the location.</p>

    Raises:
        capo_datasync.errors.internal_exception.InternalException: <p>This exception is thrown when an error occurs in the DataSync service.</p>
        capo_datasync.errors.invalid_request_exception.InvalidRequestException: <p>This exception is thrown when the client submits a malformed request.</p>
        capo_datasync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_datasync.types.list_tasks_request.ListTasksRequest]",
    ) -> OperationResponse[
        "capo_datasync.types.list_tasks_response.ListTasksResponse"
    ]:
        import capo_datasync._operations.fmrs_service.list_tasks

        output, http_response = (
            capo_datasync._operations.fmrs_service.list_tasks.list_tasks(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTasks")
    )
    input_: capo_datasync.types.list_tasks_request.ListTasksRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if filters is not None:
        input_["filters"] = filters

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output