List Query Log
curl --request POST \
--url https://cloud.cdata.com/api/log/query/list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endTime": "2023-11-07T05:31:56Z",
"queryType": 2,
"startTime": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://cloud.cdata.com/api/log/query/list"
payload = {
"endTime": "2023-11-07T05:31:56Z",
"queryType": 2,
"startTime": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endTime: '2023-11-07T05:31:56Z',
queryType: 2,
startTime: '2023-11-07T05:31:56Z'
})
};
fetch('https://cloud.cdata.com/api/log/query/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloud.cdata.com/api/log/query/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'endTime' => '2023-11-07T05:31:56Z',
'queryType' => 2,
'startTime' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloud.cdata.com/api/log/query/list"
payload := strings.NewReader("{\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"queryType\": 2,\n \"startTime\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud.cdata.com/api/log/query/list")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"queryType\": 2,\n \"startTime\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.cdata.com/api/log/query/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"queryType\": 2,\n \"startTime\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"queries": [
{
"credential": "prat8897@gmail.com",
"duration": 308,
"drivers": "PostgreSQL",
"errorCode": "QUERY_FAILED",
"errorMessage": "The stored procedure execution failed with the following error:\r\n[500] Could not execute the specified command: Unknown stored function/procedure transferdata\r\n<Query ID: e1af1260-4045-45e4-882b-96fe2575e37b>",
"logFileKey": "x41GvdkvWlJsaEdQrzI2+t7M+TSbimW8iJIfQPv9mK1PqurO1/pzPW3D2ObewKfK6w51T7ui8yecrEYV3JpW9WmsAU+yVv4Vke1D2lB8EeKsv3ab6w2ZXrNZxPBAgaKAZLoRf8zbuHGWDGSQQ9gDJg==",
"logVerbosity": 1,
"query": "PostgreSQL1.public.transferdata",
"queryId": "e1af1260-4045-45e4-882b-96fe2575e37b",
"queryType": 203,
"rowsAffected": -1,
"rowsInput": 1,
"rowsReturned": 0,
"timestamp": "2024-03-19T18:55:34.837Z",
"userAgent": "PostmanRuntime/7.37.0"
}
]
}Log API
List Query Log
Retrieves a list of query logs for an account.
POST
/
log
/
query
/
list
List Query Log
curl --request POST \
--url https://cloud.cdata.com/api/log/query/list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endTime": "2023-11-07T05:31:56Z",
"queryType": 2,
"startTime": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://cloud.cdata.com/api/log/query/list"
payload = {
"endTime": "2023-11-07T05:31:56Z",
"queryType": 2,
"startTime": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endTime: '2023-11-07T05:31:56Z',
queryType: 2,
startTime: '2023-11-07T05:31:56Z'
})
};
fetch('https://cloud.cdata.com/api/log/query/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloud.cdata.com/api/log/query/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'endTime' => '2023-11-07T05:31:56Z',
'queryType' => 2,
'startTime' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloud.cdata.com/api/log/query/list"
payload := strings.NewReader("{\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"queryType\": 2,\n \"startTime\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud.cdata.com/api/log/query/list")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"queryType\": 2,\n \"startTime\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.cdata.com/api/log/query/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"queryType\": 2,\n \"startTime\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"queries": [
{
"credential": "prat8897@gmail.com",
"duration": 308,
"drivers": "PostgreSQL",
"errorCode": "QUERY_FAILED",
"errorMessage": "The stored procedure execution failed with the following error:\r\n[500] Could not execute the specified command: Unknown stored function/procedure transferdata\r\n<Query ID: e1af1260-4045-45e4-882b-96fe2575e37b>",
"logFileKey": "x41GvdkvWlJsaEdQrzI2+t7M+TSbimW8iJIfQPv9mK1PqurO1/pzPW3D2ObewKfK6w51T7ui8yecrEYV3JpW9WmsAU+yVv4Vke1D2lB8EeKsv3ab6w2ZXrNZxPBAgaKAZLoRf8zbuHGWDGSQQ9gDJg==",
"logVerbosity": 1,
"query": "PostgreSQL1.public.transferdata",
"queryId": "e1af1260-4045-45e4-882b-96fe2575e37b",
"queryType": 203,
"rowsAffected": -1,
"rowsInput": 1,
"rowsReturned": 0,
"timestamp": "2024-03-19T18:55:34.837Z",
"userAgent": "PostmanRuntime/7.37.0"
}
]
}承認
JWT token authentication. Include the token in the Authorization header as Bearer {token}. See Authentication for more information on creating a token.
ボディ
application/json
The end time of the query.
The type of query.
| Value | Name |
|---|---|
| 0 | Drivers |
| 1 | DriverInfo |
| 2 | TestConnection |
| 3 | GetOAuthAuthorizationUrl |
| 4 | GetOAuthAccessToken |
| 5 | CustomReportInfo |
| 6 | GenerateCustomReport |
| 7 | GetAPIRootPaths |
| 8 | GetAPIColumns |
| 9 | GetAPIRows |
| 10 | GetTimeCheckColumns |
| 11 | GetDynamicPropValues |
| 20 | DisconnectOAuthAccessToken |
| 100 | Catalogs |
| 101 | Schemas |
| 102 | Tables |
| 103 | Columns |
| 104 | PrimaryKeys |
| 105 | ImportedKeys |
| 106 | ExportedKeys |
| 107 | Procedures |
| 108 | ProcedureParameters |
| 109 | Indexes |
| 200 | Query |
| 201 | QuerySchemaOnly |
| 202 | Batch |
| 203 | Exec |
| 204 | Caching |
| 205 | ScheduledQuery |
| 210 | ODataServiceDocument |
| 211 | ODataMetadata |
| 212 | ODataQuery |
| 220 | OpenAPIDocument |
| 230 | CreateDerivedView |
| 231 | AlterDerivedView |
| 232 | DropDerivedView |
利用可能なオプション:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 200, 201, 202, 203, 204, 205, 210, 211, 212, 220, 230, 231, 232 The start time of the query.
レスポンス
200 - application/json
OK
Show child attributes
Show child attributes
このページは役に立ちましたか?
⌘I