describeReservedInstances method

Future<DescribeReservedInstancesResponse> describeReservedInstances({
  1. int? maxResults,
  2. String? nextToken,
  3. String? reservedInstanceId,
})

Returns information about reserved OpenSearch instances for this account.

May throw ResourceNotFoundException. May throw InternalException. May throw ValidationException. May throw DisabledOperationException.

Parameter maxResults : Set this value to limit the number of results returned. If not specified, defaults to 100.

Parameter nextToken : Provides an identifier to allow retrieval of paginated results.

Parameter reservedInstanceId : The reserved instance identifier filter value. Use this parameter to show only the reservation that matches the specified reserved OpenSearch instance ID.

Implementation

Future<DescribeReservedInstancesResponse> describeReservedInstances({
  int? maxResults,
  String? nextToken,
  String? reservedInstanceId,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    100,
  );
  _s.validateStringLength(
    'reservedInstanceId',
    reservedInstanceId,
    36,
    36,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (reservedInstanceId != null) 'reservationId': [reservedInstanceId],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/2021-01-01/opensearch/reservedInstances',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return DescribeReservedInstancesResponse.fromJson(response);
}