purchaseReservedInstanceOffering method
Allows you to purchase Amazon OpenSearch Service Reserved Instances.
May throw DisabledOperationException.
May throw InternalException.
May throw LimitExceededException.
May throw ResourceAlreadyExistsException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter reservationName :
A customer-specified identifier to track this reservation.
Parameter reservedInstanceOfferingId :
The ID of the Reserved Instance offering to purchase.
Parameter instanceCount :
The number of OpenSearch instances to reserve.
Implementation
Future<PurchaseReservedInstanceOfferingResponse>
purchaseReservedInstanceOffering({
required String reservationName,
required String reservedInstanceOfferingId,
int? instanceCount,
}) async {
_s.validateNumRange(
'instanceCount',
instanceCount,
1,
1152921504606846976,
);
final $payload = <String, dynamic>{
'ReservationName': reservationName,
'ReservedInstanceOfferingId': reservedInstanceOfferingId,
if (instanceCount != null) 'InstanceCount': instanceCount,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/2021-01-01/opensearch/purchaseReservedInstanceOffering',
exceptionFnMap: _exceptionFns,
);
return PurchaseReservedInstanceOfferingResponse.fromJson(response);
}