updateBrokerCount method
Updates the number of broker nodes in the cluster.
May throw ServiceUnavailableException. May throw BadRequestException. May throw UnauthorizedException. May throw InternalServerErrorException. May throw ForbiddenException.
Parameter clusterArn
:
The Amazon Resource Name (ARN) that uniquely identifies the cluster.
Parameter currentVersion
:
The version of cluster to update from. A successful operation will then generate a new version.
Parameter targetNumberOfBrokerNodes
:
The number of broker nodes that you want the cluster to have after this operation completes successfully.
Implementation
Future<UpdateBrokerCountResponse> updateBrokerCount({
required String clusterArn,
required String currentVersion,
required int targetNumberOfBrokerNodes,
}) async {
ArgumentError.checkNotNull(clusterArn, 'clusterArn');
ArgumentError.checkNotNull(currentVersion, 'currentVersion');
ArgumentError.checkNotNull(
targetNumberOfBrokerNodes, 'targetNumberOfBrokerNodes');
_s.validateNumRange(
'targetNumberOfBrokerNodes',
targetNumberOfBrokerNodes,
1,
15,
isRequired: true,
);
final $payload = <String, dynamic>{
'currentVersion': currentVersion,
'targetNumberOfBrokerNodes': targetNumberOfBrokerNodes,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/v1/clusters/${Uri.encodeComponent(clusterArn)}/nodes/count',
exceptionFnMap: _exceptionFns,
);
return UpdateBrokerCountResponse.fromJson(response);
}