describeInstanceTypeLimits method

Future<DescribeInstanceTypeLimitsResponse> describeInstanceTypeLimits({
  1. required String engineVersion,
  2. required OpenSearchPartitionInstanceType instanceType,
  3. String? domainName,
})

Describe the limits for a given instance type and OpenSearch or Elasticsearch version. When modifying an existing domain, specify the DomainName to see which limits you can modify.

May throw BaseException. May throw InternalException. May throw InvalidTypeException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter engineVersion : Version of OpenSearch for which Limits are needed.

Parameter instanceType : The instance type for an OpenSearch cluster for which OpenSearch Limits are needed.

Parameter domainName : The name of the domain you want to modify. Only include this value if you're querying OpenSearch Limits for an existing domain.

Implementation

Future<DescribeInstanceTypeLimitsResponse> describeInstanceTypeLimits({
  required String engineVersion,
  required OpenSearchPartitionInstanceType instanceType,
  String? domainName,
}) async {
  ArgumentError.checkNotNull(engineVersion, 'engineVersion');
  _s.validateStringLength(
    'engineVersion',
    engineVersion,
    14,
    18,
    isRequired: true,
  );
  ArgumentError.checkNotNull(instanceType, 'instanceType');
  _s.validateStringLength(
    'domainName',
    domainName,
    3,
    28,
  );
  final $query = <String, List<String>>{
    if (domainName != null) 'domainName': [domainName],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/2021-01-01/opensearch/instanceTypeLimits/${Uri.encodeComponent(engineVersion)}/${Uri.encodeComponent(instanceType.toValue())}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return DescribeInstanceTypeLimitsResponse.fromJson(response);
}