Hi Balaji,
I have been trying with lot of json structure. As of now I did not find any document/links to guide what will be the exact json payload structure. Below is the payload.
db_creation_payload = {
“entityType”: “source”,
“config”: {
“scriptsEnabled”: “true”,
“showHiddenIndices”: “false”,
“showIdColumn”: “false”,
“readTimeoutMillis”: 60000,
“scrollTimeoutMillis”: 300000,
“usePainless”: “true”,
“scrollSize”: 4000,
“allowPushdownOnNormalizedOrAnalyzedFields”: “false”,
“warnOnRowCountMismatch”: “false”,
“encryptionValidationMode”: “CERTIFICATE_AND_HOSTNAME_VALIDATION”,
“hostList”: [
{
“hostname”: “localhost”,
“port”: 5432
}
],
“authenticationType”: “ANONYMOUS”,
“sslEnabled”: “false”,
“useWhitelist”: “false”
},
“type”: “POSTGRES”,
“name”: “dremio”,
“metadataPolicy”: {
“authTTLMs”: 86400000,
“namesRefreshMs”: 3600000,
“datasetRefreshAfterMs”: 3600000,
“datasetExpireAfterMs”: 10800000,
“datasetUpdateMode”: “PREFETCH_QUERIED”,
“deleteUnavailableDatasets”: “true”,
“autoPromoteDatasets”: “false”
},
“accelerationGracePeriodMs”: 10800000,
“accelerationRefreshPeriodMs”: 3600000,
“accelerationNeverExpire”: “false”,
“accelerationNeverRefresh”: “false”
}
Below is the function calling API.
def apiPost(endpoint, hdr, body=None):
text = requests.post(’{server}/api/v3/{endpoint}’.format(server=dremioServer, endpoint=endpoint), headers=hdr,
data=json.dumps(body)).text
print(text)
hdr = login(username, password)
apiPost(“catalog”, hdr, db_creation_payload)
Now it is not giving unrecognised entityType. Now it is showing -
"Unrecognized field “scriptsEnabled” (class com.dremio.exec.store.jdbc.conf.PostgresConf), not marked as ignorable (15 known properties: “port”, “useSsl”, “databaseName”, “maxIdleConns”, “idleTimeSec”, “secretResourceUrl”, “authenticationType”, “hostname”, “username”, “queryTimeoutSec”, “password”, “encryptionValidationMode”, “propertyList”, “useLegacyDialect”, “fetchSize”])
at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 533] (through reference chain: com.dremio.exec.store.jdbc.conf.PostgresConf[“scriptsEnabled”])
"
Any help regarding the exact json payload will be really helpful for me.