getIndex method
Retrieves information about an index in an OpenSearch Serverless collection, including its schema definition. The index might be configured to conduct automatic semantic enrichment ingestion and search. For more information, see About automatic semantic enrichment.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter id :
The unique identifier of the collection containing the index.
Parameter indexName :
The name of the index to retrieve information about.
Implementation
Future<GetIndexResponse> getIndex({
required String id,
required String indexName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'OpenSearchServerless.GetIndex'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'id': id,
'indexName': indexName,
},
);
return GetIndexResponse.fromJson(jsonResponse.body);
}