createJobForDevices method
Creates a job to run on a device. A job can update a device's software or reboot it.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter deviceIds :
ID of target device.
Parameter jobType :
The type of job to run.
Parameter deviceJobConfig :
Configuration settings for a software update job.
Implementation
Future<CreateJobForDevicesResponse> createJobForDevices({
required List<String> deviceIds,
required JobType jobType,
DeviceJobConfig? deviceJobConfig,
}) async {
final $payload = <String, dynamic>{
'DeviceIds': deviceIds,
'JobType': jobType.value,
if (deviceJobConfig != null) 'DeviceJobConfig': deviceJobConfig,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/jobs',
exceptionFnMap: _exceptionFns,
);
return CreateJobForDevicesResponse.fromJson(response);
}