Skip to content

list_tasks

list_tasks(
    environment_arn: EnvironmentArn,
    project: ProjectName,
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
    filters: Optional[TaskFilterList] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListTasksOutput

Lists all tasks within a governance environment.

Parameters:

  • environment_arn (EnvironmentArn) –

    The ARN of this governance environment.

  • project (ProjectName) –

    The project to list tasks for. Each request is scoped to one project.

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

    The response filter criteria. Optional. See TaskFilterName for the filterable attributes. A result must match every attribute you name, and matches if it equals any of the values you give for that attribute. Omitting filters returns every task in the project.

    A single-valued criterion for framework, framework-version, or control-id narrows the results when every broader component is also supplied. When a broader component is absent, the criterion is applied to the returned results.

    An assessment-id criterion returns the task history for that assessment. It accepts one value and requires single-valued framework, framework-version, and control-id criteria alongside it.

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

    The maximum number of records to return on one page. If you omit it, the operation uses its default page size. If more records are available, use the nextToken value from the response to get the next page.

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

    The pagination token returned by a previous request. Use it to retrieve the next page of results. If the value is null, there are no more results to return.

Raises:

Examples:

List open tasks in a project Lists the open tasks in the payments-prod project so the team can see the remaining PCI-DSS remediation work.

>>> client.list_tasks(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', project='payments-prod', filters=[{'name': 'status', 'values': ['OPEN']}], max_results=20)
Source code in docs_src/capo_assurance/_services/assurance.py
def list_tasks(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    project: "capo_assurance.types.project_name.ProjectName",
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
    filters: Optional[
        "capo_assurance.types.task_filter_list.TaskFilterList"
    ] = None,
    max_results: Optional["capo_assurance.types.max_results.MaxResults"] = None,
    next_token: Optional[
        "capo_assurance.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_assurance.types.list_tasks_output.ListTasksOutput":
    """<p>Lists all tasks within a governance environment.</p>

    Args:
        environment_arn: <p>The ARN of this governance environment.</p>
        project: <p>The project to list tasks for. Each request is scoped to one project.</p>
        filters: <p>The response filter criteria. Optional. See <code>TaskFilterName</code> for the filterable attributes. A result must match every attribute you name, and matches if it equals any of the values you give for that attribute. Omitting <code>filters</code> returns every task in the project.</p> <p>A single-valued criterion for <code>framework</code>, <code>framework-version</code>, or <code>control-id</code> narrows the results when every broader component is also supplied. When a broader component is absent, the criterion is applied to the returned results.</p> <p>An <code>assessment-id</code> criterion returns the task history for that assessment. It accepts one value and requires single-valued <code>framework</code>, <code>framework-version</code>, and <code>control-id</code> criteria alongside it.</p>
        max_results: <p>The maximum number of records to return on one page. If you omit it, the operation uses its default page size. If more records are available, use the <code>nextToken</code> value from the response to get the next page.</p>
        next_token: <p>The pagination token returned by a previous request. Use it to retrieve the next page of results. If the value is null, there are no more results to return.</p>

    Raises:
        capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
        capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
        capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
        capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
        capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List open tasks in a project
        Lists the open tasks in the payments-prod project so the team can see the remaining PCI-DSS remediation work.

        >>> client.list_tasks(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', project='payments-prod', filters=[{'name': 'status', 'values': ['OPEN']}], max_results=20)
    """

    def _handler(
        req: "OperationRequest[capo_assurance.types.list_tasks_input.ListTasksInput]",
    ) -> OperationResponse[
        "capo_assurance.types.list_tasks_output.ListTasksOutput"
    ]:
        import capo_assurance._operations.assurance.list_tasks

        output, http_response = (
            capo_assurance._operations.assurance.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_assurance.types.list_tasks_input.ListTasksInput = {
        "environment_arn": environment_arn,
        "project": project,
    }
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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