Skip to content

list_backup_jobs

list_backup_jobs(
    *,
    config_overrides: Optional[BackupClientConfig] = None,
    next_token: Optional[string] = None,
    max_results: Optional[MaxResults] = None,
    by_resource_arn: Optional[ARN] = None,
    by_state: Optional[BackupJobState] = None,
    by_backup_vault_name: Optional[BackupVaultName] = None,
    by_created_before: Optional[timestamp] = None,
    by_created_after: Optional[timestamp] = None,
    by_resource_type: Optional[ResourceType] = None,
    by_account_id: Optional[AccountId] = None,
    by_complete_after: Optional[timestamp] = None,
    by_complete_before: Optional[timestamp] = None,
    by_parent_job_id: Optional[string] = None,
    by_message_category: Optional[string] = None,
) -> ListBackupJobsOutput

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.

Parameters:

  • next_token (Optional[string], 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.

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

    The maximum number of items to be returned.

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

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

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

    Returns only backup jobs that are in the specified state.

    Completed with issues is a status found only in the Backup console. For API, this status refers to jobs with a state of COMPLETED and a MessageCategory with a value other than SUCCESS; that is, the status is completed but comes with a status message.

    To obtain the job count for Completed with issues, run two GET requests, and subtract the second, smaller number:

    GET /backup-jobs/?state=COMPLETED

    GET /backup-jobs/?messageCategory=SUCCESS&state=COMPLETED

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

    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.

  • by_created_before (Optional[timestamp], default: None ) –

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

  • by_created_after (Optional[timestamp], default: None ) –

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

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

    Returns only backup jobs for the specified resources:

    • Aurora for Amazon Aurora

    • CloudFormation for CloudFormation

    • 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

    • EKS for Amazon Elastic Kubernetes Service

    • FSx for Amazon FSx

    • Neptune for Amazon Neptune

    • RDS for Amazon Relational Database Service

    • Redshift for Amazon Redshift

    • S3 for Amazon Simple Storage Service (Amazon S3)

    • SAP HANA on Amazon EC2 for SAP HANA databases on Amazon Elastic Compute Cloud instances

    • Storage Gateway for Storage Gateway

    • Timestream for Amazon Timestream

    • VirtualMachine for VMware virtual machines

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

    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.

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

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

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

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

  • by_parent_job_id (Optional[string], default: None ) –

    This is a filter to list child (nested) jobs based on parent job ID.

  • by_message_category (Optional[string], default: None ) –

    This is an optional parameter that can be used to filter out jobs with a MessageCategory which matches the value you input.

    Example strings may include AccessDenied, SUCCESS, AGGREGATE_ALL, and InvalidParameters.

    View Monitoring

    The wildcard () returns count of all message categories.

    AGGREGATE_ALL aggregates job counts for all message categories and returns the sum.

Raises:

Source code in docs_src/capo_backup/_services/backup.py
def list_backup_jobs(
    self,
    *,
    config_overrides: Optional[BackupClientConfig] = None,
    next_token: Optional["capo_backup.types.string.string"] = None,
    max_results: Optional["capo_backup.types.max_results.MaxResults"] = None,
    by_resource_arn: Optional["capo_backup.types.arn.ARN"] = None,
    by_state: Optional["capo_backup.types.backup_job_state.BackupJobState"] = None,
    by_backup_vault_name: Optional[
        "capo_backup.types.backup_vault_name.BackupVaultName"
    ] = None,
    by_created_before: Optional["capo_backup.types.timestamp.timestamp"] = None,
    by_created_after: Optional["capo_backup.types.timestamp.timestamp"] = None,
    by_resource_type: Optional[
        "capo_backup.types.resource_type.ResourceType"
    ] = None,
    by_account_id: Optional["capo_backup.types.account_id.AccountId"] = None,
    by_complete_after: Optional["capo_backup.types.timestamp.timestamp"] = None,
    by_complete_before: Optional["capo_backup.types.timestamp.timestamp"] = None,
    by_parent_job_id: Optional["capo_backup.types.string.string"] = None,
    by_message_category: Optional["capo_backup.types.string.string"] = None,
) -> "capo_backup.types.list_backup_jobs_output.ListBackupJobsOutput":
    """<p>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 <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/monitoring.html">monitoring tools</a>.</p>

    Args:
        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>
        max_results: <p>The maximum number of items to be returned.</p>
        by_resource_arn: <p>Returns only backup jobs that match the specified resource Amazon Resource Name (ARN).</p>
        by_state: <p>Returns only backup jobs that are in the specified state.</p> <p> <code>Completed with issues</code> is a status found only in the Backup console. For API, this status refers to jobs with a state of <code>COMPLETED</code> and a <code>MessageCategory</code> with a value other than <code>SUCCESS</code>; that is, the status is completed but comes with a status message.</p> <p>To obtain the job count for <code>Completed with issues</code>, run two GET requests, and subtract the second, smaller number:</p> <p>GET /backup-jobs/?state=COMPLETED</p> <p>GET /backup-jobs/?messageCategory=SUCCESS&state=COMPLETED</p>
        by_backup_vault_name: <p>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.</p>
        by_created_before: <p>Returns only backup jobs that were created before the specified date.</p>
        by_created_after: <p>Returns only backup jobs that were created after the specified date.</p>
        by_resource_type: <p>Returns only backup jobs for the specified resources:</p> <ul> <li> <p> <code>Aurora</code> for Amazon Aurora</p> </li> <li> <p> <code>CloudFormation</code> for CloudFormation</p> </li> <li> <p> <code>DocumentDB</code> for Amazon DocumentDB (with MongoDB compatibility)</p> </li> <li> <p> <code>DynamoDB</code> for Amazon DynamoDB</p> </li> <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>EFS</code> for Amazon Elastic File System</p> </li> <li> <p> <code>EKS</code> for Amazon Elastic Kubernetes Service</p> </li> <li> <p> <code>FSx</code> for Amazon FSx</p> </li> <li> <p> <code>Neptune</code> for Amazon Neptune</p> </li> <li> <p> <code>RDS</code> for Amazon Relational Database Service</p> </li> <li> <p> <code>Redshift</code> for Amazon Redshift</p> </li> <li> <p> <code>S3</code> for Amazon Simple Storage Service (Amazon S3)</p> </li> <li> <p> <code>SAP HANA on Amazon EC2</code> for SAP HANA databases on Amazon Elastic Compute Cloud instances</p> </li> <li> <p> <code>Storage Gateway</code> for Storage Gateway</p> </li> <li> <p> <code>Timestream</code> for Amazon Timestream</p> </li> <li> <p> <code>VirtualMachine</code> for VMware virtual machines</p> </li> </ul>
        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 Organizations management account, passing <code>*</code> returns all jobs across the organization.</p>
        by_complete_after: <p>Returns only backup 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_parent_job_id: <p>This is a filter to list child (nested) jobs based on parent job ID.</p>
        by_message_category: <p>This is an optional parameter that can be used to filter out jobs with a MessageCategory which matches the value you input.</p> <p>Example strings may include <code>AccessDenied</code>, <code>SUCCESS</code>, <code>AGGREGATE_ALL</code>, and <code>InvalidParameters</code>.</p> <p>View <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/monitoring.html">Monitoring</a> </p> <p>The wildcard () returns count of all message categories.</p> <p> <code>AGGREGATE_ALL</code> aggregates job counts for all message categories and returns the sum.</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.
    """

    def _handler(
        req: "OperationRequest[capo_backup.types.list_backup_jobs_input.ListBackupJobsInput]",
    ) -> OperationResponse[
        "capo_backup.types.list_backup_jobs_output.ListBackupJobsOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.list_backup_jobs

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListBackupJobs")
    )
    input_: capo_backup.types.list_backup_jobs_input.ListBackupJobsInput = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if by_resource_arn is not None:
        input_["by_resource_arn"] = by_resource_arn
    if by_state is not None:
        input_["by_state"] = by_state
    if by_backup_vault_name is not None:
        input_["by_backup_vault_name"] = by_backup_vault_name
    if by_created_before is not None:
        input_["by_created_before"] = by_created_before
    if by_created_after is not None:
        input_["by_created_after"] = by_created_after
    if by_resource_type is not None:
        input_["by_resource_type"] = by_resource_type
    if by_account_id is not None:
        input_["by_account_id"] = by_account_id
    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_parent_job_id is not None:
        input_["by_parent_job_id"] = by_parent_job_id
    if by_message_category is not None:
        input_["by_message_category"] = by_message_category

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