Skip to main content

mysql_query_statistics

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

Overview​

Namemysql_query_statistics
TypeResource
Idovh.cloud_database.mysql_query_statistics

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
queriesarrayStatistics of the queries

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcluster_id, service_namelimit, offsetRetrieve the query statistics for the cluster
resetexecclusterId, service_nameReset the query statistics 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 query statistics for the cluster

SELECT
queries
FROM ovh.cloud_database.mysql_query_statistics
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.

Reset the query statistics of the cluster

EXEC ovh.cloud_database.mysql_query_statistics.reset
@clusterId='{{ clusterId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;