createCoreDefinitionVersion method
Creates a version of a core definition that has already been defined. Greengrass groups must each contain exactly one Greengrass core.
May throw BadRequestException.
Parameter coreDefinitionId
:
The ID of the core definition.
Parameter amznClientToken
:
A client token used to correlate requests and responses.
Parameter cores
:
A list of cores in the core definition version.
Implementation
Future<CreateCoreDefinitionVersionResponse> createCoreDefinitionVersion({
required String coreDefinitionId,
String? amznClientToken,
List<Core>? cores,
}) async {
ArgumentError.checkNotNull(coreDefinitionId, 'coreDefinitionId');
final headers = <String, String>{
if (amznClientToken != null)
'X-Amzn-Client-Token': amznClientToken.toString(),
};
final $payload = <String, dynamic>{
if (cores != null) 'Cores': cores,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/greengrass/definition/cores/${Uri.encodeComponent(coreDefinitionId)}/versions',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return CreateCoreDefinitionVersionResponse.fromJson(response);
}