API

REST API

API endpoints require basic authentication with user that has “rest” role.

Test suites

API endpoint: /api/v1/testsuites
Type: POST
Description: Returns test suite info with results
Parameters: names
Example body:

{"names": ["crm", "rfam"]}

Result:

[
    {
        "id": 4,
        "name": "CRM",
        "owner": "John",
        "lastExecBy": "System",
        "execTime": "2022-01-21 09:00:28",
        "execEndTime": "2022-01-21 09:01:39",
        "duration": "71",
        "nextExecutionTime": "2022-01-22 09:00:00",
        "schedule": "Daily / 09:00",
        "passed": 217,
        "failed": 24,
        "error": 29,
        "notExecuted": 0,
        "testCount": 270
    },
    {
        "id": 5,
        "name": "Rfam",
        "owner": "John",
        "lastExecBy": "System",
        "execTime": "2022-01-21 09:40:30",
        "execEndTime": "2022-01-21 09:43:33",
        "duration": "183",
        "nextExecutionTime": "2022-01-22 04:00:00",
        "schedule": "Daily / 04:00",
        "passed": 101,
        "failed": 16,
        "error": 1,
        "notExecuted": 0,
        "testCount": 118
    }
]

Execute

API endpoint: /api/v1/testsuites/execute
Type: POST
Description: Executes test suite and returns results
Parameters: name
Example body:

{"name": "bike_store"}

Result:

{
    "id": 10,
    "name": "Bike_store",
    "owner": "admin",
    "lastExecBy": "REST",
    "execTime": "2022-01-21 10:42:26",
    "execEndTime": "2022-01-21 10:42:26",
    "duration": "0",
    "nextExecutionTime": "2022-01-21 16:21:00",
    "schedule": "Daily / 16:21",
    "passed": 37,
    "failed": 0,
    "error": 0,
    "notExecuted": 0,
    "testCount": 37
}

All

API endpoint: /api/v1/testsuites/all
Type: GET
Description: Returns test suite info with results for all test suites
Parameters: none
Result:

[
    {
        "id": 27,
        "name": " Robot_tests",
        "owner": "admin",
        "lastExecBy": "admin",
        "execTime": "2021-12-13 19:04:35",
        "execEndTime": "2021-12-13 19:04:36",
        "duration": "1",
        "nextExecutionTime": "2022-01-21 12:00:00",
        "schedule": "Workdays / 12:00",
        "passed": 16,
        "failed": 0,
        "error": 1,
        "notExecuted": 0,
        "testCount": 17
    },
    {
        "id": 18,
        "name": " Ticket_sales",
        "owner": "admin",
        "lastExecBy": "admin",
        "execTime": "2022-01-21 09:55:05",
        "execEndTime": "2022-01-21 09:55:07",
        "duration": "2",
        "nextExecutionTime": "",
        "schedule": "",
        "passed": 16,
        "failed": 1,
        "error": 0,
        "notExecuted": 0,
        "testCount": 17
    },
  ...
]

Public

API endpoint: /api/v1/testsuites/public
Type: GET
Description: Returns test suite info with results for public test suites
Parameters: none
Result:

[
    {
        "id": 27,
        "name": " Robot_tests",
        "owner": "admin",
        "lastExecBy": "admin",
        "execTime": "2021-12-13 19:04:35",
        "execEndTime": "2021-12-13 19:04:36",
        "duration": "1",
        "nextExecutionTime": "2022-01-21 12:00:00",
        "schedule": "Workdays / 12:00",
        "passed": 16,
        "failed": 0,
        "error": 1,
        "notExecuted": 0,
        "testCount": 17
    },
    {
        "id": 9,
        "name": "Classic_models",
        "owner": "admin",
        "lastExecBy": "System",
        "execTime": "2022-01-21 09:39:30",
        "execEndTime": "2022-01-21 09:40:14",
        "duration": "44",
        "nextExecutionTime": "2022-01-22 00:40:14",
        "schedule": "Every 900 minutes",
        "passed": 29,
        "failed": 4,
        "error": 0,
        "notExecuted": 0,
        "testCount": 33
    },
  ...
]

User

API endpoint: /api/v1/testsuites/user
Type: POST
Description: Returns test suite info with results for users test suites
Parameters: names
Example body:

{"names": ["admin", "John"]}

Result:

[
    {
        "id": 27,
        "name": " Robot_tests",
        "owner": "admin",
        "lastExecBy": "admin",
        "execTime": "2021-12-13 19:04:35",
        "execEndTime": "2021-12-13 19:04:36",
        "duration": "1",
        "nextExecutionTime": "2022-01-21 12:00:00",
        "schedule": "Workdays / 12:00",
        "passed": 16,
        "failed": 0,
        "error": 1,
        "notExecuted": 0,
        "testCount": 17
    },
    {
        "id": 18,
        "name": " Ticket_sales",
        "owner": "admin",
        "lastExecBy": "admin",
        "execTime": "2022-01-21 09:55:05",
        "execEndTime": "2022-01-21 09:55:07",
        "duration": "2",
        "nextExecutionTime": "",
        "schedule": "",
        "passed": 16,
        "failed": 1,
        "error": 0,
        "notExecuted": 0,
        "testCount": 17
    },
  ...
]

Tag

API endpoint: /api/v1/testsuites/tag
Type: POST
Description: Returns test suite info with results for tag(s)
Parameters: names
Example body:

{"names": ["live", "aws"]}

Result:

[
    {
        "id": 10,
        "name": "Bike_store",
        "owner": "admin",
        "lastExecBy": "REST",
        "execTime": "2022-01-21 10:42:26",
        "execEndTime": "2022-01-21 10:42:26",
        "duration": "0",
        "nextExecutionTime": "2022-01-21 16:21:00",
        "schedule": "Daily / 16:21",
        "passed": 37,
        "failed": 0,
        "error": 0,
        "notExecuted": 0,
        "testCount": 37
    },
    {
        "id": 11,
        "name": "Music_data",
        "owner": "John",
        "lastExecBy": "System",
        "execTime": "2022-01-17 12:02:26",
        "execEndTime": "2022-01-17 12:02:35",
        "duration": "9",
        "nextExecutionTime": "2022-01-24 10:00:00",
        "schedule": "Mondays / 10:00",
        "passed": 107,
        "failed": 24,
        "error": 26,
        "notExecuted": 0,
        "testCount": 157
    },
  ...
]

Test cases

Test suite

API endpoint: /api/v1/testcases/testsuite
Type: POST
Description: Returns test cases for test suite(s)
Parameters: names
Example body:

{"names": ["covid", "rfam"]}

Result:

[
    {
        "testSuiteName": "Covid",
        "connectionName": "Covid endpoint",
        "description": "Covid infections in Estonia",
        "sql": "SELECT Confirmed FROM <object> WHERE date > current_date-1\n",
        "expectedResult": ">0",
        "lastResult": "271500.0",
        "lastExecution": "2022-01-20 12:00:47",
        "status": "nok",
        "executedBy": "System",
        "owner": "John",
        "type": "Query"
    },
    {
        "testSuiteName": "Rfam",
        "connectionName": "Rfam_public",
        "description": "Rfam._annotated_file - Count of rows",
        "sql": "SELECT COUNT(*) FROM Rfam._annotated_file",
        "expectedResult": ">0",
        "lastResult": "4074",
        "lastExecution": "2022-01-21 09:40:31",
        "status": "ok",
        "executedBy": "System",
        "owner": "John",
        "type": "Query"
    },
    {
        "testSuiteName": "Rfam",
        "connectionName": "Rfam_public",
        "description": "Rfam._annotated_file - Full duplicates",
        "sql": "SELECT COUNT(*) FROM (SELECT rfam_acc,seed,cm,full FROM Rfam._annotated_file GROUP BY rfam_acc,seed,cm,full HAVING COUNT(*)>1) a",
        "expectedResult": "=0",
        "lastResult": "0",
        "lastExecution": "2022-01-21 09:40:31",
        "status": "ok",
        "executedBy": "System",
        "owner": "John",
        "type": "Query"
    },
  ...
]

Profiling

Execute

API endpoint: /api/v1/profiling/execute
Type: POST
Description: Executes profiling objects and returns results
Parameters: objects
Example body:

{"objects": 
 [
   {"object":"rfam.family", "connection": "rfam_public"}, 
   {"object":"rfam.version", "connection": "rfam_public"}
 ]
}

Result:

[
    {
        "connectionName": "Rfam_public",
        "schemaName": "Rfam",
        "objectName": "family",
        "lastExecuted": "2022-01-21 10:48:39",
        "nextExecution": "2022-01-22 10:00:00",
        "schedule": "Daily / 10:00",
        "filter": "author is not null",
        "allowedErrors": 0,
        "columns": [
            {
                "columnName": "author",
                "dataType": "tinytext",
                "rules": [
                    {
                        "ruleDescription": "Count of NULLs",
                        "lastResult": "0",
                        "previousResult": "0",
                        "status": "ok",
                        "lastExecuted": "2022-01-21 10:48:35",
                        "threshold": 0.0
                    },
                    {
                        "ruleDescription": "Count of unique values",
                        "lastResult": "140",
                        "previousResult": "140",
                        "status": "ok",
                        "lastExecuted": "2022-01-21 10:48:38",
                        "threshold": 5.0
                    }
                ],
                "values": [
                    {
                        "columnValue": "Griffiths-Jones SR",
                        "valueCount": 1301,
                        "status": "ok"
                    },
                    {
                        "columnValue": "Eberhardt R",
                        "valueCount": 513,
                        "status": "ok"
                    },
                  ...
]

Objects

API endpoint: /api/v1/profiling/objects
Type: POST
Description: Returns profiling object results
Parameters: objects
Example body:

{"objects": 
 [
   {"object":"rfam.family", "connection": "rfam_public"}, 
   {"object":"rfam.version", "connection": "rfam_public"}
 ]
}

Result:

[
    {
        "connectionName": "Rfam_public",
        "schemaName": "Rfam",
        "objectName": "family",
        "lastExecuted": "2022-01-21 10:48:39",
        "nextExecution": "2022-01-22 10:00:00",
        "schedule": "Daily / 10:00",
        "filter": "author is not null",
        "allowedErrors": 0,
        "columns": [
            {
                "columnName": "author",
                "dataType": "tinytext",
                "rules": [
                    {
                        "ruleDescription": "Count of NULLs",
                        "lastResult": "0",
                        "previousResult": "0",
                        "status": "ok",
                        "lastExecuted": "2022-01-21 10:48:35",
                        "threshold": 0.0
                    },
                    {
                        "ruleDescription": "Count of unique values",
                        "lastResult": "140",
                        "previousResult": "140",
                        "status": "ok",
                        "lastExecuted": "2022-01-21 10:48:38",
                        "threshold": 5.0
                    }
                ],
                "values": [
                    {
                        "columnValue": "Griffiths-Jones SR",
                        "valueCount": 1301,
                        "status": "ok"
                    },
                    {
                        "columnValue": "Eberhardt R",
                        "valueCount": 513,
                        "status": "ok"
                    },
                  ...
]

Connections

Status

API endpoint: /api/v1/connections/status
Type: GET
Description: Returns connection info and status for all connections
Parameters: none
Result:

[
    {
        "connectionName": "Crypto",
        "connectionType": "rest",
        "connected": true,
        "connectionUrl": "https://api.coinlore.net/api/tickers/?start=1&limit=1000"
    },
    {
        "connectionName": "Genome_public",
        "connectionType": "mariadb",
        "connected": true,
        "connectionUrl": "jdbc:mariadb://genome-euro-mysql.soe.ucsc.edu:3306/hgcentral"
    },
    {
        "connectionName": "RNAcentral_public",
        "connectionType": "postgresql",
        "connected": true,
        "connectionUrl": "jdbc:postgresql://hh-pgsql-public.ebi.ac.uk:5432/pfmegrnargs"
    },
    {
        "connectionName": "Rfam_public",
        "connectionType": "mysql",
        "connected": true,
        "connectionUrl": "jdbc:mysql://mysql-rfam-public.ebi.ac.uk:4497/Rfam"
    },
    {
        "connectionName": "SAPIQ",
        "connectionType": "sapiq",
        "connected": false,
        "connectionUrl": "jdbc:sybase:Tds:dev.litech.app:2638?ServiceName=dba"
    },
  ...
]

Executions

Current

API endpoint: /api/v1/executions/current
Type: GET
Description: Returns all currently running executions
Parameters: none
Result:

[
    {
        "user": "admin",
        "executedTests": "68",
        "totalTests": "211",
        "progress": "68/211",
        "executionName": "Rfam.family"
    },
    {
        "user": "System",
        "executedTests": "51",
        "totalTests": "270",
        "progress": "51/270",
        "executionName": "RNAcentral"
    }
]

Scheduled

API endpoint: /api/v1/executions/scheduled
Type: GET
Description: Returns info about scheduled executions
Parameters: none
Result:

[
    {
        "executionName": "RNAcentral",
        "nextExecutionTime": "2022-01-21 09:00:00",
        "timeLeft": "In queue",
        "schedule": "Daily / 09:00",
        "currentTime": "2022-01-21 10:31:56",
        "type": "ts"
    },
    {
        "executionName": "Rfam.full_region",
        "nextExecutionTime": "2022-01-21 11:00:00",
        "timeLeft": "0h 28m 03s",
        "schedule": "Daily / 11:00",
        "currentTime": "2022-01-21 10:31:56",
        "type": "object"
    },
    {
        "executionName": "Crypto",
        "nextExecutionTime": "2022-01-21 11:19:31",
        "timeLeft": "0h 47m 34s",
        "schedule": "Every 100 minutes",
        "currentTime": "2022-01-21 10:31:56",
        "type": "ts"
    }
]