createApplicationInstance method
Creates an application instance and deploys it to a device.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ValidationException.
Parameter defaultRuntimeContextDevice :
A device's ID.
Parameter manifestPayload :
The application's manifest document.
Parameter applicationInstanceIdToReplace :
The ID of an application instance to replace with the new instance.
Parameter description :
A description for the application instance.
Parameter manifestOverridesPayload :
Setting overrides for the application manifest.
Parameter name :
A name for the application instance.
Parameter runtimeRoleArn :
The ARN of a runtime role for the application instance.
Parameter tags :
Tags for the application instance.
Implementation
Future<CreateApplicationInstanceResponse> createApplicationInstance({
required String defaultRuntimeContextDevice,
required ManifestPayload manifestPayload,
String? applicationInstanceIdToReplace,
String? description,
ManifestOverridesPayload? manifestOverridesPayload,
String? name,
String? runtimeRoleArn,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'DefaultRuntimeContextDevice': defaultRuntimeContextDevice,
'ManifestPayload': manifestPayload,
if (applicationInstanceIdToReplace != null)
'ApplicationInstanceIdToReplace': applicationInstanceIdToReplace,
if (description != null) 'Description': description,
if (manifestOverridesPayload != null)
'ManifestOverridesPayload': manifestOverridesPayload,
if (name != null) 'Name': name,
if (runtimeRoleArn != null) 'RuntimeRoleArn': runtimeRoleArn,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/application-instances',
exceptionFnMap: _exceptionFns,
);
return CreateApplicationInstanceResponse.fromJson(response);
}