Skip to main content

opensearch_patterns

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

Overview​

Nameopensearch_patterns
TypeResource
Idovh.public_cloud_analytics.opensearch_patterns

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Unique identifier of the index pattern
checksumstringHash of the resource used for concurrency control
created_atstring (date-time)Date at which the resource was created (wire: createdAt)
maximum_index_countintegerMaximum number of indexes matching this pattern. Oldest indexes are deleted when this limit is reached. (wire: maximumIndexCount)
patternstringGlob pattern matching index names
updated_atstring (date-time)Date of the last update to the resource (wire: updatedAt)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectpattern_id, service_id, project_idReturns the glob pattern and the maximum number of indexes it keeps. (Beta version)
listselectservice_id, project_idx_pagination_cursor, x_pagination_sizeReturns the index patterns of the service with their maximum number of indexes. (Beta version)
createinsertservice_id, project_id, maximum_index_count, patternCreates a glob pattern matching index names, with a maximum number of matching indexes. When the limit is reached, the oldest indexes are deleted. (Beta version)
deletedeletepattern_id, service_id, project_idDeletes the index pattern and the indexes matching it. (Beta version)

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"}})
pattern_idstring (uuid)Pattern ID (wire: patternId)
project_idstringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
service_idstring (uuid)Service ID (wire: serviceId)
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Returns the glob pattern and the maximum number of indexes it keeps. (Beta version)

SELECT
id,
checksum,
created_at,
maximum_index_count,
pattern,
updated_at
FROM ovh.public_cloud_analytics.opensearch_patterns
WHERE pattern_id = '{{ pattern_id }}' -- required
AND service_id = '{{ service_id }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Creates a glob pattern matching index names, with a maximum number of matching indexes. When the limit is reached, the oldest indexes are deleted. (Beta version)

INSERT INTO ovh.public_cloud_analytics.opensearch_patterns (
maximum_index_count,
pattern,
service_id,
project_id
)
SELECT
{{ maximum_index_count }} /* required */,
'{{ pattern }}' /* required */,
'{{ service_id }}',
'{{ project_id }}'
RETURNING
id,
checksum,
created_at,
maximum_index_count,
pattern,
updated_at
;

DELETE examples​

Deletes the index pattern and the indexes matching it. (Beta version)

DELETE FROM ovh.public_cloud_analytics.opensearch_patterns
WHERE pattern_id = '{{ pattern_id }}' --required
AND service_id = '{{ service_id }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;