Update a datasource
import requests
url = "https://{FUSION HOST}/api/connectors/datasources/{id}"
payload = {
"id": "pokedex_json_zip-api-test-app",
"connector": "lucid.fileupload",
"type": "fileupload",
"pipeline": "api-test-app",
"parserId": "pokedex_json_zip-api-test-app",
"properties": {
"collection": "api-test-collection",
"fileId": "pokedex.json.zip",
"mediaType": "application/octet-stream"
}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.put("https://{FUSION HOST}/api/connectors/datasources/{id}")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"pokedex_json_zip-api-test-app\",\n \"connector\": \"lucid.fileupload\",\n \"type\": \"fileupload\",\n \"pipeline\": \"api-test-app\",\n \"parserId\": \"pokedex_json_zip-api-test-app\",\n \"properties\": {\n \"collection\": \"api-test-collection\",\n \"fileId\": \"pokedex.json.zip\",\n \"mediaType\": \"application/octet-stream\"\n }\n}")
.asString();const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'pokedex_json_zip-api-test-app',
connector: 'lucid.fileupload',
type: 'fileupload',
pipeline: 'api-test-app',
parserId: 'pokedex_json_zip-api-test-app',
properties: {
collection: 'api-test-collection',
fileId: 'pokedex.json.zip',
mediaType: 'application/octet-stream'
}
})
};
fetch('https://{FUSION HOST}/api/connectors/datasources/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION HOST}/api/connectors/datasources/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"pokedex_json_zip-api-test-app\",\n \"connector\": \"lucid.fileupload\",\n \"type\": \"fileupload\",\n \"pipeline\": \"api-test-app\",\n \"parserId\": \"pokedex_json_zip-api-test-app\",\n \"properties\": {\n \"collection\": \"api-test-collection\",\n \"fileId\": \"pokedex.json.zip\",\n \"mediaType\": \"application/octet-stream\"\n }\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION HOST}/api/connectors/datasources/{id}"
payload := strings.NewReader("{\n \"id\": \"pokedex_json_zip-api-test-app\",\n \"connector\": \"lucid.fileupload\",\n \"type\": \"fileupload\",\n \"pipeline\": \"api-test-app\",\n \"parserId\": \"pokedex_json_zip-api-test-app\",\n \"properties\": {\n \"collection\": \"api-test-collection\",\n \"fileId\": \"pokedex.json.zip\",\n \"mediaType\": \"application/octet-stream\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION HOST}/api/connectors/datasources/{id}",
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([
'id' => 'pokedex_json_zip-api-test-app',
'connector' => 'lucid.fileupload',
'type' => 'fileupload',
'pipeline' => 'api-test-app',
'parserId' => 'pokedex_json_zip-api-test-app',
'properties' => [
'collection' => 'api-test-collection',
'fileId' => 'pokedex.json.zip',
'mediaType' => 'application/octet-stream'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request PUT \
--url https://{FUSION HOST}/api/connectors/datasources/{id} \
--header 'Content-Type: application/json' \
--data '
{
"id": "pokedex_json_zip-api-test-app",
"connector": "lucid.fileupload",
"type": "fileupload",
"pipeline": "api-test-app",
"parserId": "pokedex_json_zip-api-test-app",
"properties": {
"collection": "api-test-collection",
"fileId": "pokedex.json.zip",
"mediaType": "application/octet-stream"
}
}
'{
"id": "pokedex_json_zip-api-test-app",
"created": "2024-08-02T18:19:09.458Z",
"modified": "2024-08-02T19:43:28.394Z",
"connector": "lucid.fileupload",
"type": "fileupload",
"pipeline": "api-test-app",
"parserId": "pokedex_json_zip-api-test-app",
"properties": {
"collection": "api-test-collection",
"fileId": "pokedex.json.zip",
"mediaType": "application/octet-stream"
}
}Update a datasource
Update the configuration properties of the specified datasource configuration.
PUT
/
connectors
/
datasources
/
{id}
Update a datasource
import requests
url = "https://{FUSION HOST}/api/connectors/datasources/{id}"
payload = {
"id": "pokedex_json_zip-api-test-app",
"connector": "lucid.fileupload",
"type": "fileupload",
"pipeline": "api-test-app",
"parserId": "pokedex_json_zip-api-test-app",
"properties": {
"collection": "api-test-collection",
"fileId": "pokedex.json.zip",
"mediaType": "application/octet-stream"
}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.put("https://{FUSION HOST}/api/connectors/datasources/{id}")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"pokedex_json_zip-api-test-app\",\n \"connector\": \"lucid.fileupload\",\n \"type\": \"fileupload\",\n \"pipeline\": \"api-test-app\",\n \"parserId\": \"pokedex_json_zip-api-test-app\",\n \"properties\": {\n \"collection\": \"api-test-collection\",\n \"fileId\": \"pokedex.json.zip\",\n \"mediaType\": \"application/octet-stream\"\n }\n}")
.asString();const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'pokedex_json_zip-api-test-app',
connector: 'lucid.fileupload',
type: 'fileupload',
pipeline: 'api-test-app',
parserId: 'pokedex_json_zip-api-test-app',
properties: {
collection: 'api-test-collection',
fileId: 'pokedex.json.zip',
mediaType: 'application/octet-stream'
}
})
};
fetch('https://{FUSION HOST}/api/connectors/datasources/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION HOST}/api/connectors/datasources/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"pokedex_json_zip-api-test-app\",\n \"connector\": \"lucid.fileupload\",\n \"type\": \"fileupload\",\n \"pipeline\": \"api-test-app\",\n \"parserId\": \"pokedex_json_zip-api-test-app\",\n \"properties\": {\n \"collection\": \"api-test-collection\",\n \"fileId\": \"pokedex.json.zip\",\n \"mediaType\": \"application/octet-stream\"\n }\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION HOST}/api/connectors/datasources/{id}"
payload := strings.NewReader("{\n \"id\": \"pokedex_json_zip-api-test-app\",\n \"connector\": \"lucid.fileupload\",\n \"type\": \"fileupload\",\n \"pipeline\": \"api-test-app\",\n \"parserId\": \"pokedex_json_zip-api-test-app\",\n \"properties\": {\n \"collection\": \"api-test-collection\",\n \"fileId\": \"pokedex.json.zip\",\n \"mediaType\": \"application/octet-stream\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION HOST}/api/connectors/datasources/{id}",
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([
'id' => 'pokedex_json_zip-api-test-app',
'connector' => 'lucid.fileupload',
'type' => 'fileupload',
'pipeline' => 'api-test-app',
'parserId' => 'pokedex_json_zip-api-test-app',
'properties' => [
'collection' => 'api-test-collection',
'fileId' => 'pokedex.json.zip',
'mediaType' => 'application/octet-stream'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request PUT \
--url https://{FUSION HOST}/api/connectors/datasources/{id} \
--header 'Content-Type: application/json' \
--data '
{
"id": "pokedex_json_zip-api-test-app",
"connector": "lucid.fileupload",
"type": "fileupload",
"pipeline": "api-test-app",
"parserId": "pokedex_json_zip-api-test-app",
"properties": {
"collection": "api-test-collection",
"fileId": "pokedex.json.zip",
"mediaType": "application/octet-stream"
}
}
'{
"id": "pokedex_json_zip-api-test-app",
"created": "2024-08-02T18:19:09.458Z",
"modified": "2024-08-02T19:43:28.394Z",
"connector": "lucid.fileupload",
"type": "fileupload",
"pipeline": "api-test-app",
"parserId": "pokedex_json_zip-api-test-app",
"properties": {
"collection": "api-test-collection",
"fileId": "pokedex.json.zip",
"mediaType": "application/octet-stream"
}
}Path Parameters
The datasource configuration ID.
Query Parameters
Indicates if the configuration should be validated.
The context of resource. It usually is the app inside which the resource is created.
Body
application/json
The body is of type object.
Response
200 - application/json
OK
The response is of type object.
Was this page helpful?
⌘I