deleteIndex method

Future<void> deleteIndex({
  1. required String id,
  2. required String indexName,
})

Deletes an index from an OpenSearch Serverless collection. Be aware that 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 to delete.

Parameter indexName : The name of the index to delete.

Implementation

Future<void> deleteIndex({
  required String id,
  required String indexName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'OpenSearchServerless.DeleteIndex'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'id': id,
      'indexName': indexName,
    },
  );
}