listBackupJobs method
Returns a list of existing backup jobs for an authenticated account.
May throw InvalidParameterValueException. May throw ServiceUnavailableException.
Parameter byAccountId
:
The account ID to list the jobs from. Returns only backup jobs associated
with the specified account ID.
Parameter 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 AWS Region where they are created.
They consist of lowercase letters, numbers, and hyphens.
Parameter byCreatedAfter
:
Returns only backup jobs that were created after the specified date.
Parameter byCreatedBefore
:
Returns only backup jobs that were created before the specified date.
Parameter byResourceArn
:
Returns only backup jobs that match the specified resource Amazon Resource
Name (ARN).
Parameter byResourceType
:
Returns only backup jobs for the specified resources:
-
DynamoDB
for Amazon DynamoDB -
EBS
for Amazon Elastic Block Store -
EC2
for Amazon Elastic Compute Cloud -
EFS
for Amazon Elastic File System -
RDS
for Amazon Relational Database Service -
Storage Gateway
for AWS Storage Gateway
Parameter byState
:
Returns only backup jobs that are in the specified state.
Parameter maxResults
:
The maximum number of items to be returned.
Parameter 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.
Implementation
Future<ListBackupJobsOutput> listBackupJobs({
String? byAccountId,
String? byBackupVaultName,
DateTime? byCreatedAfter,
DateTime? byCreatedBefore,
String? byResourceArn,
String? byResourceType,
BackupJobState? byState,
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
1000,
);
final $query = <String, List<String>>{
if (byAccountId != null) 'accountId': [byAccountId],
if (byBackupVaultName != null) 'backupVaultName': [byBackupVaultName],
if (byCreatedAfter != null)
'createdAfter': [_s.iso8601ToJson(byCreatedAfter).toString()],
if (byCreatedBefore != null)
'createdBefore': [_s.iso8601ToJson(byCreatedBefore).toString()],
if (byResourceArn != null) 'resourceArn': [byResourceArn],
if (byResourceType != null) 'resourceType': [byResourceType],
if (byState != null) 'state': [byState.toValue()],
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/backup-jobs/',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListBackupJobsOutput.fromJson(response);
}