Queries
All operations require authentication.
List running queriesBeta
Returns the queries running on the service, with their client, user, state and duration.
Path parameters
Project ID
Service ID
Headers
Pagination cursor
Pagination size
Response
Name of the application that initiated the query
Timestamp when the backend process started
IP address of the client
Port of the client connection
Name of the database the query is running on
Process ID of the connection
SQL text of the currently running query
Duration of the query in seconds
Timestamp when the query started
Current state of the connection
ACTIVEDISABLEDFASTPATH_FUNCTION_CALLIDLEIDLE_IN_TRANSACTIONIDLE_IN_TRANSACTION_ABORTEDName of the user running the query
Name of the wait event the connection is waiting on, if any
Type of wait event the connection is waiting on, if any
ACTIVITYBUFFER_PINCLIENTEXTENSIONIOIPCLOCKLWLOCKTIMEOUTExample uses projectId = string, serviceId = 00000000-0000-0000-0000-000000000000
$ curl https:/ / api.eu.ovhcloud.com/ v2/ publicCloud/ project/ {projectId}/ managedDatabase/ postgresql/ {serviceId}/ currentQueries \
-H "authorization: Bearer $OVH_TOKEN"[ { "applicationName": "string", "backendStartedAt": "2024-01-01T12:00:00Z", "clientIp": "192.0.2.0", "clientPort": 0, "databaseName": "string", "pid": 0, "query": "string", "queryDuration": 0, "queryStartedAt": "2024-01-01T12:00:00Z", "state": "ACTIVE", "userName": "string", "waitEvent": "string", "waitEventType": "ACTIVITY" }]
Get a running queryBeta
Returns the SQL text, state and duration of a running query, identified by its process ID.
Path parameters
Project ID
Query pid
Service ID
Query parameters
Maximum number of queries to return
Number of queries to skip before returning results
Response
Name of the application that initiated the query
Timestamp when the backend process started
IP address of the client
Port of the client connection
Name of the database the query is running on
Process ID of the connection
SQL text of the currently running query
Duration of the query in seconds
Timestamp when the query started
Current state of the connection
ACTIVEDISABLEDFASTPATH_FUNCTION_CALLIDLEIDLE_IN_TRANSACTIONIDLE_IN_TRANSACTION_ABORTEDName of the user running the query
Name of the wait event the connection is waiting on, if any
Type of wait event the connection is waiting on, if any
ACTIVITYBUFFER_PINCLIENTEXTENSIONIOIPCLOCKLWLOCKTIMEOUTExample uses projectId = string, queryPid = 0, serviceId = 00000000-0000-0000-0000-000000000000
$ curl https:/ / api.eu.ovhcloud.com/ v2/ publicCloud/ project/ {projectId}/ managedDatabase/ postgresql/ {serviceId}/ currentQueries/ {queryPid} \
-H "authorization: Bearer $OVH_TOKEN"{ "applicationName": "string", "backendStartedAt": "2024-01-01T12:00:00Z", "clientIp": "192.0.2.0", "clientPort": 0, "databaseName": "string", "pid": 0, "query": "string", "queryDuration": 0, "queryStartedAt": "2024-01-01T12:00:00Z", "state": "ACTIVE", "userName": "string", "waitEvent": "string", "waitEventType": "ACTIVITY"}
Cancel a running queryBeta
Cancels a running query gracefully. Set terminate to true to force its termination instead.
Path parameters
Project ID
Query pid
Service ID
Request body (required)
Whether to forcefully terminate the query instead of gracefully canceling it
Response
Whether the query was successfully canceled
Example uses projectId = string, queryPid = 0, serviceId = 00000000-0000-0000-0000-000000000000
$ curl https:/ / api.eu.ovhcloud.com/ v2/ publicCloud/ project/ {projectId}/ managedDatabase/ postgresql/ {serviceId}/ currentQueries/ {queryPid}/ cancel \
-H "authorization: Bearer $OVH_TOKEN"{ "success": true}
List query statisticsBeta
Returns execution statistics for each query pattern: number of calls, rows and execution times.
Path parameters
Project ID
Service ID
Query parameters
Maximum number of entries to return
Number of entries to skip before returning results
Headers
Pagination cursor
Pagination size
Response
Number of times this query pattern has been executed
Name of the database
Digest hash of the normalized query
Timestamp of the first execution
Timestamp of the most recent execution
Maximum execution time in milliseconds
Mean execution time in milliseconds
Minimum execution time in milliseconds
Representative SQL text of the query pattern
Total number of rows retrieved or affected
Total cumulative execution time in milliseconds
Name of the user who executed the query
Example uses projectId = string, serviceId = 00000000-0000-0000-0000-000000000000
$ curl https:/ / api.eu.ovhcloud.com/ v2/ publicCloud/ project/ {projectId}/ managedDatabase/ postgresql/ {serviceId}/ queryStatistics \
-H "authorization: Bearer $OVH_TOKEN"[ { "calls": 0, "databaseName": "string", "digest": "string", "firstSeen": "2024-01-01T12:00:00Z", "lastSeen": "2024-01-01T12:00:00Z", "maxTime": 0, "meanTime": 0, "minTime": 0, "query": "string", "rows": 0, "totalTime": 0, "username": "string" }]
Reset query statisticsBeta
Resets all aggregated query statistics of the service.
Path parameters
Project ID
Service ID
Response
Example uses projectId = string, serviceId = 00000000-0000-0000-0000-000000000000
$ curl https:/ / api.eu.ovhcloud.com/ v2/ publicCloud/ project/ {projectId}/ managedDatabase/ postgresql/ {serviceId}/ queryStatistics/ reset \
-H "authorization: Bearer $OVH_TOKEN"