Skip to content

list_export_jobs_v2 async

list_export_jobs_v2(
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    status: Optional[ExportStatus] = None,
    data_type: Optional[ExportDataType] = None,
    max_results: Optional[ExportMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListExportJobsV2Response

Returns the findings export jobs in your account as a paginated list of ExportSummary objects. You can filter the results by job Status or DataType.

To page through the results, use the MaxResults and NextToken parameters. If the response includes a NextToken value, pass it in a subsequent request to retrieve the next page of results.

Each ExportSummary reports the output Format of the job but not its full OutputConfiguration. To retrieve the filters and selected fields that a job was started with, call GetExportJobV2.

Parameters:

  • status (Optional[ExportStatus], default: None ) –

    Filters the results to export jobs that have the specified status.

  • data_type (Optional[ExportDataType], default: None ) –

    Filters the results to export jobs that produce the specified data type.

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

    The maximum number of results to return in a single call. Valid range is 1–20.

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

    The token required for pagination. On your first call, set the value of this parameter to NULL. For subsequent calls, to continue listing data, set the value of this parameter to the value returned in the previous response.

Raises:

Examples:

Example – Listing successful findings export jobs The following example lists the findings export jobs in the account that have succeeded, returning up to 10 results per page.

>>> await client.list_export_jobs_v2(status='SUCCEEDED', data_type='FINDINGS', max_results=10)
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def list_export_jobs_v2(
    self,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    status: Optional["capo_securityhub.types.export_status.ExportStatus"] = None,
    data_type: Optional[
        "capo_securityhub.types.export_data_type.ExportDataType"
    ] = None,
    max_results: Optional[
        "capo_securityhub.types.export_max_results.ExportMaxResults"
    ] = None,
    next_token: Optional["capo_securityhub.types.next_token.NextToken"] = None,
) -> "capo_securityhub.types.list_export_jobs_v2_response.ListExportJobsV2Response":
    """<p>Returns the findings export jobs in your account as a paginated list of <code>ExportSummary</code> objects. You can filter the results by job <code>Status</code> or <code>DataType</code>.</p> <p>To page through the results, use the <code>MaxResults</code> and <code>NextToken</code> parameters. If the response includes a <code>NextToken</code> value, pass it in a subsequent request to retrieve the next page of results.</p> <p>Each <code>ExportSummary</code> reports the output <code>Format</code> of the job but not its full <code>OutputConfiguration</code>. To retrieve the filters and selected fields that a job was started with, call <code>GetExportJobV2</code>.</p>

    Args:
        status: <p>Filters the results to export jobs that have the specified status.</p>
        data_type: <p>Filters the results to export jobs that produce the specified data type.</p>
        max_results: <p>The maximum number of results to return in a single call. Valid range is 1–20.</p>
        next_token: <p>The token required for pagination. On your first call, set the value of this parameter to <code>NULL</code>. For subsequent calls, to continue listing data, set the value of this parameter to the value returned in the previous response.</p>

    Raises:
        capo_securityhub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action specified in the request.</p>
        capo_securityhub.errors.internal_server_exception.InternalServerException: <p> The request has failed due to an internal failure of the service. </p>
        capo_securityhub.errors.throttling_exception.ThrottlingException: <p> The limit on the number of requests per second was exceeded. </p>
        capo_securityhub.errors.validation_exception.ValidationException: <p>The request has failed validation because it's missing required fields or has invalid inputs.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Example – Listing successful findings export jobs
        The following example lists the findings export jobs in the account that have succeeded, returning up to 10 results per page.

        >>> await client.list_export_jobs_v2(status='SUCCEEDED', data_type='FINDINGS', max_results=10)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.list_export_jobs_v2_request.ListExportJobsV2Request]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.list_export_jobs_v2_response.ListExportJobsV2Response"
    ]:
        import capo_securityhub._operations.security_hub_api_service.list_export_jobs_v2

        (
            output,
            http_response,
        ) = await capo_securityhub._operations.security_hub_api_service.list_export_jobs_v2.async_list_export_jobs_v2(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListExportJobsV2")
    )
    input_: capo_securityhub.types.list_export_jobs_v2_request.ListExportJobsV2Request = {}
    if status is not None:
        input_["status"] = status
    if data_type is not None:
        input_["data_type"] = data_type
    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