purchaseReservedNodeOffering method
Allows you to purchase reserved nodes. Amazon Redshift offers a predefined set of reserved node offerings. You can purchase one or more of the offerings. You can call the DescribeReservedNodeOfferings API to obtain the available reserved node offerings. You can call this API by providing a specific reserved node offering and the number of nodes you want to reserve.
For more information about reserved node offerings, go to Purchasing Reserved Nodes in the Amazon Redshift Cluster Management Guide.
May throw ReservedNodeOfferingNotFoundFault. May throw ReservedNodeAlreadyExistsFault. May throw ReservedNodeQuotaExceededFault. May throw UnsupportedOperationFault.
Parameter reservedNodeOfferingId
:
The unique identifier of the reserved node offering you want to purchase.
Parameter nodeCount
:
The number of reserved nodes that you want to purchase.
Default: 1
Implementation
Future<PurchaseReservedNodeOfferingResult> purchaseReservedNodeOffering({
required String reservedNodeOfferingId,
int? nodeCount,
}) async {
ArgumentError.checkNotNull(
reservedNodeOfferingId, 'reservedNodeOfferingId');
_s.validateStringLength(
'reservedNodeOfferingId',
reservedNodeOfferingId,
0,
2147483647,
isRequired: true,
);
final $request = <String, dynamic>{};
$request['ReservedNodeOfferingId'] = reservedNodeOfferingId;
nodeCount?.also((arg) => $request['NodeCount'] = arg);
final $result = await _protocol.send(
$request,
action: 'PurchaseReservedNodeOffering',
version: '2012-12-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['PurchaseReservedNodeOfferingMessage'],
shapes: shapes,
resultWrapper: 'PurchaseReservedNodeOfferingResult',
);
return PurchaseReservedNodeOfferingResult.fromXml($result);
}