Skip to content

list_scan_jobs async

list_scan_jobs(
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    by_account_id: Optional[str] = None,
    by_backup_vault_name: Optional[str] = None,
    by_complete_after: Optional[datetime] = None,
    by_complete_before: Optional[datetime] = None,
    by_malware_scanner: Optional[MalwareScanner] = None,
    by_recovery_point_arn: Optional[str] = None,
    by_resource_arn: Optional[str] = None,
    by_resource_type: Optional[ScanResourceType] = None,
    by_scan_result_status: Optional[ScanResultStatus] = None,
    by_state: Optional[ScanState] = None,
    max_results: Optional[ListScanJobsInputMaxResultsInteger] = None,
    next_token: Optional[str] = None,
) -> ListScanJobsOutput

Returns a list of existing scan jobs for an authenticated account for the last 30 days.

Parameters:

  • by_account_id (Optional[str], default: None ) –

    The account ID to list the jobs from. Returns only backup jobs associated with the specified account ID.

    If used from an Amazon Web Services Organizations management account, passing * returns all jobs across the organization.

    Pattern: ^[0-9]{12}$

  • by_backup_vault_name (Optional[str], default: None ) –

    Returns only scan jobs that will be stored in the specified backup vault. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created.

    Pattern: ^[a-zA-Z0-9\-\_\.]{2,50}$

  • by_complete_after (Optional[datetime], default: None ) –

    Returns only scan jobs completed after a date expressed in Unix format and Coordinated Universal Time (UTC).

  • by_complete_before (Optional[datetime], default: None ) –

    Returns only backup jobs completed before a date expressed in Unix format and Coordinated Universal Time (UTC).

  • by_malware_scanner (Optional[MalwareScanner], default: None ) –

    Returns only the scan jobs for the specified malware scanner. Currently only supports GUARDDUTY.

  • by_recovery_point_arn (Optional[str], default: None ) –

    Returns only the scan jobs that are ran against the specified recovery point.

  • by_resource_arn (Optional[str], default: None ) –

    Returns only scan jobs that match the specified resource Amazon Resource Name (ARN).

  • by_resource_type (Optional[ScanResourceType], default: None ) –

    Returns restore testing selections by the specified restore testing plan name.

    • EBSfor Amazon Elastic Block Store

    • EC2for Amazon Elastic Compute Cloud

    • S3for Amazon Simple Storage Service (Amazon S3)

    Pattern: ^[a-zA-Z0-9\-\_\.]{1,50}$

  • by_scan_result_status (Optional[ScanResultStatus], default: None ) –

    Returns only the scan jobs for the specified scan results:

    • THREATS_FOUND

    • NO_THREATS_FOUND

  • by_state (Optional[ScanState], default: None ) –

    Returns only the scan jobs for the specified scanning job state.

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

    The maximum number of items to be returned.

    Valid Range: Minimum value of 1. Maximum value of 1000.

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

    The next item following a partial list of returned items. For example, if a request is made to return MaxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

Raises:

Source code in docs_src/capo_backup/_services/async_backup.py
async def list_scan_jobs(
    self,
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    by_account_id: Optional[str] = None,
    by_backup_vault_name: Optional[str] = None,
    by_complete_after: Optional[datetime.datetime] = None,
    by_complete_before: Optional[datetime.datetime] = None,
    by_malware_scanner: Optional[
        "capo_backup.types.malware_scanner.MalwareScanner"
    ] = None,
    by_recovery_point_arn: Optional[str] = None,
    by_resource_arn: Optional[str] = None,
    by_resource_type: Optional[
        "capo_backup.types.scan_resource_type.ScanResourceType"
    ] = None,
    by_scan_result_status: Optional[
        "capo_backup.types.scan_result_status.ScanResultStatus"
    ] = None,
    by_state: Optional["capo_backup.types.scan_state.ScanState"] = None,
    max_results: Optional[
        "capo_backup.types.list_scan_jobs_input_max_results_integer.ListScanJobsInputMaxResultsInteger"
    ] = None,
    next_token: Optional[str] = None,
) -> "capo_backup.types.list_scan_jobs_output.ListScanJobsOutput":
    r"""<p>Returns a list of existing scan jobs for an authenticated account for the last 30 days.</p>

    Args:
        by_account_id: <p>The account ID to list the jobs from. Returns only backup jobs associated with the specified account ID.</p> <p>If used from an Amazon Web Services Organizations management account, passing <code>*</code> returns all jobs across the organization.</p> <p>Pattern: <code>^[0-9]{12}$</code> </p>
        by_backup_vault_name: <p>Returns only scan jobs that will be stored in the specified backup vault. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created.</p> <p>Pattern: <code>^[a-zA-Z0-9\-\_\.]{2,50}$</code> </p>
        by_complete_after: <p>Returns only scan jobs completed after a date expressed in Unix format and Coordinated Universal Time (UTC).</p>
        by_complete_before: <p>Returns only backup jobs completed before a date expressed in Unix format and Coordinated Universal Time (UTC).</p>
        by_malware_scanner: <p>Returns only the scan jobs for the specified malware scanner. Currently only supports <code>GUARDDUTY</code>.</p>
        by_recovery_point_arn: <p>Returns only the scan jobs that are ran against the specified recovery point.</p>
        by_resource_arn: <p>Returns only scan jobs that match the specified resource Amazon Resource Name (ARN).</p>
        by_resource_type: <p>Returns restore testing selections by the specified restore testing plan name.</p> <ul> <li> <p> <code>EBS</code>for Amazon Elastic Block Store</p> </li> <li> <p> <code>EC2</code>for Amazon Elastic Compute Cloud</p> </li> <li> <p> <code>S3</code>for Amazon Simple Storage Service (Amazon S3)</p> </li> </ul> <p>Pattern: <code>^[a-zA-Z0-9\-\_\.]{1,50}$</code> </p>
        by_scan_result_status: <p>Returns only the scan jobs for the specified scan results:</p> <ul> <li> <p> <code>THREATS_FOUND</code> </p> </li> <li> <p> <code>NO_THREATS_FOUND</code> </p> </li> </ul>
        by_state: <p>Returns only the scan jobs for the specified scanning job state.</p>
        max_results: <p>The maximum number of items to be returned.</p> <p>Valid Range: Minimum value of 1. Maximum value of 1000.</p>
        next_token: <p>The next item following a partial list of returned items. For example, if a request is made to return <code>MaxResults</code> number of items, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>

    Raises:
        capo_backup.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>Indicates that something is wrong with a parameter's value. For example, the value is out of range.</p>
        capo_backup.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request failed due to a temporary failure of the server.</p>
        capo_backup.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_backup.types.list_scan_jobs_input.ListScanJobsInput]",
    ) -> AsyncOperationResponse[
        "capo_backup.types.list_scan_jobs_output.ListScanJobsOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.list_scan_jobs

        (
            output,
            http_response,
        ) = await capo_backup._operations.cryo_controller_user_manager.list_scan_jobs.async_list_scan_jobs(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListScanJobs")
    )
    input_: capo_backup.types.list_scan_jobs_input.ListScanJobsInput = {}
    if by_account_id is not None:
        input_["by_account_id"] = by_account_id
    if by_backup_vault_name is not None:
        input_["by_backup_vault_name"] = by_backup_vault_name
    if by_complete_after is not None:
        input_["by_complete_after"] = by_complete_after
    if by_complete_before is not None:
        input_["by_complete_before"] = by_complete_before
    if by_malware_scanner is not None:
        input_["by_malware_scanner"] = by_malware_scanner
    if by_recovery_point_arn is not None:
        input_["by_recovery_point_arn"] = by_recovery_point_arn
    if by_resource_arn is not None:
        input_["by_resource_arn"] = by_resource_arn
    if by_resource_type is not None:
        input_["by_resource_type"] = by_resource_type
    if by_scan_result_status is not None:
        input_["by_scan_result_status"] = by_scan_result_status
    if by_state is not None:
        input_["by_state"] = by_state
    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