Python
import os
from meibel import MeibelClient
from meibel.models import UpdateTagTablesRequest, TagTableUpdateItem
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
updated_tables = client.datasources.tables.update_descriptions(
"ds_9f8a3c1b2e4d",
UpdateTagTablesRequest(
tables=[
TagTableUpdateItem(
table_name="orders",
description="Customer order records including totals and status",
),
TagTableUpdateItem(
table_name="customers",
description="Customer profile and contact information",
),
]
),
)
for table in updated_tables:
print(f"{table.table_name}: {table.description}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const tables = await client.datasources.tables.updateDescriptions(
"ds_8f3a2b1c9d0e",
{
tables: [
{
table_name: "customers",
description: "Customer master records including contact info and account status",
},
{
table_name: "orders",
description: "Order transactions linked to customers and line items",
},
],
}
);
tables.forEach((table) => console.log(`${table.table_name}: ${table.description}`));package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
tables, err := client.Datasources.Tables.UpdateDescriptions(
context.Background(),
"ds_9f3c1a2b7e4d",
v2.UpdateTagTablesRequest{
Tables: []v2.TagTableUpdateItem{
{
TableName: "customers",
Description: "Customer master records including contact and billing info",
},
{
TableName: "orders",
Description: "Order transactions placed by customers",
},
},
},
)
if err != nil {
fmt.Println("error:", err)
return
}
for _, table := range tables {
fmt.Println(table.TableName, "-", table.Description)
}
}curl --request PUT \
--url https://api.meibel.ai/v2/datasources/{datasource_id}/tables \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"tables": [
{
"table_name": "<string>",
"description": "<string>"
}
]
}
'const options = {
method: 'PUT',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({tables: [{table_name: '<string>', description: '<string>'}]})
};
fetch('https://api.meibel.ai/v2/datasources/{datasource_id}/tables', 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://api.meibel.ai/v2/datasources/{datasource_id}/tables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'tables' => [
[
'table_name' => '<string>',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.meibel.ai/v2/datasources/{datasource_id}/tables")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tables\": [\n {\n \"table_name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/datasources/{datasource_id}/tables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tables\": [\n {\n \"table_name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"table_name": "<string>",
"description": "<string>",
"columns": [
{
"column_name": "<string>",
"type": "<string>",
"description": "<string>"
}
]
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Tables
Update Table Descriptions
PUT
/
datasources
/
{datasource_id}
/
tables
Python
import os
from meibel import MeibelClient
from meibel.models import UpdateTagTablesRequest, TagTableUpdateItem
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
updated_tables = client.datasources.tables.update_descriptions(
"ds_9f8a3c1b2e4d",
UpdateTagTablesRequest(
tables=[
TagTableUpdateItem(
table_name="orders",
description="Customer order records including totals and status",
),
TagTableUpdateItem(
table_name="customers",
description="Customer profile and contact information",
),
]
),
)
for table in updated_tables:
print(f"{table.table_name}: {table.description}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const tables = await client.datasources.tables.updateDescriptions(
"ds_8f3a2b1c9d0e",
{
tables: [
{
table_name: "customers",
description: "Customer master records including contact info and account status",
},
{
table_name: "orders",
description: "Order transactions linked to customers and line items",
},
],
}
);
tables.forEach((table) => console.log(`${table.table_name}: ${table.description}`));package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
tables, err := client.Datasources.Tables.UpdateDescriptions(
context.Background(),
"ds_9f3c1a2b7e4d",
v2.UpdateTagTablesRequest{
Tables: []v2.TagTableUpdateItem{
{
TableName: "customers",
Description: "Customer master records including contact and billing info",
},
{
TableName: "orders",
Description: "Order transactions placed by customers",
},
},
},
)
if err != nil {
fmt.Println("error:", err)
return
}
for _, table := range tables {
fmt.Println(table.TableName, "-", table.Description)
}
}curl --request PUT \
--url https://api.meibel.ai/v2/datasources/{datasource_id}/tables \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"tables": [
{
"table_name": "<string>",
"description": "<string>"
}
]
}
'const options = {
method: 'PUT',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({tables: [{table_name: '<string>', description: '<string>'}]})
};
fetch('https://api.meibel.ai/v2/datasources/{datasource_id}/tables', 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://api.meibel.ai/v2/datasources/{datasource_id}/tables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'tables' => [
[
'table_name' => '<string>',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.meibel.ai/v2/datasources/{datasource_id}/tables")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tables\": [\n {\n \"table_name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/datasources/{datasource_id}/tables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tables\": [\n {\n \"table_name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"table_name": "<string>",
"description": "<string>",
"columns": [
{
"column_name": "<string>",
"type": "<string>",
"description": "<string>"
}
]
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Body
application/json
Bulk update of table descriptions on a datasource.
One entry per table to update
Show child attributes
Show child attributes
Response
Successful Response
Was this page helpful?
⌘I