OneDB REST API
A REST API for your OneDB database servers.
Version: 2.0
All rights reserved
http://apache.org/licenses/LICENSE-2.0.html
Access
- HTTP Basic Authentication
[ Jump to Models ]
Table of Contents
Up
post /api/servers/{alias}/databases/{dbname}/collections
Create a new collection (createCollection)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The create collection request
example: {
"name" : "mycollection"
}
Return type
Example data
Content-Type: application/json
{
"tabid" : "tabid",
"owner" : "owner",
"tabname" : "tabname",
"created" : { },
"columns" : [ "columns", "columns" ],
"type" : "relational"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
201
The collection info
TableInfo
Example data
Content-Type: application/json
{"tabid":101,"tabname":"mycollection","created":{"$date":"2021-01-01T06:00:00Z"},"owner":"onedbsa","type":"collection"}
Up
post /api/servers/{alias}/databases/{dbname}/collections/{collectionName}/delete
Delete one or more documents from the collection (deleteDocuments)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
collectionName (required)
Path Parameter — collection name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The delete request
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The SQL response
SQLResponse
Example data
Content-Type: application/json
{"n":1}
404
Collection not found
Up
delete /api/servers/{alias}/databases/{dbname}/collections/{collectionName}
Drop the collection (dropCollection)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
collectionName (required)
Path Parameter — collection name
Responses
200
The collection was dropped
404
Collection not found
Up
get /api/servers/{alias}/databases/{dbname}/collections/{collectionName}
Get collection info (getCollectionInfo)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
collectionName (required)
Path Parameter — collection name
Return type
Example data
Content-Type: application/json
{
"tabid" : "tabid",
"owner" : "owner",
"tabname" : "tabname",
"created" : { },
"columns" : [ "columns", "columns" ],
"type" : "relational"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The collection info
TableInfo
Example data
Content-Type: application/json
{"tabid":101,"tabname":"mycollection","created":{"$date":"2021-01-01T06:00:00Z"},"owner":"onedbsa","type":"collection"}
404
Collection not found
Up
get /api/servers/{alias}/databases/{dbname}/collections
Get the list of collections in a database (getCollections)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
Query parameters
useCache (optional)
Query Parameter — Use database metadata cache default: true
Return type
array[String]
Example data
Content-Type: application/json
[ "", "" ]
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
List of collections
Example data
Content-Type: application/json
["customers","orders"]
Up
post /api/servers/{alias}/databases/{dbname}/collections/{collectionName}/insert
Insert a JSON document into the collection (insertDocument)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
collectionName (required)
Path Parameter — collection name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The JSON document to insert
example: {
"classid" : 5,
"level" : "101",
"subject" : "French 1",
"department" : "Languages"
}
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The SQL response
SQLResponse
Example data
Content-Type: application/json
{"n":1}
404
Collection not found
Up
post /api/servers/{alias}/databases/{dbname}/collections/{collectionName}/load
Load a set JSON documents into the collection (loadDocuments)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
collectionName (required)
Path Parameter — collection name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The load request
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The SQL response
SQLResponse
Example data
Content-Type: application/json
{"n":4}
404
Collection not found
Up
post /api/servers/{alias}/databases/{dbname}/collections/{collectionName}/query
Query the collection (queryCollection)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
collectionName (required)
Path Parameter — collection name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — A query request
example: {
"filter" : {
"key" : "department",
"op" : "=",
"value" : "Mathematics"
},
"limit" : 100,
"skip" : 0,
"orderBy" : [ {
"key" : "classid",
"direction" : "asc"
} ]
}
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Query result
SQLResponse
404
Collection not found
Up
post /api/servers/{alias}/databases/{dbname}/collections/{collectionName}/replace
Replace one or more documents in the collection (replaceDocuments)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
collectionName (required)
Path Parameter — collection name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The replace request
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The SQL response
SQLResponse
Example data
Content-Type: application/json
{"n":1}
404
Collection not found
Up
post /api/servers/{alias}/databases/{dbname}/collections/{collectionName}/update
Update one or more documents in the collection (updateDocuments)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
collectionName (required)
Path Parameter — collection name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The update request
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The SQL response
SQLResponse
Example data
Content-Type: application/json
{"n":1}
404
Collection not found
Up
post /api/servers/{alias}/databases
Create a new database (createDatabase)
Path parameters
alias (required)
Path Parameter — OneDB server alias
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The create database request
Return type
Example data
Content-Type: application/json
{
"owner" : "owner",
"created" : { },
"name" : "name",
"loggingMode" : "Unbuffered log",
"locale" : "locale"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
201
The database info
DatabaseInfo
Example data
Content-Type: application/json
{"name":"mydb","owner":"onedbsa","created":{"$date":"2021-01-01T00:00:00Z"},"locale":"en_US.819","logMode":"Unbuffered logging"}
Up
delete /api/servers/{alias}/databases/{dbname}
Drop the database (dropDatabase)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
Responses
200
database deleted
404
Database not found
Up
get /api/servers/{alias}/databases/{dbname}
Get the database info (getDatabaseInfo)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
Return type
Example data
Content-Type: application/json
{
"owner" : "owner",
"created" : { },
"name" : "name",
"loggingMode" : "Unbuffered log",
"locale" : "locale"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The database info
DatabaseInfo
Example data
Content-Type: application/json
{"name":"mydb","owner":"onedbsa","created":{"$date":"2021-01-01T00:00:00Z"},"locale":"en_US.819","logMode":"Unbuffered logging"}
404
Database not found
Up
get /api/servers/{alias}/databases
Get the list of databases on the OneDB database server (getDatabases)
Path parameters
alias (required)
Path Parameter — OneDB server alias
Query parameters
includeSystem (optional)
Query Parameter — Include system databases default: false
useCache (optional)
Query Parameter — Use database metadata cache default: true
Return type
array[String]
Example data
Content-Type: application/json
[ "", "" ]
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
List of databases
Example data
Content-Type: application/json
["database1","database2","stores_demo"]
Up
get /api/servers/{alias}/databases/{dbname}/blobs/{lobId}
Get a blob (binary large object) value (getBlob)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
lobId (required)
Path Parameter — large object (lob) locator id
Example data
Content-Type: application/json
""
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
the blob data
Up
get /api/servers/{alias}/databases/{dbname}/clobs/{lobId}
Get a clob (character large object) value (getClob)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
lobId (required)
Path Parameter — large object (lob) locator id
Return type
String
Example data
Content-Type: application/json
""
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
the clob data
String
Up
post /api/servers/{alias}/databases/{dbname}/sql
Run a SQL statement (runSQL)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — a SQL request
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
the SQL response
SQLResponse
Up
get /api/servers/{alias}
Get information about the OneDB database server (getServer)
Path parameters
alias (required)
Path Parameter — OneDB server alias
Return type
Example data
Content-Type: application/json
{
"port" : 9088,
"host" : "localhost",
"alias" : "myserver",
"version" : "HCL OneDB Server 1.0.1.0",
"properties" : { }
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The OneDB server info
OneDBServer
404
OneDB server alias not found
Up
post /api/servers/{alias}/databases/{dbname}/tables
Create a table (createTable)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The create table request
example: {
"name" : "classes",
"columns" : [ {
"name" : "classid",
"type" : "int",
"primaryKey" : true
}, {
"name" : "level",
"type" : "int"
}, {
"name" : "subject",
"type" : "varchar(255)"
}, {
"name" : "department",
"type" : "varchar(100)"
} ]
}
Return type
Example data
Content-Type: application/json
{
"tabid" : "tabid",
"owner" : "owner",
"tabname" : "tabname",
"created" : { },
"columns" : [ "columns", "columns" ],
"type" : "relational"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
201
The table info
TableInfo
Example data
Content-Type: application/json
{"tabid":100,"tabname":"classes","owner":"onedbsa","created":{"$date":"2021-01-01T06:00:00Z"},"type":"relational","columns":[{"name":"classid","type":"integer","size":10,"nullable":false},{"name":"level","type":"integer","size":10,"nullable":true},{"name":"subject","type":"varchar","size":255,"nullable":true},{"name":"department","type":"varchar","size":100,"nullable":true}],"primaryKeyColumns":["classid"]}
Up
post /api/servers/{alias}/databases/{dbname}/tables/{tabname}/delete
Delete one or more rows from the table (deleteRows)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The delete request
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The SQL response
SQLResponse
Example data
Content-Type: application/json
{"n":1}
404
Table not found
Up
delete /api/servers/{alias}/databases/{dbname}/tables/{tabname}
Drop the table (dropTable)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Responses
200
The table was dropped
404
Table not found
Up
get /api/servers/{alias}/databases/{dbname}/tables/{tabname}
Get table info (getTableInfo)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Return type
Example data
Content-Type: application/json
{
"tabid" : "tabid",
"owner" : "owner",
"tabname" : "tabname",
"created" : { },
"columns" : [ "columns", "columns" ],
"type" : "relational"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The table info
TableInfo
Example data
Content-Type: application/json
{"tabid":101,"tabname":"mytable","owner":"onedbsa","type":"relational","columns":[{"name":"col1","type":"integer","size":10,"nullable":false},{"name":"col2","type":"varchar","size":100,"nullable":true}]}
404
Table not found
Up
get /api/servers/{alias}/databases/{dbname}/tables
Get the list of tables in a database (getTables)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
Query parameters
includeCatalogs (optional)
Query Parameter — Include system catalog tables default: false
useCache (optional)
Query Parameter — Use database metadata cache default: true
Return type
array[String]
Example data
Content-Type: application/json
[ "", "" ]
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
List of tables
Example data
Content-Type: application/json
["customers","order"]
Up
post /api/servers/{alias}/databases/{dbname}/tables/{tabname}/insert
Insert a row into the table (insertRow)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The row to insert, specified as a JSON document
example: {
"classid" : 5,
"level" : "101",
"subject" : "French 1",
"department" : "Languages"
}
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The SQL response
SQLResponse
Example data
Content-Type: application/json
{"n":1}
404
Table not found
Up
post /api/servers/{alias}/databases/{dbname}/tables/{tabname}/load
Load multiple rows into the table (loadRows)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The load request
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The SQL response
SQLResponse
Example data
Content-Type: application/json
{"n":4}
404
Table not found
Up
post /api/servers/{alias}/databases/{dbname}/tables/{tabname}/query
Query the table (queryTable)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — A query request
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Query result
SQLResponse
404
Table not found
Up
post /api/servers/{alias}/databases/{dbname}/tables/{tabname}/update
Update one or more rows in the table (updateRows)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The update request
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The SQL response
SQLResponse
Example data
Content-Type: application/json
{"n":1}
404
Table not found
Up
post /api/servers/{alias}/databases/{dbname}/timeseries/calendars
Create a new TimeseriesCalendar (createTimeSeriesCalendar)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The create TimeSeries calendar request
example: {
"name" : "ts_12hours",
"start" : {
"$date" : 1609502400000
},
"pattern" : {
"unit" : "hour",
"frequency" : 12
}
}
Return type
Example data
Content-Type: application/json
{
"name" : "ts_1min",
"startDate" : {
"$date" : "2011-01-01T06:00:00Z"
},
"patternStartDate" : {
"$date" : "2011-01-01T06:00:00Z"
},
"pattern" : {
"intervals" : [ {
"duration" : 1,
"type" : "on"
} ],
"unit" : "minute"
}
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
201
The calendar info
TimeseriesCalendarInfo
Example data
Content-Type: application/json
{"name":"ts_12hours","startDate":{"$date":"2021-01-01T06:00:00Z"},"patternStartDate":{"$date":"2021-01-01T06:00:00Z"},"pattern":{"intervals":[{"duration":1,"type":"on"},{"duration":11,"type":"off"}],"unit":"hour"}}
Up
post /api/servers/{alias}/databases/{dbname}/timeseries/tables
Create a BSON TimeSeries table (createTimeseriesTable)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The create TimeSeries table request
example: {
"name" : "ts_data"
}
Return type
Example data
Content-Type: application/json
{
"tabid" : "tabid",
"owner" : "owner",
"tabname" : "tabname",
"created" : { },
"columns" : [ "columns", "columns" ],
"type" : "relational"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
201
The TimeSeries table info
TableInfo
Example data
Content-Type: application/json
{"tabid":101,"tabname":"ts_data","owner":"onedbsa","created":{"$date":"2021-01-01T06:00:00Z"},"type":"timeseries","columns":[{"name":"id","type":"bigserial","size":19,"nullable":false},{"name":"data","type":"timeseries(generic_bson_t)","size":2048,"nullable":false,"typeSchema":[{"name":"timestamp","type":"datetime year to fraction(5)"},{"name":"payload","type":"bson"}]},{"name":"properties","type":"bson","size":4096,"nullable":true}],"primaryKeyColumns":["id"]}
Up
delete /api/servers/{alias}/databases/{dbname}/timeseries/calendars/{calendarName}
Delete the calendar (deleteTimeseriesCalendar)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
calendarName (required)
Path Parameter — calendar name
Responses
200
Calendar deleted
404
Calendar not found
Up
delete /api/servers/{alias}/databases/{dbname}/timeseries/tables/{tabname}
Drop the TimeSeries table (dropTimeseriesTable)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Responses
200
The TimeSeries table was dropped
404
TimeSeries table not found
Up
get /api/servers/{alias}/databases/{dbname}/timeseries/tables/{tabname}
Get TimeSeries table info (getTimeSeriesTableInfo)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Return type
Example data
Content-Type: application/json
{
"tabid" : "tabid",
"owner" : "owner",
"tabname" : "tabname",
"created" : { },
"columns" : [ "columns", "columns" ],
"type" : "relational"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The table info
TableInfo
Example data
Content-Type: application/json
{"tabid":101,"tabname":"ts_data","owner":"onedbsa","created":{"$date":"2021-01-01T06:00:00Z"},"type":"timeseries","columns":[{"name":"id","type":"bigserial","size":19,"nullable":false},{"name":"data","type":"timeseries(generic_bson_t)","size":2048,"nullable":false,"typeSchema":[{"name":"timestamp","type":"datetime year to fraction(5)"},{"name":"payload","type":"bson"}]},{"name":"properties","type":"bson","size":4096,"nullable":true}],"primaryKeyColumns":["id"]}
404
TimeSeries table not found
Up
get /api/servers/{alias}/databases/{dbname}/timeseries/calendars/{calendarName}
Get the calendar info (getTimeseriesCalendarInfo)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
calendarName (required)
Path Parameter — calendar name
Return type
Example data
Content-Type: application/json
{
"owner" : "owner",
"created" : { },
"name" : "name",
"loggingMode" : "Unbuffered log",
"locale" : "locale"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The calendar info
DatabaseInfo
Example data
Content-Type: application/json
{"name":"ts_1min","startDate":{"$date":"2011-01-01T06:00:00Z"},"patternStartDate":{"$date":"2011-01-01T06:00:00Z"},"pattern":{"intervals":[{"duration":1,"type":"on"}],"unit":"minute"}}
404
Calendar not found
Up
get /api/servers/{alias}/databases/{dbname}/timeseries/calendars
Get the list of TimeSeries calendars in the database (getTimeseriesCalendars)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
Query parameters
useCache (optional)
Query Parameter — Use database metadata cache default: true
Return type
array[String]
Example data
Content-Type: application/json
[ "", "" ]
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
List of calendars
Example data
Content-Type: application/json
["ts_1min","ts_15min","ts_1hour"]
Up
get /api/servers/{alias}/databases/{dbname}/timeseries/tables
Get the list of TimeSeries tables in a database (getTimeseriesTables)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
Return type
array[String]
Example data
Content-Type: application/json
[ "", "" ]
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
List of TimeSeries tables
Example data
Content-Type: application/json
["meters","facilities"]
Up
post /api/servers/{alias}/databases/{dbname}/timeseries/tables/{tabname}/insert
Insert an element into the TimeSeries (insertTimeseries)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The data to insert, specified as a JSON document. The JSON document must contain the key/value pairs that represent the identifying columns in the base TimeSeries table, in addition to the JSON document that represents the TimeSeries element.
example: {
"id" : 101,
"data" : {
"timestamp" : "2021-01-01 12:00:00.000",
"payload" : {
"value" : 115.3
}
}
}
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The SQL response
SQLResponse
Example data
Content-Type: application/json
{"n":1}
404
TimeSeries table not found
Up
post /api/servers/{alias}/databases/{dbname}/timeseries/tables/{tabname}/load
Load elements into the TimeSeries (loadTimeseries)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The TimeSeries load request
example: {
"data" : [ {
"id" : 101,
"timestamp" : "2021-01-01 12:01:00.000",
"payload" : {
"value" : 115.3
}
}, {
"id" : 101,
"timestamp" : "2021-01-01 12:02:00.000",
"payload" : {
"value" : 117.1
}
}, {
"id" : 101,
"timestamp" : "2021-01-01 12:03:00.000",
"payload" : {
"value" : 116.9
}
}, {
"id" : 102,
"timestamp" : "2021-01-01 12:01:00.000",
"payload" : {
"value" : 129.1
}
}, {
"id" : 102,
"timestamp" : "2021-01-01 12:02:00.000",
"payload" : {
"value" : 129.2
}
}, {
"id" : 103,
"timestamp" : "2021-01-01 12:01:00.000",
"payload" : {
"value" : 127.3
}
} ]
}
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The SQL response
SQLResponse
Example data
Content-Type: application/json
{"n":10}
404
TimeSeries table not found
Up
post /api/servers/{alias}/databases/{dbname}/timeseries/tables/{tabname}/query
Query the TimeSeries table (queryTimeseriesTable)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — A query request
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Query result
SQLResponse
404
TimeSeries table not found
Up
post /api/servers/{alias}/databases/{dbname}/timeseries/tables/{tabname}/update
Update an element in the TimeSeries (updateTimeseries)
Path parameters
alias (required)
Path Parameter — OneDB server alias
dbname (required)
Path Parameter — database name
tabname (required)
Path Parameter — table name
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — The data to update, specified as a JSON document. The JSON document must contain the key/value pairs that represent the identifying columns in the base TimeSeries table, in addition to the JSON document that represents the TimeSeries element to update.
example: {
"id" : 101,
"data" : {
"timestamp" : "2021-01-01 12:01:00.000",
"payload" : {
"value" : 116.1
}
}
}
Return type
Example data
Content-Type: application/json
{
"warn" : [ "warn", "warn" ],
"responseTime" : 6,
"hasMore" : true,
"results" : [ { }, { } ],
"n" : 0
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
The SQL response
SQLResponse
Example data
Content-Type: application/json
{"n":1}
404
TimeSeries table not found
[ Jump to Methods ]
Table of Contents
CollectionQueryRequest
ComparisonQueryFilter
CreateCollectionRequest
CreateDatabaseRequest
CreateTableRequest
CreateTimeseriesCalendarRequest
CreateTimeseriesTableRequest
DatabaseInfo
DeleteRequest
LoadRequest
LogicalQueryFilter
OneDBServer
OrderByField
ReplaceRequest
SQLRequest
SQLResponse
TableColumn
TableInfo
TableQueryRequest
TimeseriesAggregatePipelineStage
TimeseriesAggregatePipelineStage_aggregate
TimeseriesAggregatePipelineStage_aggregate_operations
TimeseriesApplyPipelineStage
TimeseriesApplyPipelineStage_apply
TimeseriesCalendarInfo
TimeseriesCalendarPattern
TimeseriesCalendarPattern_intervals
TimeseriesClipPipelineStage
TimeseriesClipPipelineStage_clip
TimeseriesLoadRequest
TimeseriesQueryFilter
TimeseriesQueryFilter_transform
TimeseriesRollupPipelineStage
TimeseriesRollupPipelineStage_rollup
TimeseriesRollupPipelineStage_rollup_operations
TimeseriesRunningAggregatePipelineStage
TimeseriesRunningAggregatePipelineStage_running_aggregate
TimeseriesRunningAggregatePipelineStage_running_aggregate_operations
UpdateRequest
fields (optional)
array[String] the list of JSON document keys to return in the query results
filter (optional)
limit (optional)
Integer the maximum number of rows to return from a SQL query, -1 indicates to return all rows format: int32
example: 100
skip (optional)
Integer the number of rows to skip format: int32
orderBy (optional)
op
String the comparison operator
=
!=
<
<=
>
>=
IN
NOT IN
key
String the column name or collection document key to compare against
value
the value for the comparison
oneOf:
function (optional)
String optional. This is an advanced property that can be set for collection tables to specify the bson function that is used to extract the value from the JSON/BSON document. This property only applies to collection tables.
name
String the name of the collection
example: mycollection
dbspace (optional)
String the dbspace to create the collection in
example: datadbs1
indexIdField (optional)
Boolean indicates whether a unique index should automatically be created on the _id field
idIndexFunction (optional)
String optional. This is an advanced property that can be set to specify the bson function used to index the _id field.
name
String the name of the database
example: mydb
loggingMode (optional)
String the database logging mode
Unbuffered log
Buffered log
ANSI
None
dbspace (optional)
String the dbspace to create the database in
example: datadbs1
locale (optional)
example: en_US.utf8
name
example: mytable
columns
dbspace (optional)
String the dbspace to create the table in
example: datadbs1
a TimeSeries calendar
name
example: ts_12hours
start
Object the start date for the calendar
example: {"$date":1577836800000}
pattern
name
String the name of the TimeSeries table
example: ts_data
dbspace (optional)
String the dbspace to create the table in
example: datadbs1
name (optional)
owner (optional)
created (optional)
locale (optional)
loggingMode (optional)
String the database logging mode
Unbuffered log
Buffered log
ANSI
None
filter
the filter, specified as a JSON document, that defines which rows to delete
example: {"key":"classid","op":"=","value":101}
data
array[Object] the data to load, specified as a list of JSON documents
example: [{"classid":6,"level":"101","subject":"Algebra 1","department":"Mathematics"},{"classid":7,"level":"102","subject":"Algebra 2","department":"Mathematics"},{"classid":8,"level":"110","subject":"Geometry","department":"Mathematics"},{"classid":9,"level":"111","subject":"Trigonometry","department":"Mathematics"}]
op
String the comparison operator
and
or
filters
array[null] the list of comparison and/or logical query filters that should be combined by the defined 'op'
alias (optional)
example: myserver
host (optional)
example: localhost
port (optional)
example: 9088
properties (optional)
Object additional JDBC connection properties
example: {}
version (optional)
String the OneDB server version
example: HCL OneDB Server 1.0.1.0
key
String the column name or JSON key to order by
direction (optional)
String the order by direction; allowable values: 'asc' or 'desc'
asc
desc
filter
the filter, specified as a JSON document, that defines which documents to replace
example: {"key":"classid","op":"=","value":5}
newDocument
Object the new document that will replace the original
example: {"classid":5,"level":101,"subject":"French 1","status":"FULL","capacity":30}
sql
String the SQL statement to run
example: select * from customer where age >= ? and age <= ? and state = ?
hostVariables (optional)
example: [21,35,"CA"]
items oneOf:
limit (optional)
Integer the maximum number of rows to return from a SQL query, -1 indicates to return all rows format: int32
example: 100
skip (optional)
Integer the number of rows to skip format: int32
timeseriesLimit (optional)
Integer the maximum number of elements in a TimeSeries to return from a SQL query, -1 indicates to return all TimeSeries elements format: int32
example: 100
timeseriesSkip (optional)
Integer the number of Timeseries elements to skip format: int32
results (optional)
array[Object] for SQL queries, the rows returned by the query, with each row specified as a JSON document
hasMore (optional)
Boolean for SQL queries, a boolean indicating whether more rows were returned by the query by the limit
n (optional)
Integer for DML statements, the number of rows updated or affected by the SQL statement format: int32
responseTime (optional)
Long the response time in milliseconds format: int64
warn (optional)
array[String] a list of SQL warnings that occurred during the execution of the SQL statement. This field is only present if one or more SQL warnings occurred.
name
type
nullable (optional)
Boolean whether the column should allow null values
primaryKey (optional)
Boolean whether the column is one of the primary keys for the table
tabid (optional)
tabname (optional)
owner (optional)
created (optional)
type (optional)
relational
collection
timeseries
system catalog
external table
view
synonym
columns (optional)
array[String] the list of column names. Not applicable for collection tables.
fields (optional)
array[String] the list of column names to return in the query results
filter (optional)
timeseriesFilter (optional)
limit (optional)
Integer the maximum number of rows to return from a SQL query, -1 indicates to return all rows format: int32
example: 100
skip (optional)
Integer the number of rows to skip format: int32
orderBy (optional)
a TimeSeries pipeline stage to aggregate data within a TimeSeries
operations
calendar
the calendar that defines the frequency over which to aggregate TimeSeries data, specified either as a string (the name of an existing calendar) or a document that defines the calendar pattern as a frequency or a set of intervals
example: ts_1hour
start (optional)
Object the beginning timestamp (inclusive) of the TimeSeries data to aggregate
example: {"$date":1577836800000}
end (optional)
Object the ending timestamp (inclusive) of the TimeSeries data to aggregate
example: {"$date":1580515199000}
flags (optional)
Integer TimeSeries flags argument. See https://help.hcltechsw.com/onedb/1.0.0.1/tms/ids_tms_137.html
list of aggregation operations
key
String the field name to aggregate
op
String the aggregation operation
AVG
SUM
MEDIAN
MIN
MAX
FIRST
LAST
NTH
outKey (optional)
String the field name to assign to the result of the aggregation operation
outType (optional)
String the data type of the result of the aggregation operation
index (optional)
Integer Applicable for "NTH" only, the index field indicates the postition requested for the "NTH" operator.
a TimeSeries pipeline stage to apply an arithmetic expression or function to TimeSeries data
expression
String the SQL expression or function to apply to the TimeSeries. See https://help.hcltechsw.com/onedb/1.0.0.1/tms/ids_tms_143.html
example: $val1 + $val2, ($val3 + $val5)/ 2
cast
String the datatype to cast the results of the apply function to
example: timeseries(row(timestamp datetime year to fraction(5), sum int, avg float))
start (optional)
Object the beginning timestamp (inclusive) of the TimeSeries data to aggregate
example: {"$date":1577836800000}
end (optional)
Object the ending timestamp (inclusive) of the TimeSeries data to aggregate
example: {"$date":1580515199000}
a TimeSeries calendar
name (optional)
startDate (optional)
Object the start date of the calendar
patternStartDate (optional)
Object the start date of the calendar pattern
pattern (optional)
a TimeSeries calendar pattern
unit
second
minute
hour
day
week
month
year
example: hour
frequency (optional)
Integer the calendar frequency (cannot be combined with "intervals" property)
example: 12
intervals (optional)
example: [{"duration":1,"type":"on"},{"duration":11,"type":"off"}]
duration
type
String whether the interval is on or off
on
off
a TimeSeries pipeline stage to clip TimeSeries data within a time range
start (optional)
Object the beginning timestamp (inclusive) of the TimeSeries data range
example: {"$date":1577836800000}
end (optional)
Object the ending timestamp (inclusive) of the TimeSeries data range
example: {"$date":1580515199000}
flags (optional)
Integer TimeSeries flags argument. See https://help.hcltechsw.com/onedb/1.0.0.1/tms/ids_tms_137.html
data
array[Object] the data to load, specified as a list of JSON documents
field (optional)
String the name of the TimeSeries column to load the data into. Optional if there is only one TimeSeries column in the table. Required if there are multiple TimeSeries columns.
example: data
doFlush (optional)
Boolean whether to flush data to database server immediately after the load
Query filter for TimeSeries data. Only supported on tables with one or more TimeSeries columns.
field (optional)
String the name of the TimeSeries column to query. Optional if there is only one TimeSeries column in the table. Required if there are multiple TimeSeries columns.
example: data
pipeline (optional)
array[null] Optional query pipeline for the TimeSeries data. Multiple stages operations can be specified in the array to chain TimeSeries query pipeline stages together.
transform (optional)
start (optional)
Object the beginning timestamp (inclusive) when querying for TimeSeries data within a date range
example: {"$date":1577836800000}
end (optional)
Object the ending timestamp (inclusive) when querying for TimeSeries data within a date range
example: {"$date":1580515199000}
limit (optional)
Integer the maximum number of elements from the TimeSeries to return, -1 indicates to return all elements in the TimeSeries format: int32
example: 100
skip (optional)
Integer the number of TimeSeries elements to skip format: int32
Optional transform for the TimeSeries data. If used this will transform TimeSeries data into a single element ("first" or "last") or into a count of matching elements ("count").
op
String the transform operation
FIRST
LAST
COUNT
allowNulls (optional)
Boolean Applicable only to "LAST" transform operations, can be set to false to return the last non-null value before the "end" timestamp.
expression (optional)
String Applicable only to "COUNT" transform operations, an optional expression that counts the number of TimeSeries elements that match the expression.
example: $val1 > 100
a TimeSeries pipeline stage to rollup and aggregate data across multiple TimeSeries objects into a single Timeseries object
operations
groupBy
array[String] The list of fields to group by when aggregating across multiple TimeSeries objects. To aggregate over all TimeSeries object in a table, provide an empty list as the "groupBy".
example: ["zipcode"]
list of aggregation operations
key
String the field name to aggregate
op
String the aggregation operation
AVG
SUM
COUNT
MIN
MAX
FIRST
LAST
outKey (optional)
String the field name to assign to the result of the aggregation operation
outType (optional)
String the data type of the result of the aggregation operation
a TimeSeries pipeline stage to apply running aggregation functions to data within a TimeSeries
running_aggregate (optional)
operations
start (optional)
Object the beginning timestamp (inclusive) of the TimeSeries data to aggregate
example: {"$date":1577836800000}
end (optional)
Object the ending timestamp (inclusive) of the TimeSeries data to aggregate
example: {"$date":1580515199000}
list of aggregation operations
op
String the aggregation operation
SUM
AVG
MEDIAN
CORRELATION
VARIANCE
key
String the field name to aggregate
key2 (optional)
String Applicable, to running "CORRELATION" operations only; the second field name to correlate
n
Integer the number of values to use to compute the running aggregation
outKey (optional)
String the field name to assign to the result of the aggregation operation
outType (optional)
String the data type of the result of the aggregation operation
filter
the filter, specified as a JSON document, that defines which rows to update
example: {"key":"classid","op":"=","value":5}
updates
Object the updates, specified as a JSON document, that indicate which fields/columns to update in the matching rows
example: {"level":101,"subject":"French 1"}