createNode method
Create a Node in the specified Cluster. You can also create Nodes using the CreateNodeRegistrationScript. Note that you can't move a Node to another Cluster.
May throw BadGatewayException.
May throw BadRequestException.
May throw ForbiddenException.
May throw GatewayTimeoutException.
May throw InternalServerErrorException.
May throw TooManyRequestsException.
May throw UnprocessableEntityException.
Parameter clusterId :
The ID of the cluster.
Parameter name :
The user-specified name of the Node to be created.
Parameter nodeInterfaceMappings :
Documentation update needed
Parameter requestId :
An ID that you assign to a create request. This ID ensures idempotency
when creating resources.
Parameter role :
The initial role of the Node in the Cluster. ACTIVE means the Node is
available for encoding. BACKUP means the Node is a redundant Node and
might get used if an ACTIVE Node fails.
Parameter tags :
A collection of key-value pairs.
Implementation
Future<CreateNodeResponse> createNode({
required String clusterId,
String? name,
List<NodeInterfaceMappingCreateRequest>? nodeInterfaceMappings,
String? requestId,
NodeRole? role,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
if (name != null) 'name': name,
if (nodeInterfaceMappings != null)
'nodeInterfaceMappings': nodeInterfaceMappings,
'requestId': requestId ?? _s.generateIdempotencyToken(),
if (role != null) 'role': role.value,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/prod/clusters/${Uri.encodeComponent(clusterId)}/nodes',
exceptionFnMap: _exceptionFns,
);
return CreateNodeResponse.fromJson(response);
}