Skip to main content

clickhouse_current_queries

Creates, updates, deletes, gets or lists a clickhouse_current_queries resource.

Overview​

Nameclickhouse_current_queries
TypeResource
Idovh.cloud_database.clickhouse_current_queries

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
queriesarrayCurrent queries list

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcluster_id, service_namelimit, offsetRetrieve the current queries for the cluster
cancelexecclusterId, service_nameCancel the given current query of the cluster

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"}})
clusterIdstring (uuid)Cluster ID
cluster_idstring (uuid)Cluster ID (wire: clusterId)
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
limitintegerLimit size of the result set returned by the pagination
offsetintegerOffset of the result set returned by the pagination

SELECT examples​

Retrieve the current queries for the cluster

SELECT
queries
FROM ovh.cloud_database.clickhouse_current_queries
WHERE cluster_id = '{{ cluster_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND limit = '{{ limit }}'
AND offset = '{{ offset }}'
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Cancel the given current query of the cluster

EXEC ovh.cloud_database.clickhouse_current_queries.cancel
@clusterId='{{ clusterId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"pid": {{ pid }},
"terminate": {{ terminate }}
}'
;