provisionDevice method
Creates a device and returns a configuration archive. The configuration
archive is a ZIP file that contains a provisioning certificate that is
valid for 5 minutes. Name the configuration archive
certificates-omni_device-name.zip and transfer it to
the device within 5 minutes. Use the included USB storage device and
connect it to the USB 3.0 port next to the HDMI output.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ValidationException.
Parameter name :
A name for the device.
Parameter description :
A description for the device.
Parameter networkingConfiguration :
A networking configuration for the device.
Parameter tags :
Tags for the device.
Implementation
Future<ProvisionDeviceResponse> provisionDevice({
required String name,
String? description,
NetworkPayload? networkingConfiguration,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'Name': name,
if (description != null) 'Description': description,
if (networkingConfiguration != null)
'NetworkingConfiguration': networkingConfiguration,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/devices',
exceptionFnMap: _exceptionFns,
);
return ProvisionDeviceResponse.fromJson(response);
}