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.
Parameters:
-
id
(CollectionId)
–
The unique identifier of the collection containing the index to delete.
-
index_name
(IndexName)
–
The name of the index to delete.
Raises:
Source code in docs_src/capo_opensearchserverless/_services/open_search_serverless.py
| def delete_index(
self,
id: "capo_opensearchserverless.types.collection_id.CollectionId",
index_name: "capo_opensearchserverless.types.index_name.IndexName",
*,
config_overrides: Optional[OpenSearchServerlessClientConfig] = None,
) -> "capo_opensearchserverless.types.delete_index_response.DeleteIndexResponse":
"""<p>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 <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html#serverless-semantic-enrichment">About automatic semantic enrichment</a>.</p>
Args:
id: <p>The unique identifier of the collection containing the index to delete.</p>
index_name: <p>The name of the index to delete.</p>
Raises:
capo_opensearchserverless.errors.internal_server_exception.InternalServerException: <p>Thrown when an error internal to the service occurs while processing a request.</p>
capo_opensearchserverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>Thrown when accessing or deleting a resource that does not exist.</p>
capo_opensearchserverless.errors.validation_exception.ValidationException: <p>Thrown when the HTTP request contains invalid input or is missing required input.</p>
capo_opensearchserverless.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_opensearchserverless.types.delete_index_request.DeleteIndexRequest]",
) -> OperationResponse[
"capo_opensearchserverless.types.delete_index_response.DeleteIndexResponse"
]:
import capo_opensearchserverless._operations.open_search_serverless.delete_index
output, http_response = (
capo_opensearchserverless._operations.open_search_serverless.delete_index.delete_index(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteIndex")
)
input_: capo_opensearchserverless.types.delete_index_request.DeleteIndexRequest = {
"id": id,
"index_name": index_name,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|