Scan Data
curl --request POST \
--url https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"filter": "id = '1'",
"limit": 10,
"projection": "id, metadata, text"
}
EOFimport requests
url = "https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan"
payload = {
"filter": "id = '1'",
"limit": 10,
"projection": "id, metadata, text"
}
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({filter: 'id = \'1\'', limit: 10, projection: 'id, metadata, text'})
};
fetch('https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan', 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://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan",
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([
'filter' => 'id = \'1\'',
'limit' => 10,
'projection' => 'id, metadata, text'
]),
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://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan"
payload := strings.NewReader("{\n \"filter\": \"id = '1'\",\n \"limit\": 10,\n \"projection\": \"id, metadata, text\"\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://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": \"id = '1'\",\n \"limit\": 10,\n \"projection\": \"id, metadata, text\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan")
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 \"filter\": \"id = '1'\",\n \"limit\": 10,\n \"projection\": \"id, metadata, text\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"data": [
{
"id": "1",
"metadata": "{\"file_name\": \"abc.pdf\"}",
"text": "hello"
}
],
"metrics": {
"elapsed_time": 0.5,
"rss_peak_bytes": 52428800
},
"schema": {
"fields": [
{
"data_type": "LargeUtf8",
"name": "id",
"nullable": false
},
{
"data_type": "LargeUtf8",
"name": "metadata",
"nullable": true
},
{
"data_type": "LargeUtf8",
"name": "text",
"nullable": true
}
],
"metadata": {}
}
},
"exception": null,
"success": true
}{
"code": 500,
"data": null,
"exception": {
"error_code": 500001,
"error_message": "Internal error: "
},
"success": false
}테이블 (Table)
Scan Data
Performs a scan operation across all SeahorseDB nodes, returning relevant data from the specified table. It is almost same as normal SQL “SELECT” execution of normal RDBMSs.
POST
/
v2
/
data
/
scan
Scan Data
curl --request POST \
--url https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"filter": "id = '1'",
"limit": 10,
"projection": "id, metadata, text"
}
EOFimport requests
url = "https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan"
payload = {
"filter": "id = '1'",
"limit": 10,
"projection": "id, metadata, text"
}
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({filter: 'id = \'1\'', limit: 10, projection: 'id, metadata, text'})
};
fetch('https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan', 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://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan",
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([
'filter' => 'id = \'1\'',
'limit' => 10,
'projection' => 'id, metadata, text'
]),
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://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan"
payload := strings.NewReader("{\n \"filter\": \"id = '1'\",\n \"limit\": 10,\n \"projection\": \"id, metadata, text\"\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://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": \"id = '1'\",\n \"limit\": 10,\n \"projection\": \"id, metadata, text\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data/scan")
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 \"filter\": \"id = '1'\",\n \"limit\": 10,\n \"projection\": \"id, metadata, text\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"data": [
{
"id": "1",
"metadata": "{\"file_name\": \"abc.pdf\"}",
"text": "hello"
}
],
"metrics": {
"elapsed_time": 0.5,
"rss_peak_bytes": 52428800
},
"schema": {
"fields": [
{
"data_type": "LargeUtf8",
"name": "id",
"nullable": false
},
{
"data_type": "LargeUtf8",
"name": "metadata",
"nullable": true
},
{
"data_type": "LargeUtf8",
"name": "text",
"nullable": true
}
],
"metadata": {}
}
},
"exception": null,
"success": true
}{
"code": 500,
"data": null,
"exception": {
"error_code": 500001,
"error_message": "Internal error: "
},
"success": false
}Authorizations
bearerAuthapiKeyAuth
Bearer token authentication. Include the token in the Authorization header as 'Bearer '
Query Parameters
Include metrics in the response. Default is false.
Body
application/json
The scan condition. It includes projection, filter, and limit.
SQL WHERE clause to filter the results. If not specified, no filtering will be applied.
Example:
"text like '%hello%'"
Number of rows to return in the result set. If set to 0 or not specified, returns all matching rows.
Example:
"10"
Columns to include in the result set. Uses SQL projection syntax (e.g. "col1, col2"). If not specified, all columns will be returned.
Example:
"id, metadata, text"