updateJob method
- required String jobId,
- AbortConfig? abortConfig,
- String? description,
- JobExecutionsRolloutConfig? jobExecutionsRolloutConfig,
- String? namespaceId,
- PresignedUrlConfig? presignedUrlConfig,
- TimeoutConfig? timeoutConfig,
Updates supported fields of the specified job.
May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ServiceUnavailableException.
Parameter jobId
:
The ID of the job to be updated.
Parameter abortConfig
:
Allows you to create criteria to abort a job.
Parameter description
:
A short text description of the job.
Parameter jobExecutionsRolloutConfig
:
Allows you to create a staged rollout of the job.
Parameter namespaceId
:
The namespace used to indicate that a job is a customer-managed job.
When you specify a value for this parameter, AWS IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.
$aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/
Parameter presignedUrlConfig
:
Configuration information for pre-signed S3 URLs.
Parameter timeoutConfig
:
Specifies the amount of time each device has to finish its execution of
the job. The timer is started when the job execution status is set to
IN_PROGRESS
. If the job execution status is not set to
another terminal state before the time expires, it will be automatically
set to TIMED_OUT
.
Implementation
Future<void> updateJob({
required String jobId,
AbortConfig? abortConfig,
String? description,
JobExecutionsRolloutConfig? jobExecutionsRolloutConfig,
String? namespaceId,
PresignedUrlConfig? presignedUrlConfig,
TimeoutConfig? timeoutConfig,
}) async {
ArgumentError.checkNotNull(jobId, 'jobId');
_s.validateStringLength(
'jobId',
jobId,
1,
64,
isRequired: true,
);
_s.validateStringLength(
'description',
description,
0,
2028,
);
_s.validateStringLength(
'namespaceId',
namespaceId,
1,
64,
);
final $query = <String, List<String>>{
if (namespaceId != null) 'namespaceId': [namespaceId],
};
final $payload = <String, dynamic>{
if (abortConfig != null) 'abortConfig': abortConfig,
if (description != null) 'description': description,
if (jobExecutionsRolloutConfig != null)
'jobExecutionsRolloutConfig': jobExecutionsRolloutConfig,
if (presignedUrlConfig != null) 'presignedUrlConfig': presignedUrlConfig,
if (timeoutConfig != null) 'timeoutConfig': timeoutConfig,
};
await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri: '/jobs/${Uri.encodeComponent(jobId)}',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
}