Create a datasource
import requests
url = "https://{FUSION HOST}/api/connectors/datasources"
payload = {
"id": "test-data-source",
"parserId": "api-test-app",
"connector": "lucid.fileupload",
"type": "fileupload",
"pipeline": "api-test-app",
"properties": {
"fileId": "pokedex.json.zip",
"description": "My test datasource"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "test-data-source",
"created": "2024-08-02T21:00:42.165Z",
"modified": "2024-08-02T21:00:42.165Z",
"connector": "lucid.fileupload",
"type": "fileupload",
"pipeline": "api-test-app",
"parserId": "api-test-app",
"properties": {
"description": "My test datasource",
"fileId": "pokedex.json.zip",
"mediaType": "application/octet-stream"
}
}Create a datasource
Create a new datasource. The request body contains the datasource configuration properties, which depend on the connector type.
-
Use
/connectors/pluginsto get the list of installed connector types. -
Use
/connectors/schema/{type}to get the configuration properties for the connector type you want to use.
POST
/
connectors
/
datasources
Create a datasource
import requests
url = "https://{FUSION HOST}/api/connectors/datasources"
payload = {
"id": "test-data-source",
"parserId": "api-test-app",
"connector": "lucid.fileupload",
"type": "fileupload",
"pipeline": "api-test-app",
"properties": {
"fileId": "pokedex.json.zip",
"description": "My test datasource"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "test-data-source",
"created": "2024-08-02T21:00:42.165Z",
"modified": "2024-08-02T21:00:42.165Z",
"connector": "lucid.fileupload",
"type": "fileupload",
"pipeline": "api-test-app",
"parserId": "api-test-app",
"properties": {
"description": "My test datasource",
"fileId": "pokedex.json.zip",
"mediaType": "application/octet-stream"
}
}Query Parameters
Indicates if the configuration should be created (persisted) or just 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
201 - application/json
Created
The response is of type object.
Was this page helpful?
⌘I