Available API's under Query Services are:
- Add Query API - 1
- Add Query API - 2 (It can be used when first API fails)
- Update Query API
- List Schema Queries API
1. Add Query API - 1
This API adds new query or updates the existing query details.
Mandatory Field: connectionId, connectionName, datasetId, datasetName, globalDomain, glossaryName, query, schemaId, schemaName, tagName.
Method | URL |
addQuery |
/api/query/add |
Request Body
{
"businessDescription": "string",
"connectionId": 0,*
"connectionName": "string",*
"customFields": {},
"datasetId": 0,
"datasetName": "string",*
"description": "string",
"globalDomain": "string",
"glossaryName": "string",
"jobType": "string",
"query": "string",*
"schemaId": 0,*
"schemaName": "string",*
"sqltype": "string",
"tagName": "string"
}
Example
{
"businessDescription": "",
"connectionId": 1000,
"connectionName": "mysql",
"customFields": {},
"datasetId": 0,
"datasetName": "DatasetFromAPI",
"description": "DatasetFromAPI",
"globalDomain": "",
"glossaryName": "",
"jobType": "SQL",
"query": "select * from tablename",
"schemaId": 1002,
"schemaName": "ovaledgedb",
"sqltype": "",
"tagName": ""
}
Response Body
{
"status": true,
"statusCode": "",
"statusMsg": "",
"response": {
"logsList": [
"Created Dataset : 40",
"Custom Object Created for Dataset :40"
]
}
}
2. Add Query API - 2
This API adds new query or updates the existing query details.
Use this API when the first API fails with CTRL CHAR Exception.
Mandatory Field: connectionId, connectionName, datasetId, datasetName, globalDomain, glossaryName, query, schemaId, schemaName, tagName.
Method | URL |
addQuery |
/api/query/addv2 |
Request Body
{
"businessDescription": "string",
"connectionId": 0,
"connectionName": "string",
"customFields": {},
"datasetId": 0,
"datasetName": "string",
"description": "string",
"globalDomain": "string",
"glossaryName": "string",
"query": "string",
"schemaId": 0,
"schemaName": "string",
"tagName": “string”
}
Example
{
"businessDescription": "",
"connectionId": 1000,
"connectionName": "mysql",
"customFields": {},
"datasetId": 0,
"datasetName": "DatasetFromAPI",
"description": "DatasetFromAPI",
"globalDomain": "",
"glossaryName": "",
"jobType": "SQL",
"query": "select * from tablename",
"schemaId": 1002,
"schemaName": "ovaledgedb",
"sqltype": "",
"tagName": ""
}
Response Body
{
"status": true,
"statusCode": "",
"statusMsg": "",
"response": {
"logsList": [
"Created Dataset : 40",
"Custom Object Created for Dataset :40"
]
}
}
3. Update Query API
This API updates the dataset info with given information like query, custom fields, description etc.
Mandatory Field: connectionId, connectionName, datasetId, datasetName, globalDomain, glossaryName, query, schemaId, schemaName, tagName.
Request Body
{
"businessDescription": "string",
"connectionId": 0,
"connectionName": "string",
"customFields": {},
"datasetId": 0,
"datasetName": "string",
"description": "string",
"globalDomain": "string",
"glossaryName": "string",
"query": "string",
"schemaId": 0,
"schemaName": "string",
"tagName": "string"
}
Example
{
"businessDescription": "string",
"connectionId": 0,
"connectionName": "ovaledgedb",
"customFields": {},
"datasetId": 220,
"datasetName": "string",
"description": "string",
"globalDomain": "string",
"glossaryName": "string",
"query": "select count(*) from oeschema",
"schemaId": 0,
"schemaName": "ovaledgedb",
"tagName": "string"
}
Response Body
{
"status": false,
"statusCode": "",
"statusMsg": "[datasetid] with id 220 doesnot match with the connection id-1",
"response": {}
}
4. List Schema Queries API
This API returns the queries created under the given schema.
Mandatory Field: schemaId.
Method | URL |
listSchemaQueries |
/api/schema/{schemaId}/queries |
Response Body
{
"status": true,
"statusCode": "",
"statusMsg": "",
"response": {
"queryList": [
{
"datasetId": 1880,
"connectionName": "mysql",
"connectionId": 1000,
"schemaName": "ovaledgedb",
"schemaId": 1002,
"datasetName": "QueryFromAPI",
"description": "QueryFromAPI",
"query": "select * from oetable",
"businessDescription": "string",
"tagName": "string",
"globalDomain": null,
"glossaryName": null,
"customFields": {}
},
{
"datasetId": 1881,
"connectionName": "mysql",
"connectionId": 1000,
"schemaName": "ovaledgedb",
"schemaId": 1002,
"datasetName": "QueryFromAPI",
"description": "QueryFromAPI",
"query": "select * from oetable",
"businessDescription": "string",
"tagName": "string",
"globalDomain": null,
"glossaryName": null,
"customFields": {}
}
]
}
}