AWS Backup

2022/05/04 - AWS Backup - 3 updated api methods

Changes  Adds support to 2 new filters about job complete time for 3 list jobs APIs in AWS Backup

ListBackupJobs (updated) Link ¶
Changes (request)
{'ByCompleteAfter': 'timestamp', 'ByCompleteBefore': 'timestamp'}

Returns a list of existing backup jobs for an authenticated account for the last 30 days. For a longer period of time, consider using these monitoring tools .

See also: AWS API Documentation

Request Syntax

client.list_backup_jobs(
    NextToken='string',
    MaxResults=123,
    ByResourceArn='string',
    ByState='CREATED'|'PENDING'|'RUNNING'|'ABORTING'|'ABORTED'|'COMPLETED'|'FAILED'|'EXPIRED',
    ByBackupVaultName='string',
    ByCreatedBefore=datetime(2015, 1, 1),
    ByCreatedAfter=datetime(2015, 1, 1),
    ByResourceType='string',
    ByAccountId='string',
    ByCompleteAfter=datetime(2015, 1, 1),
    ByCompleteBefore=datetime(2015, 1, 1)
)
type NextToken

string

param NextToken

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.

type MaxResults

integer

param MaxResults

The maximum number of items to be returned.

type ByResourceArn

string

param ByResourceArn

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

type ByState

string

param ByState

Returns only backup jobs that are in the specified state.

type ByBackupVaultName

string

param ByBackupVaultName

Returns only backup 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. They consist of lowercase letters, numbers, and hyphens.

type ByCreatedBefore

datetime

param ByCreatedBefore

Returns only backup jobs that were created before the specified date.

type ByCreatedAfter

datetime

param ByCreatedAfter

Returns only backup jobs that were created after the specified date.

type ByResourceType

string

param ByResourceType

Returns only backup jobs for the specified resources:

  • Aurora for Amazon Aurora

  • DocumentDB for Amazon DocumentDB (with MongoDB compatibility)

  • DynamoDB for Amazon DynamoDB

  • EBS for Amazon Elastic Block Store

  • EC2 for Amazon Elastic Compute Cloud

  • EFS for Amazon Elastic File System

  • FSx for Amazon FSx

  • Neptune for Amazon Neptune

  • RDS for Amazon Relational Database Service

  • Storage Gateway for Storage Gateway

  • S3 for Amazon S3

  • VirtualMachine for virtual machines

type ByAccountId

string

param ByAccountId

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

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

type ByCompleteAfter

datetime

param ByCompleteAfter

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

type ByCompleteBefore

datetime

param ByCompleteBefore

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

rtype

dict

returns

Response Syntax

{
    'BackupJobs': [
        {
            'AccountId': 'string',
            'BackupJobId': 'string',
            'BackupVaultName': 'string',
            'BackupVaultArn': 'string',
            'RecoveryPointArn': 'string',
            'ResourceArn': 'string',
            'CreationDate': datetime(2015, 1, 1),
            'CompletionDate': datetime(2015, 1, 1),
            'State': 'CREATED'|'PENDING'|'RUNNING'|'ABORTING'|'ABORTED'|'COMPLETED'|'FAILED'|'EXPIRED',
            'StatusMessage': 'string',
            'PercentDone': 'string',
            'BackupSizeInBytes': 123,
            'IamRoleArn': 'string',
            'CreatedBy': {
                'BackupPlanId': 'string',
                'BackupPlanArn': 'string',
                'BackupPlanVersion': 'string',
                'BackupRuleId': 'string'
            },
            'ExpectedCompletionDate': datetime(2015, 1, 1),
            'StartBy': datetime(2015, 1, 1),
            'ResourceType': 'string',
            'BytesTransferred': 123,
            'BackupOptions': {
                'string': 'string'
            },
            'BackupType': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • BackupJobs (list) --

      An array of structures containing metadata about your backup jobs returned in JSON format.

      • (dict) --

        Contains detailed information about a backup job.

        • AccountId (string) --

          The account ID that owns the backup job.

        • BackupJobId (string) --

          Uniquely identifies a request to Backup to back up a resource.

        • 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. They consist of lowercase letters, numbers, and hyphens.

        • BackupVaultArn (string) --

          An Amazon Resource Name (ARN) that uniquely identifies a backup vault; for example, arn:aws:backup:us-east-1:123456789012:vault:aBackupVault .

        • RecoveryPointArn (string) --

          An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45 .

        • ResourceArn (string) --

          An ARN that uniquely identifies a resource. The format of the ARN depends on the resource type.

        • CreationDate (datetime) --

          The date and time a backup job is created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

        • CompletionDate (datetime) --

          The date and time a job to create a backup job is completed, in Unix format and Coordinated Universal Time (UTC). The value of CompletionDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

        • State (string) --

          The current state of a resource recovery point.

        • StatusMessage (string) --

          A detailed message explaining the status of the job to back up a resource.

        • PercentDone (string) --

          Contains an estimated percentage complete of a job at the time the job status was queried.

        • BackupSizeInBytes (integer) --

          The size, in bytes, of a backup.

        • IamRoleArn (string) --

          Specifies the IAM role ARN used to create the target recovery point. IAM roles other than the default role must include either AWSBackup or AwsBackup in the role name. For example, arn:aws:iam::123456789012:role/AWSBackupRDSAccess . Role names without those strings lack permissions to perform backup jobs.

        • CreatedBy (dict) --

          Contains identifying information about the creation of a backup job, including the BackupPlanArn , BackupPlanId , BackupPlanVersion , and BackupRuleId of the backup plan used to create it.

          • BackupPlanId (string) --

            Uniquely identifies a backup plan.

          • 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 .

          • BackupPlanVersion (string) --

            Version IDs are unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. They cannot be edited.

          • BackupRuleId (string) --

            Uniquely identifies a rule used to schedule the backup of a selection of resources.

        • ExpectedCompletionDate (datetime) --

          The date and time a job to back up resources is expected to be completed, in Unix format and Coordinated Universal Time (UTC). The value of ExpectedCompletionDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

        • StartBy (datetime) --

          Specifies the time in Unix format and Coordinated Universal Time (UTC) when a backup job must be started before it is canceled. The value is calculated by adding the start window to the scheduled time. So if the scheduled time were 6:00 PM and the start window is 2 hours, the StartBy time would be 8:00 PM on the date specified. The value of StartBy is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

        • ResourceType (string) --

          The type of Amazon Web Services resource to be backed up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database. For Windows Volume Shadow Copy Service (VSS) backups, the only supported resource type is Amazon EC2.

        • BytesTransferred (integer) --

          The size in bytes transferred to a backup vault at the time that the job status was queried.

        • BackupOptions (dict) --

          Specifies the backup option for a selected resource. This option is only available for Windows Volume Shadow Copy Service (VSS) backup jobs.

          Valid values: Set to "WindowsVSS":"enabled" to enable the WindowsVSS backup option and create a Windows VSS backup. Set to "WindowsVSS":"disabled" to create a regular backup. If you specify an invalid option, you get an InvalidParameterValueException exception.

          • (string) --

            • (string) --

        • BackupType (string) --

          Represents the type of backup for a backup job.

    • NextToken (string) --

      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.

ListCopyJobs (updated) Link ¶
Changes (request)
{'ByCompleteAfter': 'timestamp', 'ByCompleteBefore': 'timestamp'}

Returns metadata about your copy jobs.

See also: AWS API Documentation

Request Syntax

client.list_copy_jobs(
    NextToken='string',
    MaxResults=123,
    ByResourceArn='string',
    ByState='CREATED'|'RUNNING'|'COMPLETED'|'FAILED',
    ByCreatedBefore=datetime(2015, 1, 1),
    ByCreatedAfter=datetime(2015, 1, 1),
    ByResourceType='string',
    ByDestinationVaultArn='string',
    ByAccountId='string',
    ByCompleteBefore=datetime(2015, 1, 1),
    ByCompleteAfter=datetime(2015, 1, 1)
)
type NextToken

string

param NextToken

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.

type MaxResults

integer

param MaxResults

The maximum number of items to be returned.

type ByResourceArn

string

param ByResourceArn

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

type ByState

string

param ByState

Returns only copy jobs that are in the specified state.

type ByCreatedBefore

datetime

param ByCreatedBefore

Returns only copy jobs that were created before the specified date.

type ByCreatedAfter

datetime

param ByCreatedAfter

Returns only copy jobs that were created after the specified date.

type ByResourceType

string

param ByResourceType

Returns only backup jobs for the specified resources:

  • Aurora for Amazon Aurora

  • DocumentDB for Amazon DocumentDB (with MongoDB compatibility)

  • DynamoDB for Amazon DynamoDB

  • EBS for Amazon Elastic Block Store

  • EC2 for Amazon Elastic Compute Cloud

  • EFS for Amazon Elastic File System

  • FSx for Amazon FSx

  • Neptune for Amazon Neptune

  • RDS for Amazon Relational Database Service

  • Storage Gateway for Storage Gateway

  • S3 for Amazon S3

  • VirtualMachine for virtual machines

type ByDestinationVaultArn

string

param ByDestinationVaultArn

An Amazon Resource Name (ARN) that uniquely identifies a source backup vault to copy from; for example, arn:aws:backup:us-east-1:123456789012:vault:aBackupVault .

type ByAccountId

string

param ByAccountId

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

type ByCompleteBefore

datetime

param ByCompleteBefore

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

type ByCompleteAfter

datetime

param ByCompleteAfter

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

rtype

dict

returns

Response Syntax

{
    'CopyJobs': [
        {
            'AccountId': 'string',
            'CopyJobId': 'string',
            'SourceBackupVaultArn': 'string',
            'SourceRecoveryPointArn': 'string',
            'DestinationBackupVaultArn': 'string',
            'DestinationRecoveryPointArn': 'string',
            'ResourceArn': 'string',
            'CreationDate': datetime(2015, 1, 1),
            'CompletionDate': datetime(2015, 1, 1),
            'State': 'CREATED'|'RUNNING'|'COMPLETED'|'FAILED',
            'StatusMessage': 'string',
            'BackupSizeInBytes': 123,
            'IamRoleArn': 'string',
            'CreatedBy': {
                'BackupPlanId': 'string',
                'BackupPlanArn': 'string',
                'BackupPlanVersion': 'string',
                'BackupRuleId': 'string'
            },
            'ResourceType': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • CopyJobs (list) --

      An array of structures containing metadata about your copy jobs returned in JSON format.

      • (dict) --

        Contains detailed information about a copy job.

        • AccountId (string) --

          The account ID that owns the copy job.

        • CopyJobId (string) --

          Uniquely identifies a copy job.

        • SourceBackupVaultArn (string) --

          An Amazon Resource Name (ARN) that uniquely identifies a source copy vault; for example, arn:aws:backup:us-east-1:123456789012:vault:aBackupVault .

        • SourceRecoveryPointArn (string) --

          An ARN that uniquely identifies a source recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45 .

        • DestinationBackupVaultArn (string) --

          An Amazon Resource Name (ARN) that uniquely identifies a destination copy vault; for example, arn:aws:backup:us-east-1:123456789012:vault:aBackupVault .

        • DestinationRecoveryPointArn (string) --

          An ARN that uniquely identifies a destination recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45 .

        • ResourceArn (string) --

          The Amazon Web Services resource to be copied; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.

        • CreationDate (datetime) --

          The date and time a copy job is created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

        • CompletionDate (datetime) --

          The date and time a copy job is completed, in Unix format and Coordinated Universal Time (UTC). The value of CompletionDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

        • State (string) --

          The current state of a copy job.

        • StatusMessage (string) --

          A detailed message explaining the status of the job to copy a resource.

        • BackupSizeInBytes (integer) --

          The size, in bytes, of a copy job.

        • IamRoleArn (string) --

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

        • CreatedBy (dict) --

          Contains information about the backup plan and rule that Backup used to initiate the recovery point backup.

          • BackupPlanId (string) --

            Uniquely identifies a backup plan.

          • 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 .

          • BackupPlanVersion (string) --

            Version IDs are unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. They cannot be edited.

          • BackupRuleId (string) --

            Uniquely identifies a rule used to schedule the backup of a selection of resources.

        • ResourceType (string) --

          The type of Amazon Web Services resource to be copied; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.

    • NextToken (string) --

      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.

ListRestoreJobs (updated) Link ¶
Changes (request)
{'ByCompleteAfter': 'timestamp', 'ByCompleteBefore': 'timestamp'}

Returns a list of jobs that Backup initiated to restore a saved resource, including details about the recovery process.

See also: AWS API Documentation

Request Syntax

client.list_restore_jobs(
    NextToken='string',
    MaxResults=123,
    ByAccountId='string',
    ByCreatedBefore=datetime(2015, 1, 1),
    ByCreatedAfter=datetime(2015, 1, 1),
    ByStatus='PENDING'|'RUNNING'|'COMPLETED'|'ABORTED'|'FAILED',
    ByCompleteBefore=datetime(2015, 1, 1),
    ByCompleteAfter=datetime(2015, 1, 1)
)
type NextToken

string

param NextToken

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.

type MaxResults

integer

param MaxResults

The maximum number of items to be returned.

type ByAccountId

string

param ByAccountId

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

type ByCreatedBefore

datetime

param ByCreatedBefore

Returns only restore jobs that were created before the specified date.

type ByCreatedAfter

datetime

param ByCreatedAfter

Returns only restore jobs that were created after the specified date.

type ByStatus

string

param ByStatus

Returns only restore jobs associated with the specified job status.

type ByCompleteBefore

datetime

param ByCompleteBefore

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

type ByCompleteAfter

datetime

param ByCompleteAfter

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

rtype

dict

returns

Response Syntax

{
    'RestoreJobs': [
        {
            'AccountId': 'string',
            'RestoreJobId': 'string',
            'RecoveryPointArn': 'string',
            'CreationDate': datetime(2015, 1, 1),
            'CompletionDate': datetime(2015, 1, 1),
            'Status': 'PENDING'|'RUNNING'|'COMPLETED'|'ABORTED'|'FAILED',
            'StatusMessage': 'string',
            'PercentDone': 'string',
            'BackupSizeInBytes': 123,
            'IamRoleArn': 'string',
            'ExpectedCompletionTimeMinutes': 123,
            'CreatedResourceArn': 'string',
            'ResourceType': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • RestoreJobs (list) --

      An array of objects that contain detailed information about jobs to restore saved resources.

      • (dict) --

        Contains metadata about a restore job.

        • AccountId (string) --

          The account ID that owns the restore job.

        • RestoreJobId (string) --

          Uniquely identifies the job that restores a recovery point.

        • RecoveryPointArn (string) --

          An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45 .

        • CreationDate (datetime) --

          The date and time a restore job is created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

        • CompletionDate (datetime) --

          The date and time a job to restore a recovery point is completed, in Unix format and Coordinated Universal Time (UTC). The value of CompletionDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

        • Status (string) --

          A status code specifying the state of the job initiated by Backup to restore a recovery point.

        • StatusMessage (string) --

          A detailed message explaining the status of the job to restore a recovery point.

        • PercentDone (string) --

          Contains an estimated percentage complete of a job at the time the job status was queried.

        • BackupSizeInBytes (integer) --

          The size, in bytes, of the restored resource.

        • IamRoleArn (string) --

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

        • ExpectedCompletionTimeMinutes (integer) --

          The amount of time in minutes that a job restoring a recovery point is expected to take.

        • CreatedResourceArn (string) --

          An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.

        • ResourceType (string) --

          The resource type of the listed restore jobs; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database. For Windows Volume Shadow Copy Service (VSS) backups, the only supported resource type is Amazon EC2.

    • NextToken (string) --

      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.