createJob method
This operation creates an S3 Batch Operations job.
You can use S3 Batch Operations to perform large-scale batch actions on Amazon S3 objects. Batch Operations can run a single action on lists of Amazon S3 objects that you specify. For more information, see S3 Batch Operations in the Amazon S3 User Guide.
- Permissions
- For information about permissions required to use the Batch Operations, see Granting permissions for S3 Batch Operations in the Amazon S3 User Guide.
Related actions include:
May throw BadRequestException.
May throw IdempotencyException.
May throw InternalServiceException.
May throw TooManyRequestsException.
Parameter accountId :
The Amazon Web Services account ID that creates the job.
Parameter operation :
The action that you want this job to perform on every object listed in the
manifest. For more information about the available actions, see Operations
in the Amazon S3 User Guide.
Parameter priority :
The numerical priority for this job. Higher numbers indicate higher
priority.
Parameter report :
Configuration parameters for the optional job-completion report.
Parameter roleArn :
The Amazon Resource Name (ARN) for the Identity and Access Management
(IAM) role that Batch Operations will use to run this job's action on
every object in the manifest.
Parameter clientRequestToken :
An idempotency token to ensure that you don't accidentally submit the same
request twice. You can use any string up to the maximum length.
Parameter confirmationRequired :
Indicates whether confirmation is required before Amazon S3 runs the job.
Confirmation is only required for jobs created through the Amazon S3
console.
Parameter description :
A description for this job. You can use any string within the permitted
length. Descriptions don't need to be unique and can be used for multiple
jobs.
Parameter manifest :
Configuration parameters for the manifest.
Parameter manifestGenerator :
The attribute container for the ManifestGenerator details. Jobs must be
created with either a manifest file or a ManifestGenerator, but not both.
Parameter tags :
A set of tags to associate with the S3 Batch Operations job. This is an
optional parameter.
Implementation
Future<CreateJobResult> createJob({
required String accountId,
required JobOperation operation,
required int priority,
required JobReport report,
required String roleArn,
String? clientRequestToken,
bool? confirmationRequired,
String? description,
JobManifest? manifest,
JobManifestGenerator? manifestGenerator,
List<S3Tag>? tags,
}) async {
_s.validateNumRange(
'priority',
priority,
0,
2147483647,
isRequired: true,
);
clientRequestToken ??= _s.generateIdempotencyToken();
final headers = <String, String>{
'x-amz-account-id': accountId.toString(),
};
final $result = await _protocol.send(
method: 'POST',
requestUri: '/v20180820/jobs',
headers: headers,
payload: CreateJobRequest(
accountId: accountId,
operation: operation,
priority: priority,
report: report,
roleArn: roleArn,
clientRequestToken: clientRequestToken,
confirmationRequired: confirmationRequired,
description: description,
manifest: manifest,
manifestGenerator: manifestGenerator,
tags: tags)
.toXml('CreateJobRequest'),
exceptionFnMap: _exceptionFns,
);
return CreateJobResult.fromXml($result.body);
}