Get query count
curl --request POST \
--url https://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_name": "<WORKSPACE_NAME>",
"run_by": "<USER_EMAIL_ID>",
"cluster_name": [
"<CLUSTER_NAME1>",
"<CLUSTER_NAME2>"
]
}
'import requests
url = "https://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/"
payload = {
"workspace_name": "<WORKSPACE_NAME>",
"run_by": "<USER_EMAIL_ID>",
"cluster_name": ["<CLUSTER_NAME1>", "<CLUSTER_NAME2>"]
}
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({
workspace_name: '<WORKSPACE_NAME>',
run_by: '<USER_EMAIL_ID>',
cluster_name: ['<CLUSTER_NAME1>', '<CLUSTER_NAME2>']
})
};
fetch('https://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/', 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://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/",
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([
'workspace_name' => '<WORKSPACE_NAME>',
'run_by' => '<USER_EMAIL_ID>',
'cluster_name' => [
'<CLUSTER_NAME1>',
'<CLUSTER_NAME2>'
]
]),
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://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/"
payload := strings.NewReader("{\n \"workspace_name\": \"<WORKSPACE_NAME>\",\n \"run_by\": \"<USER_EMAIL_ID>\",\n \"cluster_name\": [\n \"<CLUSTER_NAME1>\",\n \"<CLUSTER_NAME2>\"\n ]\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://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_name\": \"<WORKSPACE_NAME>\",\n \"run_by\": \"<USER_EMAIL_ID>\",\n \"cluster_name\": [\n \"<CLUSTER_NAME1>\",\n \"<CLUSTER_NAME2>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/")
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 \"workspace_name\": \"<WORKSPACE_NAME>\",\n \"run_by\": \"<USER_EMAIL_ID>\",\n \"cluster_name\": [\n \"<CLUSTER_NAME1>\",\n \"<CLUSTER_NAME2>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"result": [
{
"status": "Success",
"count": 17235
},
{
"status": "Failed",
"count": 54476
},
{
"status": "Cancelled",
"count": 0
},
{
"status": "Timedout",
"count": 0
},
{
"status": "Parsing failed",
"count": 1
},
{
"status": "Executing",
"count": 1
},
{
"status": "Planning",
"count": 0
},
{
"status": "Queued",
"count": 0
}
]
}Get query count
Returns the number of queries in each status. Filter the counts by workspace, the user who ran the queries, and cluster.
Both date parameters are optional, in UTC, and use the format YYYY-MM-DD HH:MM:SS.
If from_date is omitted, the latest 100 records are fetched. If to_date is omitted,
the current time is used as the end time.
POST
/
endpoints
/
v1
/
query-history
/
get-query-count
/
Get query count
curl --request POST \
--url https://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_name": "<WORKSPACE_NAME>",
"run_by": "<USER_EMAIL_ID>",
"cluster_name": [
"<CLUSTER_NAME1>",
"<CLUSTER_NAME2>"
]
}
'import requests
url = "https://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/"
payload = {
"workspace_name": "<WORKSPACE_NAME>",
"run_by": "<USER_EMAIL_ID>",
"cluster_name": ["<CLUSTER_NAME1>", "<CLUSTER_NAME2>"]
}
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({
workspace_name: '<WORKSPACE_NAME>',
run_by: '<USER_EMAIL_ID>',
cluster_name: ['<CLUSTER_NAME1>', '<CLUSTER_NAME2>']
})
};
fetch('https://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/', 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://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/",
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([
'workspace_name' => '<WORKSPACE_NAME>',
'run_by' => '<USER_EMAIL_ID>',
'cluster_name' => [
'<CLUSTER_NAME1>',
'<CLUSTER_NAME2>'
]
]),
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://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/"
payload := strings.NewReader("{\n \"workspace_name\": \"<WORKSPACE_NAME>\",\n \"run_by\": \"<USER_EMAIL_ID>\",\n \"cluster_name\": [\n \"<CLUSTER_NAME1>\",\n \"<CLUSTER_NAME2>\"\n ]\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://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_name\": \"<WORKSPACE_NAME>\",\n \"run_by\": \"<USER_EMAIL_ID>\",\n \"cluster_name\": [\n \"<CLUSTER_NAME1>\",\n \"<CLUSTER_NAME2>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.e6data.com/endpoints/v1/query-history/get-query-count/")
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 \"workspace_name\": \"<WORKSPACE_NAME>\",\n \"run_by\": \"<USER_EMAIL_ID>\",\n \"cluster_name\": [\n \"<CLUSTER_NAME1>\",\n \"<CLUSTER_NAME2>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"result": [
{
"status": "Success",
"count": 17235
},
{
"status": "Failed",
"count": 54476
},
{
"status": "Cancelled",
"count": 0
},
{
"status": "Timedout",
"count": 0
},
{
"status": "Parsing failed",
"count": 1
},
{
"status": "Executing",
"count": 1
},
{
"status": "Planning",
"count": 0
},
{
"status": "Queued",
"count": 0
}
]
}Authorizations
Query Parameters
Body
application/json