Skip to content

Query

Operations Summary

Method Endpoint Description
POST /api/query/ Execute read-only SQL query

Execute read-only SQL query

Execute a given SQL query against a read-only database replica. This is a powerful tool for diagnostics and reporting, but should be used with caution. Requires support user permissions.

1
2
3
4
5
http \
  POST \
  https://api.example.com/api/query/ \
  Authorization:"Token YOUR_API_TOKEN" \
  query="string-value"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.query_request import QueryRequest # (1)
from waldur_api_client.api.query import query # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)

body_data = QueryRequest(
    query="string-value"
)
response = query.sync(
    client=client,
    body=body_data
)

for item in response:
    print(item)
  1. Model Source: QueryRequest
  2. API Source: query
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { query } from 'waldur-js-client';

try {
  const response = await query({
  auth: "Token YOUR_API_TOKEN",
  body: {
    "query": "string-value"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Field Type Required
query string

200 -


400 - No response body