KServer REST API

From KeystoneIntranet
Revision as of 01:47, 7 November 2022 by Pmorey (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

The Keystone REST Server exposes a REST API which is used to obtain diagnostic information from the server.

This API is supported as of version 3.2.6.3.

See: Keystone_REST_Server_(KServer) for more on KServer.

Example URIs:

http://127.0.0.1:8211/rest/kserver/connection

KServer API

ROOT: /rest/kserver

connection

connection

tests connection with the server
{ "kserver": 
	{ "request_status":
		{ "status": "200" }
	},
	"msg": "Keystone REST Server 3.5.10.0."
}

version

version

retrieve the KServer version
"3.5.10.0"

keystoneversion

keystoneversion

retrieve the Keystone version
"3.5.10.0"

config

config

retrieve the KServer configuration parameters
{
    "config": [
        {
            "ConnRetries": "3",
            "DBPath": "t:\\ccgh\\data",
            "DBServer": "127.0.0.1",
            "DefaultPort": 8211,
            "LogEvents": "SERVER,ERROR,REQUEST,REQUESTRAW,REQUESTFULL,RESPONSE,RESPONSEFULL,QUERY,TRACE",
            "LogLevels": "30",
            "LogPath": "t:\\log",
            "LogSize": "50000",
            "MapCustomPath": "C:\\ProgramData\\GivenHansco\\Keystone\\Settings",
            "MapPath": "d:\\starteam projects\\compucrete\\kserver\\json",
            "RequestThreads": "32",
            "ServerPorts": "8211,8212",
            "UseCompression": "True"
        }
    ]
}

querystats

querystats

retrieve the KServer query statistics
{
    "querystats": [
        {
            "QueryName": "rdmARCreditTermsClass_cdsKey",
            "URI": "/rest/kWCcoapi/v1/[$COID]/rdmARCreditTermsClass/cdsKey",
            "DBName": "co",
            "QueryType": "Select",
            "RunCount": 1,
            "CacheHits": 0,
            "CacheMisses": 1,
            "TotalRunTime": 0,
            "MaxRunTime": 0,
            "MinRunTime": 0,
            "AvgRunTime": 0,
            "TotalRecordCount": 6,
            "MaxRecordCount": 6,
            "MinRecordCount": 6,
            "AvgRecordCount": 6,
            "OldestRun": "2019-07-28T16:52:22.221Z",
            "RecentRun": "2019-07-28T16:52:22.221Z"
        },
        {
            "QueryName": "rdmARCustomer_cdsKey",
            "URI": "/rest/kWCcoapi/v1/[$COID]/rdmARCustomer/cdsKey",
            "DBName": "co",
            "QueryType": "Select",
            "RunCount": 9,
            "CacheHits": 8,
            "CacheMisses": 1,
            "TotalRunTime": 0,
            "MaxRunTime": 0,
            "MinRunTime": 0,
            "AvgRunTime": 0,
            "TotalRecordCount": 26,
            "MaxRecordCount": 26,
            "MinRecordCount": 26,
            "AvgRecordCount": 26,
            "OldestRun": "2019-07-28T16:51:54.736Z",
            "RecentRun": "2019-07-28T16:53:51.778Z"
        },
        {
            "QueryName": "ContactList",
            "URI": "/rest/kOLcpapi/v1/ContactList/[custid]",
            "DBName": "co",
            "QueryType": "Select",
            "RunCount": 1,
            "CacheHits": 0,
            "CacheMisses": 1,
            "TotalRunTime": 7,
            "MaxRunTime": 7,
            "MinRunTime": 7,
            "AvgRunTime": 7,
            "TotalRecordCount": 1,
            "MaxRecordCount": 1,
            "MinRecordCount": 1,
            "AvgRecordCount": 1,
            "OldestRun": "2019-07-28T16:52:34.271Z",
            "RecentRun": "2019-07-28T16:52:34.271Z"
        },
        {
            "QueryName": "CustomerAging",
            "URI": "/rest/kOLcpapi/v1/CustomerInvoices/[contactid:integer]{/[agdatelo1:date]/[agdatelo2:date]/[agdatehi2:date]/[agdatelo3:date]/[agd",
            "DBName": "co",
            "QueryType": "Select",
            "RunCount": 2,
            "CacheHits": 0,
            "CacheMisses": 2,
            "TotalRunTime": 10,
            "MaxRunTime": 5,
            "MinRunTime": 5,
            "AvgRunTime": 5,
            "TotalRecordCount": 2,
            "MaxRecordCount": 1,
            "MinRecordCount": 1,
            "AvgRecordCount": 1,
            "OldestRun": "2019-07-28T16:51:40.616Z",
            "RecentRun": "2019-07-28T16:52:41.202Z"
        },
        {
            "QueryName": "CustomerInvoices",
            "URI": "/rest/kOLcpapi/v1/CustomerInvoices/[contactid:integer]{/[agdatelo1:date]/[agdatelo2:date]/[agdatehi2:date]/[agdatelo3:date]/[agd",
            "DBName": "co",
            "QueryType": "Select",
            "RunCount": 2,
            "CacheHits": 0,
            "CacheMisses": 2,
            "TotalRunTime": 19,
            "MaxRunTime": 10,
            "MinRunTime": 9,
            "AvgRunTime": 9,
            "TotalRecordCount": 48,
            "MaxRecordCount": 35,
            "MinRecordCount": 13,
            "AvgRecordCount": 24,
            "OldestRun": "2019-07-28T16:51:40.624Z",
            "RecentRun": "2019-07-28T16:52:41.210Z"
        },
        {
            "QueryName": "UMTotals",
            "URI": "/rest/kOLcpapi/v1/CustomerInvoices/[contactid:integer]{/[agdatelo1:date]/[agdatelo2:date]/[agdatehi2:date]/[agdatelo3:date]/[agd",
            "DBName": "co",
            "QueryType": "Select",
            "RunCount": 48,
            "CacheHits": 0,
            "CacheMisses": 48,
            "TotalRunTime": 261,
            "MaxRunTime": 29,
            "MinRunTime": 2,
            "AvgRunTime": 5,
            "TotalRecordCount": 44,
            "MaxRecordCount": 2,
            "MinRecordCount": 0,
            "AvgRecordCount": 0,
            "OldestRun": "2019-07-28T16:51:40.634Z",
            "RecentRun": "2019-07-28T16:52:41.310Z"
        },
        {
            "QueryName": "ScheduleOrders",
            "URI": "/rest/kOLcpapi/v1/ScheduleOrders/[contactid:integer]{/[begscheddt:datetime]{/[endscheddt:datetime]{/[activecarryhrs:integer]/[un",
            "DBName": "co",
            "QueryType": "Select",
            "RunCount": 2,
            "CacheHits": 0,
            "CacheMisses": 2,
            "TotalRunTime": 67,
            "MaxRunTime": 53,
            "MinRunTime": 14,
            "AvgRunTime": 33,
            "TotalRecordCount": 2,
            "MaxRecordCount": 2,
            "MinRecordCount": 0,
            "AvgRecordCount": 1,
            "OldestRun": "2019-07-28T16:53:10.827Z",
            "RecentRun": "2019-07-28T16:54:18.018Z"
        },
        {
            "QueryName": "Totals",
            "URI": "/rest/kOLcpapi/v1/ScheduleOrders/[contactid:integer]{/[begscheddt:datetime]{/[endscheddt:datetime]{/[activecarryhrs:integer]/[un",
            "DBName": "co",
            "QueryType": "Select",
            "RunCount": 2,
            "CacheHits": 0,
            "CacheMisses": 2,
            "TotalRunTime": 35,
            "MaxRunTime": 32,
            "MinRunTime": 3,
            "AvgRunTime": 17,
            "TotalRecordCount": 2,
            "MaxRecordCount": 1,
            "MinRecordCount": 1,
            "AvgRecordCount": 1,
            "OldestRun": "2019-07-28T16:53:10.880Z",
            "RecentRun": "2019-07-28T16:54:18.038Z"
        }
    ]
}

serverstats

serverstats

retrieve the KServer server statistics
{
    "serverstats": [
        {
            "StartTime": "2019-07-28T16:51:36.955Z",
            "UpTime": "18 minutes, 49 seconds",
            "MemoryAllocated": 3979080,
            "MemoryReserved": 7864224,
            "ProcessThreads": 39,
            "ProcessHandles": 408
        }
    ]
}

cachestats

cachestats

retrieve the KServer cache statistics
{
    "cachestats": [
        {
            "CacheName": "CACHE_rdmARCustomer_cdsKey",
            "Database": "IB/t:\\ccgh\\data\\ccw001.ib",
            "AccessCount": 8,
            "RecordCount": 26,
            "Created": "2019-07-28T16:51:54.752Z",
            "LastAccessed": "2019-07-28T16:53:51.778Z"
        },
        {
            "CacheName": "CACHE_rdmCCForm_cdsKey",
            "Database": "IB/t:\\ccgh\\data\\ccw001.ib",
            "AccessCount": 0,
            "RecordCount": 6,
            "Created": "2019-07-28T16:51:54.955Z",
            "LastAccessed": "1899-12-30T00:00:00.000Z"
        },
        {
            "CacheName": "CACHE_rdmARCustomerClass_cdsKey",
            "Database": "IB/t:\\ccgh\\data\\ccw001.ib",
            "AccessCount": 0,
            "RecordCount": 8,
            "Created": "2019-07-28T16:52:22.126Z",
            "LastAccessed": "1899-12-30T00:00:00.000Z"
        }
    ]
}

clearcaches

clearcaches

clear query caches for all DB connections
{}