opensearch_indexes
Creates, updates, deletes, gets or lists an opensearch_indexes resource.
Overview
| Name | opensearch_indexes |
| Type | Resource |
| Id | digitalocean.databases.opensearch_indexes |
Fields
The following fields are returned by SELECT queries:
- databases_list_opensearch_indexes
A JSON object with a key of indexes.
| Name | Datatype | Description |
|---|---|---|
index_name | string | The name of the opensearch index. (example: events) |
created_time | string (date-time) | The date and time the index was created. (example: 2021-01-01T00:00:00Z) |
health | string | The health of the OpenSearch index. (example: green) |
number_of_replicas | integer | The number of replicas for the index. |
number_of_shards | integer | The number of shards for the index. |
size | integer | The size of the index. |
status | string | The status of the OpenSearch index. (example: open) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
databases_list_opensearch_indexes | select | database_cluster_uuid | To list all of a OpenSearch cluster's indexes, send a GET request to/v2/databases/$DATABASE_ID/indexes.The result will be a JSON object with a indexes key. | |
databases_delete_opensearch_index | delete | database_cluster_uuid, index_name | To delete a single index within OpenSearch cluster, send a DELETE request to /v2/databases/$DATABASE_ID/indexes/$INDEX_NAME.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
database_cluster_uuid | string (uuid) | A unique identifier for a database cluster. (example: 9cc10173-e9ea-4176-9dbc-a4cee4c4ff30) |
index_name | string | The name of the OpenSearch index. (example: logs-*) |
SELECT examples
- databases_list_opensearch_indexes
To list all of a OpenSearch cluster's indexes, send a GET request to/v2/databases/$DATABASE_ID/indexes.
The result will be a JSON object with a indexes key.
SELECT
index_name,
created_time,
health,
number_of_replicas,
number_of_shards,
size,
status
FROM digitalocean.databases.opensearch_indexes
WHERE database_cluster_uuid = '{{ database_cluster_uuid }}' -- required
;
DELETE examples
- databases_delete_opensearch_index
To delete a single index within OpenSearch cluster, send a DELETE request
to /v2/databases/$DATABASE_ID/indexes/$INDEX_NAME.
A status of 204 will be given. This indicates that the request was
processed successfully, but that no response body is needed.
DELETE FROM digitalocean.databases.opensearch_indexes
WHERE database_cluster_uuid = '{{ database_cluster_uuid }}' --required
AND index_name = '{{ index_name }}' --required
;