Skip to main content

opensearch_indices

Creates, updates, deletes, gets or lists an opensearch_indices resource.

Overview​

Nameopensearch_indices
TypeResource
Idovh.cloud_database.opensearch_indices

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Index ID
namestringName of the index
created_atstring (date-time)Date of the creation of the index (wire: createdAt)
documentsintegerNumber of documents hold by the index
replicas_numberintegerNumber of replicas of the index (wire: replicasNumber)
shards_numberintegerNumber of shards of the index (wire: shardsNumber)
sizeintegerSize of the index

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcluster_id, index_id, service_nameGet opensearch index
listselectcluster_id, service_namex_pagination_modeList indexes of the opensearch
deletedeletecluster_id, index_id, service_nameDelete an opensearch index

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.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
cluster_idstring (uuid)Cluster ID (wire: clusterId)
index_idstring (uuid)Index ID (wire: indexId)
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get opensearch index

SELECT
id,
name,
created_at,
documents,
replicas_number,
shards_number,
size
FROM ovh.cloud_database.opensearch_indices
WHERE cluster_id = '{{ cluster_id }}' -- required
AND index_id = '{{ index_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

DELETE examples​

Delete an opensearch index

DELETE FROM ovh.cloud_database.opensearch_indices
WHERE cluster_id = '{{ cluster_id }}' --required
AND index_id = '{{ index_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;