Ingest a data asset from a schema - Gable Docs
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Ingest a Data Asset from a Schema
POST/v0/data-asset/ingest
cURL
curl --request POST \
--url https://demo-api.gable.ai/v0/data-asset/ingest \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"sourceNames": [
"<string>"
],
"databaseSchema": "<string>",
"schema": [
"<string>"
],
"dryRun": false,
"prLink": "https://github.com/fakeorg/fakerepo/pull/123"
}
'
import requests
url = "https://demo-api.gable.ai/v0/data-asset/ingest"
payload = {
"sourceNames": ["<string>"],
"databaseSchema": "<string>",
"schema": ["<string>"],
"dryRun": False,
"prLink": "https://github.com/fakeorg/fakerepo/pull/123"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourceNames: ['<string>'],
databaseSchema: '<string>',
schema: ['<string>'],
dryRun: false,
prLink: 'https://github.com/fakeorg/fakerepo/pull/123'
})
};
fetch('https://demo-api.gable.ai/v0/data-asset/ingest', 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://demo-api.gable.ai/v0/data-asset/ingest",
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([
'sourceNames' => [
'<string>'
],
'databaseSchema' => '<string>',
'schema' => [
'<string>'
],
'dryRun' => false,
'prLink' => 'https://github.com/fakeorg/fakerepo/pull/123'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Response
200
application/json
{
"message": "<string>",
"registered": [
"<string>"
],
"success": true
}
{
"message": "<string>",
"id": 123,
"title": "<string>",
"success": true
}
Authorizations
X-API-KEY
Type: string
Location: header
Required.
Body
application/json
Data Asset Schema
sourceType: enum
- Required: The type of the source data asset, indicating its source or format (e.g., postgres, protobuf).
- Available options:
postgresmysqlmssqljson_schemaavroprotobufpythonpysparktypescriptjavas3dataframekotlinswiftphpgolang
sourceNames: string[]
- Required: The names of the sources.
databaseSchema: string
- Required: The name of the database schema.
schema: string[]
- Required: Array of schemas. Each schema could be from a db information schema or the contents of a schema file.
dryRun: boolean
- Default: false
- If true, no data asset will be registered.
prLink: string
- Link to the PR that may have added or edited the data assets.
Example:
"https://github.com/fakeorg/fakerepo/pull/123"