Backup / Client / list_scan_jobs
list_scan_jobs¶
- Backup.Client.list_scan_jobs(**kwargs)¶
Returns a list of existing scan jobs for an authenticated account for the last 30 days.
See also: AWS API Documentation
Request Syntax
response = client.list_scan_jobs( ByAccountId='string', ByBackupVaultName='string', ByCompleteAfter=datetime(2015, 1, 1), ByCompleteBefore=datetime(2015, 1, 1), ByMalwareScanner='GUARDDUTY', ByRecoveryPointArn='string', ByResourceArn='string', ByResourceType='EBS'|'EC2'|'S3', ByScanResultStatus='NO_THREATS_FOUND'|'THREATS_FOUND', ByState='CANCELED'|'COMPLETED'|'COMPLETED_WITH_ISSUES'|'CREATED'|'FAILED'|'RUNNING', MaxResults=123, NextToken='string' )
- Parameters:
ByAccountId (string) –
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}$ByBackupVaultName (string) –
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}$ByCompleteAfter (datetime) – Returns only scan jobs completed after a date expressed in Unix format and Coordinated Universal Time (UTC).
ByCompleteBefore (datetime) – Returns only backup jobs completed before a date expressed in Unix format and Coordinated Universal Time (UTC).
ByMalwareScanner (string) – Returns only the scan jobs for the specified malware scanner. Currently only supports
GUARDDUTY.ByRecoveryPointArn (string) – Returns only the scan jobs that are ran against the specified recovery point.
ByResourceArn (string) – Returns only scan jobs that match the specified resource Amazon Resource Name (ARN).
ByResourceType (string) –
Returns restore testing selections by the specified restore testing plan name.
``EBS``for Amazon Elastic Block Store
``EC2``for Amazon Elastic Compute Cloud
``S3``for Amazon Simple Storage Service (Amazon S3)
Pattern:
^[a-zA-Z0-9\-\_\.]{1,50}$ByScanResultStatus (string) –
Returns only the scan jobs for the specified scan results:
THREATS_FOUNDNO_THREATS_FOUND
ByState (string) – Returns only the scan jobs for the specified scanning job state.
MaxResults (integer) –
The maximum number of items to be returned.
Valid Range: Minimum value of 1. Maximum value of 1000.
NextToken (string) – The next item following a partial list of returned items. For example, if a request is made to return
MaxResultsnumber of items,NextTokenallows you to return more items in your list starting at the location pointed to by the next token.
- Return type:
dict
- Returns:
Response Syntax
{ 'NextToken': 'string', 'ScanJobs': [ { 'AccountId': 'string', 'BackupVaultArn': 'string', 'BackupVaultName': 'string', 'CompletionDate': datetime(2015, 1, 1), 'CreatedBy': { 'BackupPlanArn': 'string', 'BackupPlanId': 'string', 'BackupPlanVersion': 'string', 'BackupRuleId': 'string' }, 'CreationDate': datetime(2015, 1, 1), 'IamRoleArn': 'string', 'MalwareScanner': 'GUARDDUTY', 'RecoveryPointArn': 'string', 'ResourceArn': 'string', 'ResourceName': 'string', 'ResourceType': 'EBS'|'EC2'|'S3', 'ScanBaseRecoveryPointArn': 'string', 'ScanId': 'string', 'ScanJobId': 'string', 'ScanMode': 'FULL_SCAN'|'INCREMENTAL_SCAN', 'ScanResult': { 'ScanResultStatus': 'NO_THREATS_FOUND'|'THREATS_FOUND' }, 'ScannerRoleArn': 'string', 'State': 'CANCELED'|'COMPLETED'|'COMPLETED_WITH_ISSUES'|'CREATED'|'FAILED'|'RUNNING', 'StatusMessage': 'string' }, ] }
Response Structure
(dict) –
NextToken (string) –
The next item following a partial list of returned items. For example, if a request is made to return
MaxResultsnumber of items,NextTokenallows you to return more items in your list starting at the location pointed to by the next token.ScanJobs (list) –
An array of structures containing metadata about your scan jobs returned in JSON format.
(dict) –
Contains metadata about a scan job, including information about the scanning process, results, and associated resources.
AccountId (string) –
The account ID that owns the scan job.
BackupVaultArn (string) –
An Amazon Resource Name (ARN) that uniquely identifies a backup vault; for example,
arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.BackupVaultName (string) –
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.
CompletionDate (datetime) –
The date and time that a scan job is completed, in Unix format and Coordinated Universal Time (UTC). The value of
CompletionDateis accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.CreatedBy (dict) –
Contains identifying information about the creation of a scan job.
BackupPlanArn (string) –
An Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example,
arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50.BackupPlanId (string) –
The ID of the backup plan.
BackupPlanVersion (string) –
Unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version IDs cannot be edited.
BackupRuleId (string) –
Uniquely identifies the backup rule that initiated the scan job.
CreationDate (datetime) –
The date and time that a scan job is created, in Unix format and Coordinated Universal Time (UTC). The value of
CreationDateis accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.IamRoleArn (string) –
Specifies the IAM role ARN used to create the scan job; for example,
arn:aws:iam::123456789012:role/S3Access.MalwareScanner (string) –
The scanning engine used for the scan job. Currently only
GUARDDUTYis supported.RecoveryPointArn (string) –
An ARN that uniquely identifies the recovery point being scanned; for example,
arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.ResourceArn (string) –
An ARN that uniquely identifies the source resource of the recovery point being scanned.
ResourceName (string) –
The non-unique name of the resource that belongs to the specified backup.
ResourceType (string) –
The type of Amazon Web Services resource being scanned; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.
ScanBaseRecoveryPointArn (string) –
An ARN that uniquely identifies the base recovery point for scanning. This field is populated when an incremental scan job has taken place.
ScanId (string) –
The scan ID generated by the malware scanner for the corresponding scan job.
ScanJobId (string) –
The unique identifier that identifies the scan job request to Backup.
ScanMode (string) –
Specifies the scan type use for the scan job.
Includes:
FULL_SCANwill scan the entire data lineage within the backup.INCREMENTAL_SCANwill scan the data difference between the target recovery point and base recovery point ARN.ScanResult (dict) –
Contains the scan results information, including the status of threats found during scanning.
ScanResultStatus (string) –
The status of the scan results.
Valid values:
THREATS_FOUND|NO_THREATS_FOUND.
ScannerRoleArn (string) –
Specifies the scanner IAM role ARN used for the scan job.
State (string) –
The current state of the scan job.
Valid values:
CREATED|RUNNING|COMPLETED|COMPLETED_WITH_ISSUES|FAILED|CANCELED.StatusMessage (string) –
A detailed message explaining the status of the scan job.
Exceptions
Backup.Client.exceptions.InvalidParameterValueExceptionBackup.Client.exceptions.ServiceUnavailableException