Exactly what should be the information inside <job-payload>.json file for Datameer REST API?
I have gone through Datameer REST API. To create a new data connection, the REST call should be "curl -u <username>:<password> -X POST -d @<job-payload>.json 'http://<Datameer-serverIP>:<port-number>/rest/connections' " . But job-payload.json file sample is not provided in the documentation. Please let me know exactly what information should go into job-payload.json file with keys. Sample file will be more helpful for me to understand.
Thanks in advance!
-
Official comment
The payload differs slightly between different Datameer versions. I'd recommend creating an example object in the GUI once and then using the REST API to read the existing object's payload. This will give you a suitable example to build from that is certainly compatible with your instance of Datameer.
Comment actions -
In v10.1.5, for creating datalinks via REST. Is there a method to call which allows all fields being referenced to have empty values (see below snippet).
Ex: if we don't include the {fields} key, the created datalink will include all fields from the source data, but it won't 'allow empty' for all of them as there doesn't seem to be a global method apparent in the docs to do so.
{
"className": "datameer.dap.common.entity.DataSourceConfigurationImpl",
"dataStore": {
"path": "/Data/Connections/Cloudera/Hive_DEV.dst",
"uuid": "19becee1-e284-4889-b4ba-3dadb172eb86"
},
"errorHandlingMode": "DROP_RECORD",
"fields": [
{
"acceptEmpty": true, ... <snip> <---- this is what we're after, allow empty for all fields... -
Sherry,
Hello!
The solution provided was a workaround to address some specific concerns when creating many Datalinks against a target database with various schemas.
At this time Datameer does not offer a means of forcing "accept empty" as a default option for all included columns. There are two workarounds for making this adjustment.
The first is a manual intervention in the form of opening the Datalink from the GUI and loading the "Define Fields" section. From there you will be required to adjust the "accept empty" option for each applicable column.
The second option will be to create a script that will first read the schema of the target table, populate the "fields" array in the JSON payload with all of the column names, and finally add the "accept empty" option under each. Then you can use this updated JSON to create a Datalink containing the desired configuration.
Cheers!
Please sign in to leave a comment.
Comments
5 comments