curl --request POST \
--url https://api.example.com/api/semantic-models/{model_id}/deploy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"create_schedule": false,
"schedule_cron": "<string>",
"register_in_datahub": true,
"add_lineage": true,
"create_data_product": true,
"create_dashboard": true
}
'import requests
url = "https://api.example.com/api/semantic-models/{model_id}/deploy"
payload = {
"create_schedule": False,
"schedule_cron": "<string>",
"register_in_datahub": True,
"add_lineage": True,
"create_data_product": True,
"create_dashboard": True
}
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({
create_schedule: false,
schedule_cron: '<string>',
register_in_datahub: true,
add_lineage: true,
create_data_product: true,
create_dashboard: true
})
};
fetch('https://api.example.com/api/semantic-models/{model_id}/deploy', 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.example.com/api/semantic-models/{model_id}/deploy",
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([
'create_schedule' => false,
'schedule_cron' => '<string>',
'register_in_datahub' => true,
'add_lineage' => true,
'create_data_product' => true,
'create_dashboard' => true
]),
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://api.example.com/api/semantic-models/{model_id}/deploy"
payload := strings.NewReader("{\n \"create_schedule\": false,\n \"schedule_cron\": \"<string>\",\n \"register_in_datahub\": true,\n \"add_lineage\": true,\n \"create_data_product\": true,\n \"create_dashboard\": true\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://api.example.com/api/semantic-models/{model_id}/deploy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"create_schedule\": false,\n \"schedule_cron\": \"<string>\",\n \"register_in_datahub\": true,\n \"add_lineage\": true,\n \"create_data_product\": true,\n \"create_dashboard\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/semantic-models/{model_id}/deploy")
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 \"create_schedule\": false,\n \"schedule_cron\": \"<string>\",\n \"register_in_datahub\": true,\n \"add_lineage\": true,\n \"create_data_product\": true,\n \"create_dashboard\": true\n}"
response = http.request(request)
puts response.read_body{
"model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"view_name": "<string>",
"status": "draft",
"deployed_at": "2023-11-07T05:31:56Z",
"message": "<string>",
"external_id": "<string>",
"data_product_id": "<string>",
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"airflow_url": "<string>",
"dashboard": {
"dashboard_id": 123,
"dashboard_url": "<string>",
"embed_url": "<string>",
"embed_token": "<string>",
"chart_ids": [
123
]
}
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Deploy model
Deploy an approved semantic model to Trino.
Required role: nx1_semantic_admin
curl --request POST \
--url https://api.example.com/api/semantic-models/{model_id}/deploy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"create_schedule": false,
"schedule_cron": "<string>",
"register_in_datahub": true,
"add_lineage": true,
"create_data_product": true,
"create_dashboard": true
}
'import requests
url = "https://api.example.com/api/semantic-models/{model_id}/deploy"
payload = {
"create_schedule": False,
"schedule_cron": "<string>",
"register_in_datahub": True,
"add_lineage": True,
"create_data_product": True,
"create_dashboard": True
}
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({
create_schedule: false,
schedule_cron: '<string>',
register_in_datahub: true,
add_lineage: true,
create_data_product: true,
create_dashboard: true
})
};
fetch('https://api.example.com/api/semantic-models/{model_id}/deploy', 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.example.com/api/semantic-models/{model_id}/deploy",
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([
'create_schedule' => false,
'schedule_cron' => '<string>',
'register_in_datahub' => true,
'add_lineage' => true,
'create_data_product' => true,
'create_dashboard' => true
]),
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://api.example.com/api/semantic-models/{model_id}/deploy"
payload := strings.NewReader("{\n \"create_schedule\": false,\n \"schedule_cron\": \"<string>\",\n \"register_in_datahub\": true,\n \"add_lineage\": true,\n \"create_data_product\": true,\n \"create_dashboard\": true\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://api.example.com/api/semantic-models/{model_id}/deploy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"create_schedule\": false,\n \"schedule_cron\": \"<string>\",\n \"register_in_datahub\": true,\n \"add_lineage\": true,\n \"create_data_product\": true,\n \"create_dashboard\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/semantic-models/{model_id}/deploy")
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 \"create_schedule\": false,\n \"schedule_cron\": \"<string>\",\n \"register_in_datahub\": true,\n \"add_lineage\": true,\n \"create_data_product\": true,\n \"create_dashboard\": true\n}"
response = http.request(request)
puts response.read_body{
"model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"view_name": "<string>",
"status": "draft",
"deployed_at": "2023-11-07T05:31:56Z",
"message": "<string>",
"external_id": "<string>",
"data_product_id": "<string>",
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"airflow_url": "<string>",
"dashboard": {
"dashboard_id": 123,
"dashboard_url": "<string>",
"embed_url": "<string>",
"embed_token": "<string>",
"chart_ids": [
123
]
}
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Body
Request to deploy an approved model.
Create an Airflow DAG for scheduled refresh.
Cron schedule. Required if create_schedule=True.
Register the deployed view in DataHub.
Add lineage from source tables.
Create a DataHub data product grouping the deployed view, with the model's description and lineage. Requires register_in_datahub=True.
Create a Superset dashboard for the deployed model.
Response
Model deployed.
Response for model deployment.
Status of a semantic model.
draft, pending_review, approved, rejected, deployed, failed, archived DataHub URN if registered.
DataHub data product URN if created.
Airflow job ID if scheduled.
Airflow DAG URL.
Superset dashboard info if created.
Show child attributes
Show child attributes
Was this page helpful?

