Skip to content

start_scan_job

start_scan_job(
    backup_vault_name: str,
    iam_role_arn: str,
    malware_scanner: MalwareScanner,
    recovery_point_arn: str,
    scan_mode: ScanMode,
    scanner_role_arn: str,
    *,
    config_overrides: Optional[BackupClientConfig] = None,
    continuous_scan_end_time: Optional[datetime] = None,
    idempotency_token: Optional[str] = None,
    scan_base_recovery_point_arn: Optional[str] = None,
) -> StartScanJobOutput

Starts scanning jobs for specific resources.

Parameters:

  • backup_vault_name (str) –

    The name of a logical container where backups are stored. 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}$

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

    The point in time the scan job will scan up to for a continuous backup.

  • iam_role_arn (str) –

    Specifies the IAM role ARN used to create the target recovery point; for example, arn:aws:iam::123456789012:role/S3Access.

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

    A customer-chosen string that you can use to distinguish between otherwise identical calls to StartScanJob. Retrying a successful request with the same idempotency token results in a success message with no action taken.

  • malware_scanner (MalwareScanner) –

    Specifies the malware scanner used during the scan job. Currently only supports GUARDDUTY.

  • recovery_point_arn (str) –

    An Amazon Resource Name (ARN) that uniquely identifies a recovery point. This is your target recovery point for a full scan. If you are running an incremental scan, this will be your a recovery point which has been created after your base recovery point selection.

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

    An ARN that uniquely identifies the base recovery point to be used for incremental scanning.

  • scan_mode (ScanMode) –

    Specifies the scan type use for the scan job.

    Includes:

    • FULL_SCAN will scan the entire data lineage within the backup.

    • INCREMENTAL_SCAN will scan the data difference between the target recovery point and base recovery point ARN.

  • scanner_role_arn (str) –

    Specified the IAM scanner role ARN.

Raises:

Source code in docs_src/capo_backup/_services/backup.py
def start_scan_job(
    self,
    backup_vault_name: str,
    iam_role_arn: str,
    malware_scanner: "capo_backup.types.malware_scanner.MalwareScanner",
    recovery_point_arn: str,
    scan_mode: "capo_backup.types.scan_mode.ScanMode",
    scanner_role_arn: str,
    *,
    config_overrides: Optional[BackupClientConfig] = None,
    continuous_scan_end_time: Optional[datetime.datetime] = None,
    idempotency_token: Optional[str] = None,
    scan_base_recovery_point_arn: Optional[str] = None,
) -> "capo_backup.types.start_scan_job_output.StartScanJobOutput":
    r"""<p>Starts scanning jobs for specific resources.</p>

    Args:
        backup_vault_name: <p>The name of a logical container where backups are stored. 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>
        continuous_scan_end_time: <p>The point in time the scan job will scan up to for a continuous backup.</p>
        iam_role_arn: <p>Specifies the IAM role ARN used to create the target recovery point; for example, <code>arn:aws:iam::123456789012:role/S3Access</code>.</p>
        idempotency_token: <p>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>StartScanJob</code>. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
        malware_scanner: <p>Specifies the malware scanner used during the scan job. Currently only supports <code>GUARDDUTY</code>.</p>
        recovery_point_arn: <p>An Amazon Resource Name (ARN) that uniquely identifies a recovery point. This is your target recovery point for a full scan. If you are running an incremental scan, this will be your a recovery point which has been created after your base recovery point selection.</p>
        scan_base_recovery_point_arn: <p>An ARN that uniquely identifies the base recovery point to be used for incremental scanning.</p>
        scan_mode: <p>Specifies the scan type use for the scan job.</p> <p>Includes:</p> <ul> <li> <p> <code>FULL_SCAN</code> will scan the entire data lineage within the backup.</p> </li> <li> <p> <code>INCREMENTAL_SCAN</code> will scan the data difference between the target recovery point and base recovery point ARN.</p> </li> </ul>
        scanner_role_arn: <p>Specified the IAM scanner role ARN.</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.invalid_request_exception.InvalidRequestException: <p>Indicates that something is wrong with the input to the request. For example, a parameter is of the wrong type.</p>
        capo_backup.errors.limit_exceeded_exception.LimitExceededException: <p>A limit in the request has been exceeded; for example, a maximum number of items allowed in a request.</p>
        capo_backup.errors.missing_parameter_value_exception.MissingParameterValueException: <p>Indicates that a required parameter is missing.</p>
        capo_backup.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource that is required for the action doesn't exist.</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.
    """

    def _handler(
        req: "OperationRequest[capo_backup.types.start_scan_job_input.StartScanJobInput]",
    ) -> OperationResponse[
        "capo_backup.types.start_scan_job_output.StartScanJobOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.start_scan_job

        output, http_response = (
            capo_backup._operations.cryo_controller_user_manager.start_scan_job.start_scan_job(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartScanJob")
    )
    input_: capo_backup.types.start_scan_job_input.StartScanJobInput = {
        "backup_vault_name": backup_vault_name,
        "iam_role_arn": iam_role_arn,
        "malware_scanner": malware_scanner,
        "recovery_point_arn": recovery_point_arn,
        "scan_mode": scan_mode,
        "scanner_role_arn": scanner_role_arn,
    }
    if continuous_scan_end_time is not None:
        input_["continuous_scan_end_time"] = continuous_scan_end_time
    if idempotency_token is not None:
        input_["idempotency_token"] = idempotency_token
    if scan_base_recovery_point_arn is not None:
        input_["scan_base_recovery_point_arn"] = scan_base_recovery_point_arn

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