curl --request POST \
--url http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/vnd.composer.v3+json' \
--data '
{
"name": "Source Name",
"description": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone"
payload = {
"name": "Source Name",
"description": "<string>",
"tags": ["<string>"]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/vnd.composer.v3+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/vnd.composer.v3+json'
},
body: JSON.stringify({name: 'Source Name', description: '<string>', tags: ['<string>']})
};
fetch('http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone",
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([
'name' => 'Source Name',
'description' => '<string>',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/vnd.composer.v3+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 := "http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone"
payload := strings.NewReader("{\n \"name\": \"Source Name\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/vnd.composer.v3+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/vnd.composer.v3+json")
.body("{\n \"name\": \"Source Name\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/vnd.composer.v3+json'
request.body = "{\n \"name\": \"Source Name\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "Source Name",
"id": "59ba04795b542f60838ce0ea",
"description": "<string>",
"auditable": {
"createdByUserId": "59ba04795b542f60838ce0e1",
"createdByUserName": "user_name",
"createdDate": "2023-11-07T05:31:56Z",
"lastModifiedByUserId": "59ba04795b542f60838ce0e2",
"lastModifiedDate": "2023-11-07T05:31:56Z"
},
"storage": {
"dataEntities": [
{
"type": "SINGLE_COLLECTION",
"id": "data_entity_id",
"name": "Data Entity name",
"singleCollection": {
"connectionId": "59ba04795b542f60838ce0eb",
"collection": "real_time_sales",
"schema": "public",
"parameters": {}
},
"customSql": {
"connectionId": "59ba04795b542f60838ce0eb",
"sql": "select price * 100 as price, product_id from products"
},
"index": {
"connectionId": "59ba04795b542f60838ce0eb",
"collections": [
"log-1",
"log-2",
"log-3"
],
"patternType": "NATIVE",
"pattern": "log-*"
},
"upload": {
"uploadId": "59ba04795b542f60838ce0ec"
},
"nativeFields": [
{
"origin": {
"type": "NATIVE",
"nativeOrigin": {
"originalName": "field_name",
"originalType": "TIME",
"dataEntityId": "data_entity_1",
"rawFormat": {},
"metaFlags": [
"PLAYABLE"
],
"partitionedBy": {
"field": "<string>",
"function": "MURMUR3_HASH"
}
},
"derivedOrigin": {
"expression": "sales * 100",
"calendarId": "<string>",
"referencedFieldNames": [
"<string>"
]
},
"hierarchyOrigin": {
"childParent": {
"childField": "<string>",
"parentField": "<string>"
},
"labelField": "<string>"
}
},
"name": "field_name",
"label": "Field Label",
"visible": true,
"defaultMetric": "avg",
"dataType": "ATTRIBUTE",
"format": {
"time": {
"granularity": "MILLISECOND",
"timeZone": "UTC",
"options": {
"second": "NUMERIC",
"minute": "NUMERIC",
"hour": "NUMERIC",
"day": "NUMERIC",
"weekday": "LONG",
"week": "TWO_DIGIT",
"month": "NUMERIC",
"quarter": "TWO_DIGIT",
"year": "NUMERIC",
"dayOfYear": "NUMERIC",
"hour12": true
}
},
"number": {
"type": "PLAIN",
"decimals": 2,
"separator": true,
"negative": "SIGNED",
"standardUnit": "NONE",
"storageUnit": "BYTES",
"currencyCode": "USD"
},
"url": {
"type": "LINK",
"src": "<string>",
"width": 123,
"height": 123
}
},
"statistics": {
"override": {
"min": 123,
"max": 123,
"distinctValues": [
"<unknown>"
]
},
"cacheEnabled": true,
"refreshable": true,
"lookup": {
"raw": {
"dataEntityId": "<string>",
"originalFieldName": "<string>"
}
},
"cardinality": 123
},
"facetFiltering": {
"enabled": true,
"order": 2
},
"granularity": "MILLISECOND",
"disabledCapabilities": [
"<string>"
],
"fieldMetadata": {},
"rawFormatSupportTimeGroup": true,
"fieldName": "<string>",
"originalFieldName": "<string>"
}
],
"forbiddenFeatures": [
"<string>"
],
"auxiliary": true,
"cacheSettings": {
"rawCacheEnabled": true,
"rawCacheTtl": 2
}
}
],
"joins": [
{
"type": "INNER",
"leftDataEntity": {
"dataEntityId": "data_entity_id",
"dimension": false
},
"rightDataEntity": {
"dataEntityId": "data_entity_id",
"dimension": false
},
"conditions": [
{
"leftFieldName": "left_field_name",
"rightFieldName": "right_field_name"
}
]
}
]
},
"tags": [
"<string>"
],
"originId": "<string>",
"scope": "ACCOUNT",
"workspaceId": "<string>",
"projectId": 2222,
"folderId": 1111,
"positionConfiguration": {}
}Clone a source
Requires the CREATE_SOURCES privilege
curl --request POST \
--url http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/vnd.composer.v3+json' \
--data '
{
"name": "Source Name",
"description": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone"
payload = {
"name": "Source Name",
"description": "<string>",
"tags": ["<string>"]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/vnd.composer.v3+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/vnd.composer.v3+json'
},
body: JSON.stringify({name: 'Source Name', description: '<string>', tags: ['<string>']})
};
fetch('http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone",
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([
'name' => 'Source Name',
'description' => '<string>',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/vnd.composer.v3+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 := "http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone"
payload := strings.NewReader("{\n \"name\": \"Source Name\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/vnd.composer.v3+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/vnd.composer.v3+json")
.body("{\n \"name\": \"Source Name\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://10.2.4.166:8080/composer/api/sources/{sourceId}/clone")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/vnd.composer.v3+json'
request.body = "{\n \"name\": \"Source Name\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "Source Name",
"id": "59ba04795b542f60838ce0ea",
"description": "<string>",
"auditable": {
"createdByUserId": "59ba04795b542f60838ce0e1",
"createdByUserName": "user_name",
"createdDate": "2023-11-07T05:31:56Z",
"lastModifiedByUserId": "59ba04795b542f60838ce0e2",
"lastModifiedDate": "2023-11-07T05:31:56Z"
},
"storage": {
"dataEntities": [
{
"type": "SINGLE_COLLECTION",
"id": "data_entity_id",
"name": "Data Entity name",
"singleCollection": {
"connectionId": "59ba04795b542f60838ce0eb",
"collection": "real_time_sales",
"schema": "public",
"parameters": {}
},
"customSql": {
"connectionId": "59ba04795b542f60838ce0eb",
"sql": "select price * 100 as price, product_id from products"
},
"index": {
"connectionId": "59ba04795b542f60838ce0eb",
"collections": [
"log-1",
"log-2",
"log-3"
],
"patternType": "NATIVE",
"pattern": "log-*"
},
"upload": {
"uploadId": "59ba04795b542f60838ce0ec"
},
"nativeFields": [
{
"origin": {
"type": "NATIVE",
"nativeOrigin": {
"originalName": "field_name",
"originalType": "TIME",
"dataEntityId": "data_entity_1",
"rawFormat": {},
"metaFlags": [
"PLAYABLE"
],
"partitionedBy": {
"field": "<string>",
"function": "MURMUR3_HASH"
}
},
"derivedOrigin": {
"expression": "sales * 100",
"calendarId": "<string>",
"referencedFieldNames": [
"<string>"
]
},
"hierarchyOrigin": {
"childParent": {
"childField": "<string>",
"parentField": "<string>"
},
"labelField": "<string>"
}
},
"name": "field_name",
"label": "Field Label",
"visible": true,
"defaultMetric": "avg",
"dataType": "ATTRIBUTE",
"format": {
"time": {
"granularity": "MILLISECOND",
"timeZone": "UTC",
"options": {
"second": "NUMERIC",
"minute": "NUMERIC",
"hour": "NUMERIC",
"day": "NUMERIC",
"weekday": "LONG",
"week": "TWO_DIGIT",
"month": "NUMERIC",
"quarter": "TWO_DIGIT",
"year": "NUMERIC",
"dayOfYear": "NUMERIC",
"hour12": true
}
},
"number": {
"type": "PLAIN",
"decimals": 2,
"separator": true,
"negative": "SIGNED",
"standardUnit": "NONE",
"storageUnit": "BYTES",
"currencyCode": "USD"
},
"url": {
"type": "LINK",
"src": "<string>",
"width": 123,
"height": 123
}
},
"statistics": {
"override": {
"min": 123,
"max": 123,
"distinctValues": [
"<unknown>"
]
},
"cacheEnabled": true,
"refreshable": true,
"lookup": {
"raw": {
"dataEntityId": "<string>",
"originalFieldName": "<string>"
}
},
"cardinality": 123
},
"facetFiltering": {
"enabled": true,
"order": 2
},
"granularity": "MILLISECOND",
"disabledCapabilities": [
"<string>"
],
"fieldMetadata": {},
"rawFormatSupportTimeGroup": true,
"fieldName": "<string>",
"originalFieldName": "<string>"
}
],
"forbiddenFeatures": [
"<string>"
],
"auxiliary": true,
"cacheSettings": {
"rawCacheEnabled": true,
"rawCacheTtl": 2
}
}
],
"joins": [
{
"type": "INNER",
"leftDataEntity": {
"dataEntityId": "data_entity_id",
"dimension": false
},
"rightDataEntity": {
"dataEntityId": "data_entity_id",
"dimension": false
},
"conditions": [
{
"leftFieldName": "left_field_name",
"rightFieldName": "right_field_name"
}
]
}
]
},
"tags": [
"<string>"
],
"originId": "<string>",
"scope": "ACCOUNT",
"workspaceId": "<string>",
"projectId": 2222,
"folderId": 1111,
"positionConfiguration": {}
}Authorizations
HTTP Basic authentication using global administrator credentials (username and password).
Path Parameters
Body
Response
OK
Source name. It must be unique within the account
255"Source Name"
Unique identifier of the source
"59ba04795b542f60838ce0ea"
1500Contains information about users and time of creating and updating this object
Show child attributes
Show child attributes
Describes how and from where we get data
Show child attributes
Show child attributes
Tags. Note: Tags are not supported as a sort parameter in the pagination API.
Id of the exported source
Scope of the source: ACCOUNT (visible account-wide) or WORKSPACE (visible only inside the owning workspace). Derived from the caller's active workspace at creation time and cannot be set directly.
ACCOUNT, WORKSPACE Id of the workspace this source belongs to, when scope is WORKSPACE. This field is read-only.
Project ID where this source is organized. This field is read-only.
2222
Optional folder ID for organizing the source within a project.
1111
Defines position configuration of collections in canvas
Show child attributes
Show child attributes
Was this page helpful?