OneDB REST API

A REST API for your OneDB database servers.
More information: https://helloreverb.com
Contact Info: hello@helloreverb.com
Version: 2.0
All rights reserved
http://apache.org/licenses/LICENSE-2.0.html

Access

  1. HTTP Basic Authentication

Methods

[ Jump to Models ]

Table of Contents

Collections

Databases

LargeObjects

SQL

ServerInfo

Tables

TimeSeries

Collections

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 Content-Type request header:

Request body

body CreateCollectionRequest (required)
Body Parameter — The create collection request
example: { "name" : "mycollection" }

Return type

TableInfo

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body DeleteRequest (required)
Body Parameter — The delete request

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type 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

TableInfo

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 Accept request header; the media type will be conveyed by the Content-Type 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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body object (required)
Body Parameter — The JSON document to insert
example: { "classid" : 5, "level" : "101", "subject" : "French 1", "department" : "Languages" }

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body LoadRequest (required)
Body Parameter — The load request

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body CollectionQueryRequest (optional)
Body Parameter — A query request
example: { "filter" : { "key" : "department", "op" : "=", "value" : "Mathematics" }, "limit" : 100, "skip" : 0, "orderBy" : [ { "key" : "classid", "direction" : "asc" } ] }

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body ReplaceRequest (required)
Body Parameter — The replace request

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body UpdateRequest (required)
Body Parameter — The update request

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The SQL response SQLResponse

Example data

Content-Type: application/json
{"n":1}

404

Collection not found

Databases

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 Content-Type request header:

Request body

body CreateDatabaseRequest (required)
Body Parameter — The create database request

Return type

DatabaseInfo

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 Accept request header; the media type will be conveyed by the Content-Type 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

DatabaseInfo

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 Accept request header; the media type will be conveyed by the Content-Type 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 Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

List of databases

Example data

Content-Type: application/json
["database1","database2","stores_demo"]

LargeObjects

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 Accept request header; the media type will be conveyed by the Content-Type 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 Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

the clob data String

SQL

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 Content-Type request header:

Request body

body SQLRequest (required)
Body Parameter — a SQL request

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

the SQL response SQLResponse

ServerInfo

Up
get /api/servers/{alias}
Get information about the OneDB database server (getServer)

Path parameters

alias (required)
Path Parameter — OneDB server alias

Return type

OneDBServer

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 Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The OneDB server info OneDBServer

404

OneDB server alias not found

Tables

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 Content-Type request header:

Request body

body CreateTableRequest (required)
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

TableInfo

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body DeleteRequest (required)
Body Parameter — The delete request

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type 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

TableInfo

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 Accept request header; the media type will be conveyed by the Content-Type 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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body object (required)
Body Parameter — The row to insert, specified as a JSON document
example: { "classid" : 5, "level" : "101", "subject" : "French 1", "department" : "Languages" }

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body LoadRequest (required)
Body Parameter — The load request

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body TableQueryRequest (optional)
Body Parameter — A query request

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body UpdateRequest (required)
Body Parameter — The update request

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The SQL response SQLResponse

Example data

Content-Type: application/json
{"n":1}

404

Table not found

TimeSeries

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 Content-Type 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

TimeseriesCalendarInfo

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

Body Parameter — The create TimeSeries table request
example: { "name" : "ts_data" }

Return type

TableInfo

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 Accept request header; the media type will be conveyed by the Content-Type 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

TableInfo

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 Accept request header; the media type will be conveyed by the Content-Type 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

DatabaseInfo

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 Accept request header; the media type will be conveyed by the Content-Type 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 Accept request header; the media type will be conveyed by the Content-Type 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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body object (required)
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

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body TimeseriesLoadRequest (required)
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

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body TableQueryRequest (optional)
Body Parameter — A query request

Return type

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type 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 Content-Type request header:

Request body

body object (required)
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

SQLResponse

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 Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The SQL response SQLResponse

Example data

Content-Type: application/json
{"n":1}

404

TimeSeries table not found

Models

[ Jump to Methods ]

Table of Contents

  1. CollectionQueryRequest
  2. ComparisonQueryFilter
  3. CreateCollectionRequest
  4. CreateDatabaseRequest
  5. CreateTableRequest
  6. CreateTimeseriesCalendarRequest
  7. CreateTimeseriesTableRequest
  8. DatabaseInfo
  9. DeleteRequest
  10. LoadRequest
  11. LogicalQueryFilter
  12. OneDBServer
  13. OrderByField
  14. ReplaceRequest
  15. SQLRequest
  16. SQLResponse
  17. TableColumn
  18. TableInfo
  19. TableQueryRequest
  20. TimeseriesAggregatePipelineStage
  21. TimeseriesAggregatePipelineStage_aggregate
  22. TimeseriesAggregatePipelineStage_aggregate_operations
  23. TimeseriesApplyPipelineStage
  24. TimeseriesApplyPipelineStage_apply
  25. TimeseriesCalendarInfo
  26. TimeseriesCalendarPattern
  27. TimeseriesCalendarPattern_intervals
  28. TimeseriesClipPipelineStage
  29. TimeseriesClipPipelineStage_clip
  30. TimeseriesLoadRequest
  31. TimeseriesQueryFilter
  32. TimeseriesQueryFilter_transform
  33. TimeseriesRollupPipelineStage
  34. TimeseriesRollupPipelineStage_rollup
  35. TimeseriesRollupPipelineStage_rollup_operations
  36. TimeseriesRunningAggregatePipelineStage
  37. TimeseriesRunningAggregatePipelineStage_running_aggregate
  38. TimeseriesRunningAggregatePipelineStage_running_aggregate_operations
  39. UpdateRequest

CollectionQueryRequest Up

fields (optional)
array[String] the list of JSON document keys to return in the query results
filter (optional)
the query filter
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)
array[OrderByField] the set of JSON document keys to order by

ComparisonQueryFilter Up

op
String the comparison operator
Enum:
=
!=
<
<=
>
>=
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.

CreateCollectionRequest Up

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.

CreateDatabaseRequest Up

name
String the name of the database
example: mydb
loggingMode (optional)
String the database logging mode
Enum:
Unbuffered log
Buffered log
ANSI
None
dbspace (optional)
String the dbspace to create the database in
example: datadbs1
locale (optional)
String the database locale
example: en_US.utf8

CreateTableRequest Up

name
String the name of the table
example: mytable
columns
array[TableColumn] the table columns
dbspace (optional)
String the dbspace to create the table in
example: datadbs1

CreateTimeseriesCalendarRequest Up

a TimeSeries calendar
name
String the name
example: ts_12hours
start
Object the start date for the calendar
example: {"$date":1577836800000}
pattern

CreateTimeseriesTableRequest Up

name
String the name of the TimeSeries table
example: ts_data
dbspace (optional)
String the dbspace to create the table in
example: datadbs1

DatabaseInfo Up

name (optional)
String the database name
owner (optional)
String the database owner
created (optional)
Object the creation timestamp
locale (optional)
String the database locale
loggingMode (optional)
String the database logging mode
Enum:
Unbuffered log
Buffered log
ANSI
None

DeleteRequest Up

filter
the filter, specified as a JSON document, that defines which rows to delete
example: {"key":"classid","op":"=","value":101}

LoadRequest Up

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"}]

LogicalQueryFilter Up

op
String the comparison operator
Enum:
and
or
filters
array[null] the list of comparison and/or logical query filters that should be combined by the defined 'op'
items oneOf: ComparisonQueryFilter    LogicalQueryFilter   

OneDBServer Up

alias (optional)
String the OneDB server alias
example: myserver
host (optional)
String hostname
example: localhost
port (optional)
Integer port format: int32
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

OrderByField Up

key
String the column name or JSON key to order by
direction (optional)
String the order by direction; allowable values: 'asc' or 'desc'
Enum:
asc
desc

ReplaceRequest Up

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}

SQLRequest Up

sql
String the SQL statement to run
example: select * from customer where age >= ? and age <= ? and state = ?
hostVariables (optional)
array[null] list of host variables
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

SQLResponse Up

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.

TableColumn Up

name
String the column name
type
String the column 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

TableInfo Up

tabid (optional)
String the table id
tabname (optional)
String the table name
owner (optional)
String the table owner
created (optional)
Object the creation timestamp
type (optional)
String the table type
Enum:
relational
collection
timeseries
system catalog
external table
view
synonym
columns (optional)
array[String] the list of column names. Not applicable for collection tables.

TableQueryRequest Up

fields (optional)
array[String] the list of column names to return in the query results
filter (optional)
the query filter
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)
array[OrderByField] the set of columns order by

TimeseriesAggregatePipelineStage Up

a TimeSeries pipeline stage to aggregate data within a TimeSeries
aggregate (optional)

TimeseriesAggregatePipelineStage_aggregate Up

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

TimeseriesAggregatePipelineStage_aggregate_operations Up

list of aggregation operations
key
String the field name to aggregate
op
String the aggregation operation
Enum:
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 &quot;NTH&quot; only, the index field indicates the postition requested for the &quot;NTH&quot; operator.

TimeseriesApplyPipelineStage Up

a TimeSeries pipeline stage to apply an arithmetic expression or function to TimeSeries data
apply (optional)

TimeseriesApplyPipelineStage_apply Up

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}

TimeseriesCalendarInfo Up

a TimeSeries calendar
name (optional)
String the calendar name
startDate (optional)
Object the start date of the calendar
patternStartDate (optional)
Object the start date of the calendar pattern
pattern (optional)

TimeseriesCalendarPattern Up

a TimeSeries calendar pattern
unit
String the time unit
Enum:
second
minute
hour
day
week
month
year
example: hour
frequency (optional)
Integer the calendar frequency (cannot be combined with &quot;intervals&quot; property)
example: 12
intervals (optional)
array[TimeseriesCalendarPattern_intervals] the calendar intervals specified as documents (cannot be combined with &quot;frequency&quot; property)
example: [{"duration":1,"type":"on"},{"duration":11,"type":"off"}]

TimeseriesCalendarPattern_intervals Up

duration
Integer the interval duration
type
String whether the interval is on or off
Enum:
on
off

TimeseriesClipPipelineStage Up

a TimeSeries pipeline stage to clip TimeSeries data within a time range
clip (optional)

TimeseriesClipPipelineStage_clip Up

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

TimeseriesLoadRequest Up

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

TimeseriesQueryFilter Up

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

TimeseriesQueryFilter_transform Up

Optional transform for the TimeSeries data. If used this will transform TimeSeries data into a single element (&quot;first&quot; or &quot;last&quot;) or into a count of matching elements (&quot;count&quot;).
op
String the transform operation
Enum:
FIRST
LAST
COUNT
allowNulls (optional)
Boolean Applicable only to &quot;LAST&quot; transform operations, can be set to false to return the last non-null value before the &quot;end&quot; timestamp.
expression (optional)
String Applicable only to &quot;COUNT&quot; transform operations, an optional expression that counts the number of TimeSeries elements that match the expression.
example: $val1 > 100

TimeseriesRollupPipelineStage Up

a TimeSeries pipeline stage to rollup and aggregate data across multiple TimeSeries objects into a single Timeseries object
rollup (optional)

TimeseriesRollupPipelineStage_rollup Up

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 &quot;groupBy&quot;.
example: ["zipcode"]

TimeseriesRollupPipelineStage_rollup_operations Up

list of aggregation operations
key
String the field name to aggregate
op
String the aggregation operation
Enum:
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

TimeseriesRunningAggregatePipelineStage Up

a TimeSeries pipeline stage to apply running aggregation functions to data within a TimeSeries
running_aggregate (optional)

TimeseriesRunningAggregatePipelineStage_running_aggregate Up

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}

TimeseriesRunningAggregatePipelineStage_running_aggregate_operations Up

list of aggregation operations
op
String the aggregation operation
Enum:
SUM
AVG
MEDIAN
CORRELATION
VARIANCE
key
String the field name to aggregate
key2 (optional)
String Applicable, to running &quot;CORRELATION&quot; 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

UpdateRequest Up

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"}