Download OpenAPI specification:Download
Welcome to the Timeplus Enterprise REST API specification.
Get the version information of all Timeplus components. If any component is not available, the version
of the component will be unknown
. If timeplusd is not available, the status code will be 503
.
{- "axion": {
- "build_time": "2023-09-05T14:06:20Z",
- "commit": "02b8e47e",
- "feature_flags": {
- "property1": null,
- "property2": null
}, - "version": "string"
}, - "neutron": {
- "build_time": "2023-09-05T14:06:20Z",
- "commit": "02b8e47e",
- "feature_flags": {
- "property1": null,
- "property2": null
}, - "version": "string"
}, - "orbit": {
- "build_time": "2023-09-05T14:06:20Z",
- "commit": "02b8e47e",
- "feature_flags": {
- "property1": null,
- "property2": null
}, - "version": "string"
}, - "product_name": "string",
- "product_version": "string",
- "proton": {
- "build_time": "2023-09-05T14:06:20Z",
- "commit": "02b8e47e",
- "feature_flags": {
- "property1": null,
- "property2": null
}, - "version": "string"
}
}
[- {
- "action": "string",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "string",
- "id": "string",
- "instance": {
- "id": "string",
- "status": "trigger",
- "timeline": [
- {
- "timestamp": 0,
- "type": "trigger"
}
]
}, - "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "string",
- "properties": {
- "property1": null,
- "property2": null
}, - "resolve_query": {
- "analysis": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "ad-hoc streaming query",
- "duration": 10,
- "end_time": 1689809152,
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "test_query",
- "response_time": 1,
- "result": {
- "header": [
- {
- "name": "string",
- "type": "string"
}
]
}, - "sinks": {
- "property1": {
- "failure_count": 0,
- "success_count": 0
}, - "property2": {
- "failure_count": 0,
- "success_count": 0
}
}, - "sql": "select * from iot",
- "start_time": 1689809142,
- "status": "running",
- "tags": [
- "string"
], - "timeColumns": {
- "eventTime": 0,
- "windowEnd": 0,
- "windowStart": 0
}
}, - "resolve_sql": "string",
- "severity": 0,
- "status": "running",
- "trigger_query": {
- "analysis": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "ad-hoc streaming query",
- "duration": 10,
- "end_time": 1689809152,
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "test_query",
- "response_time": 1,
- "result": {
- "header": [
- {
- "name": "string",
- "type": "string"
}
]
}, - "sinks": {
- "property1": {
- "failure_count": 0,
- "success_count": 0
}, - "property2": {
- "failure_count": 0,
- "success_count": 0
}
}, - "sql": "select * from iot",
- "start_time": 1689809142,
- "status": "running",
- "tags": [
- "string"
], - "timeColumns": {
- "eventTime": 0,
- "windowEnd": 0,
- "windowStart": 0
}
}, - "trigger_sql": "string"
}
]
Create an alert. Please refer to the documentation of alert for more details.
create alert request parameters
action required | string Sink template - the following properties are used to create the sink One action can be map to a sink |
description | string |
name required | string |
object Detailed properties to create the sink | |
resolve_sql | string |
severity required | integer |
trigger_sql required | string Persistent query template - the following properties are used to create the persistent query |
{- "action": "string",
- "description": "string",
- "name": "string",
- "properties": {
- "property1": null,
- "property2": null
}, - "resolve_sql": "string",
- "severity": 0,
- "trigger_sql": "string"
}
{- "action": "string",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "string",
- "id": "string",
- "instance": {
- "id": "string",
- "status": "trigger",
- "timeline": [
- {
- "timestamp": 0,
- "type": "trigger"
}
]
}, - "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "string",
- "properties": {
- "property1": null,
- "property2": null
}, - "resolve_query": {
- "analysis": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "ad-hoc streaming query",
- "duration": 10,
- "end_time": 1689809152,
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "test_query",
- "response_time": 1,
- "result": {
- "header": [
- {
- "name": "string",
- "type": "string"
}
]
}, - "sinks": {
- "property1": {
- "failure_count": 0,
- "success_count": 0
}, - "property2": {
- "failure_count": 0,
- "success_count": 0
}
}, - "sql": "select * from iot",
- "start_time": 1689809142,
- "status": "running",
- "tags": [
- "string"
], - "timeColumns": {
- "eventTime": 0,
- "windowEnd": 0,
- "windowStart": 0
}
}, - "resolve_sql": "string",
- "severity": 0,
- "status": "running",
- "trigger_query": {
- "analysis": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "ad-hoc streaming query",
- "duration": 10,
- "end_time": 1689809152,
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "test_query",
- "response_time": 1,
- "result": {
- "header": [
- {
- "name": "string",
- "type": "string"
}
]
}, - "sinks": {
- "property1": {
- "failure_count": 0,
- "success_count": 0
}, - "property2": {
- "failure_count": 0,
- "success_count": 0
}
}, - "sql": "select * from iot",
- "start_time": 1689809142,
- "status": "running",
- "tags": [
- "string"
], - "timeColumns": {
- "eventTime": 0,
- "windowEnd": 0,
- "windowStart": 0
}
}, - "trigger_sql": "string"
}
Get an alert with the given ID.
id required | string alert ID |
{- "action": "string",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "string",
- "id": "string",
- "instance": {
- "id": "string",
- "status": "trigger",
- "timeline": [
- {
- "timestamp": 0,
- "type": "trigger"
}
]
}, - "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "string",
- "properties": {
- "property1": null,
- "property2": null
}, - "resolve_query": {
- "analysis": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "ad-hoc streaming query",
- "duration": 10,
- "end_time": 1689809152,
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "test_query",
- "response_time": 1,
- "result": {
- "header": [
- {
- "name": "string",
- "type": "string"
}
]
}, - "sinks": {
- "property1": {
- "failure_count": 0,
- "success_count": 0
}, - "property2": {
- "failure_count": 0,
- "success_count": 0
}
}, - "sql": "select * from iot",
- "start_time": 1689809142,
- "status": "running",
- "tags": [
- "string"
], - "timeColumns": {
- "eventTime": 0,
- "windowEnd": 0,
- "windowStart": 0
}
}, - "resolve_sql": "string",
- "severity": 0,
- "status": "running",
- "trigger_query": {
- "analysis": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "ad-hoc streaming query",
- "duration": 10,
- "end_time": 1689809152,
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "test_query",
- "response_time": 1,
- "result": {
- "header": [
- {
- "name": "string",
- "type": "string"
}
]
}, - "sinks": {
- "property1": {
- "failure_count": 0,
- "success_count": 0
}, - "property2": {
- "failure_count": 0,
- "success_count": 0
}
}, - "sql": "select * from iot",
- "start_time": 1689809142,
- "status": "running",
- "tags": [
- "string"
], - "timeColumns": {
- "eventTime": 0,
- "windowEnd": 0,
- "windowStart": 0
}
}, - "trigger_sql": "string"
}
Update the specific alert with the given ID.
id required | string alert ID |
update alert request parameters
action required | string Sink template - the following properties are used to create the sink One action can be map to a sink |
description | string |
name required | string |
object Detailed properties to create the sink | |
resolve_sql | string |
severity required | integer |
trigger_sql required | string Persistent query template - the following properties are used to create the persistent query |
{- "action": "string",
- "description": "string",
- "name": "string",
- "properties": {
- "property1": null,
- "property2": null
}, - "resolve_sql": "string",
- "severity": 0,
- "trigger_sql": "string"
}
{- "action": "string",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "string",
- "id": "string",
- "instance": {
- "id": "string",
- "status": "trigger",
- "timeline": [
- {
- "timestamp": 0,
- "type": "trigger"
}
]
}, - "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "string",
- "properties": {
- "property1": null,
- "property2": null
}, - "resolve_query": {
- "analysis": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "ad-hoc streaming query",
- "duration": 10,
- "end_time": 1689809152,
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "test_query",
- "response_time": 1,
- "result": {
- "header": [
- {
- "name": "string",
- "type": "string"
}
]
}, - "sinks": {
- "property1": {
- "failure_count": 0,
- "success_count": 0
}, - "property2": {
- "failure_count": 0,
- "success_count": 0
}
}, - "sql": "select * from iot",
- "start_time": 1689809142,
- "status": "running",
- "tags": [
- "string"
], - "timeColumns": {
- "eventTime": 0,
- "windowEnd": 0,
- "windowStart": 0
}
}, - "resolve_sql": "string",
- "severity": 0,
- "status": "running",
- "trigger_query": {
- "analysis": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "ad-hoc streaming query",
- "duration": 10,
- "end_time": 1689809152,
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "test_query",
- "response_time": 1,
- "result": {
- "header": [
- {
- "name": "string",
- "type": "string"
}
]
}, - "sinks": {
- "property1": {
- "failure_count": 0,
- "success_count": 0
}, - "property2": {
- "failure_count": 0,
- "success_count": 0
}
}, - "sql": "select * from iot",
- "start_time": 1689809142,
- "status": "running",
- "tags": [
- "string"
], - "timeColumns": {
- "eventTime": 0,
- "windowEnd": 0,
- "windowStart": 0
}
}, - "trigger_sql": "string"
}
Manually resolve a triggered alert so that it can be triggered again by the trigger event in the future.
id required | string alert ID |
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}
Start the alert with the given ID. If the alert is already running, the API does nothing and returns 204.
id required | string Alert ID |
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}
[- {
- "advertised_host": "timeplusd-2",
- "boot_timestamp": 1741887424000,
- "cpu_usage": 0.1598745451,
- "id": 1,
- "roles": [
- "Metadata",
- "Data"
], - "state": "Online",
- "timestamp": 1741888424000,
- "total_mvs": 10,
- "total_shards": 20
}
]
Get topology graph of all existings resources in a specific database.
db | string database |
extraResources | Array of strings supported resource type: |
{- "dependencies": [
- {
- "source": "string",
- "target": "string"
}
], - "edges": [
- {
- "source": "string",
- "target": "string"
}
], - "nodes": [
- {
- "db": "string",
- "id": "string",
- "name": "string",
- "ownership": {
- "id": "bob-id",
- "name": "Bob"
}, - "properties": {
- "property1": null,
- "property2": null
}, - "type": "string"
}
]
}
[- {
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "string",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "string",
- "panels": [
- {
- "description": "string",
- "id": "string",
- "position": {
- "property1": null,
- "property2": null
}, - "title": "string",
- "viz_config": {
- "property1": null,
- "property2": null
}, - "viz_content": "string",
- "viz_type": "string"
}
]
}
]
Create a dashboard.
dashboard request parameters
description | string |
name required | string |
Array of objects (dashboard.Panel) |
{- "description": "string",
- "name": "string",
- "panels": [
- {
- "description": "string",
- "id": "string",
- "position": {
- "property1": null,
- "property2": null
}, - "title": "string",
- "viz_config": {
- "property1": null,
- "property2": null
}, - "viz_content": "string",
- "viz_type": "string"
}
]
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "string",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "string",
- "panels": [
- {
- "description": "string",
- "id": "string",
- "position": {
- "property1": null,
- "property2": null
}, - "title": "string",
- "viz_config": {
- "property1": null,
- "property2": null
}, - "viz_content": "string",
- "viz_type": "string"
}
]
}
get a dashboard.
id required | string dashboard ID |
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "string",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "string",
- "panels": [
- {
- "description": "string",
- "id": "string",
- "position": {
- "property1": null,
- "property2": null
}, - "title": "string",
- "viz_config": {
- "property1": null,
- "property2": null
}, - "viz_content": "string",
- "viz_type": "string"
}
]
}
Update the specific dashboard with the given ID.
id required | string dashboard ID |
update dashboard request parameters
description | string |
name required | string |
Array of objects (dashboard.Panel) |
{- "description": "string",
- "name": "string",
- "panels": [
- {
- "description": "string",
- "id": "string",
- "position": {
- "property1": null,
- "property2": null
}, - "title": "string",
- "viz_config": {
- "property1": null,
- "property2": null
}, - "viz_content": "string",
- "viz_type": "string"
}
]
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "string",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "string",
- "panels": [
- {
- "description": "string",
- "id": "string",
- "position": {
- "property1": null,
- "property2": null
}, - "title": "string",
- "viz_config": {
- "property1": null,
- "property2": null
}, - "viz_content": "string",
- "viz_type": "string"
}
]
}
Get all dictionaries.
db | string database |
[- {
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "string",
- "query": "string"
}
]
Get the dictionary with the given name.
name required | string dictionary name |
db | string database |
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "string",
- "query": "string"
}
Execute a historical query or DDL. The client is responsible for specifying type of the query. If the SQL is not determinstic or it is a streaming query, please please consider using queries
endpoint.
type
is ddl
and it is executed successfully, it will return 204 No Content
.type
is historical
it is executed successfully, please refer to response 200
exec request parameters
sql required | string |
timeout_ms | integer default to 30000ms (30s) |
type required | string Enum: "historical" "ddl" Type of the sql
|
{- "sql": "string",
- "timeout_ms": 5000,
- "type": "historical"
}
{- "columns": [
- {
- "name": "string",
- "type": "string"
}
], - "data": [
- [
- null
]
]
}
Format the given query and make it easy to read.
the query SQL to be formatted
sql | string |
{- "sql": "string"
}
{- "sql": "string"
}
Get all queries.
tag | string filter by tag |
[- {
- "analysis": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "ad-hoc streaming query",
- "duration": 10,
- "end_time": 1689809152,
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "test_query",
- "response_time": 1,
- "result": {
- "header": [
- {
- "name": "string",
- "type": "string"
}
]
}, - "sinks": {
- "property1": {
- "failure_count": 0,
- "success_count": 0
}, - "property2": {
- "failure_count": 0,
- "success_count": 0
}
}, - "sql": "select * from iot",
- "start_time": 1689809142,
- "status": "running",
- "tags": [
- "string"
], - "timeColumns": {
- "eventTime": 0,
- "windowEnd": 0,
- "windowStart": 0
}
}
]
Execute a query and return the results. The client can submit any query type and the server will dynamically detect the query type and handle it differently.
This endpoint should be used if the SQL is not deterministic. For example, the end users can type any SQL they want. If the SQL is deterministic, please consider using exec
endpoint.
204 No Content
.application/json
. Please refer to the failure codes in Responses section below.text/event-stream
and the result will be streamed back to the client via this SSE channel.application/json
. Please refer to the failure codes in Responses section below.For SSE There are 3 types of data that will be sent to SSE channel
query
): The first event of the result will ALWAYS be this type.metrics
): The query metrics in JSON. They will be sent every 1 seconds."inf"
, "-inf"
, "nan"
query request parameters
object Controls how often a batch of results will be flushed via SSE channel | |
description | string |
name | string |
sql required | string |
tags | Array of strings |
type | string Enum: "historical" "ddl" "streaming" |
{- "batching_policy": {
- "count": 0,
- "time_ms": 0
}, - "description": "string",
- "name": "string",
- "sql": "string",
- "tags": [
- "string"
], - "type": "historical"
}
{- "analysis": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "ad-hoc streaming query",
- "duration": 10,
- "end_time": 1689809152,
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "test_query",
- "response_time": 1,
- "result": {
- "header": [
- {
- "name": "string",
- "type": "string"
}
]
}, - "sinks": {
- "property1": {
- "failure_count": 0,
- "success_count": 0
}, - "property2": {
- "failure_count": 0,
- "success_count": 0
}
}, - "sql": "select * from iot",
- "start_time": 1689809142,
- "status": "running",
- "tags": [
- "string"
], - "timeColumns": {
- "eventTime": 0,
- "windowEnd": 0,
- "windowStart": 0
}
}
Get the query with the given ID.
id required | string query ID |
{- "analysis": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "ad-hoc streaming query",
- "duration": 10,
- "end_time": 1689809152,
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "test_query",
- "response_time": 1,
- "result": {
- "header": [
- {
- "name": "string",
- "type": "string"
}
]
}, - "sinks": {
- "property1": {
- "failure_count": 0,
- "success_count": 0
}, - "property2": {
- "failure_count": 0,
- "success_count": 0
}
}, - "sql": "select * from iot",
- "start_time": 1689809142,
- "status": "running",
- "tags": [
- "string"
], - "timeColumns": {
- "eventTime": 0,
- "windowEnd": 0,
- "windowStart": 0
}
}
Cancel the query with the given ID. If given query is not running, the request will do nothing. Otherwise, the query will be canceled and the status
will be set to canceled
id required | string query ID |
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}
get the pipeline for a query
id required | string query ID |
{- "edges": [
- {
- "from": 0,
- "to": 0
}
], - "nodes": [
- {
- "id": 0,
- "metric": {
- "processed_bytes": 0,
- "processing_time_ns": 0
}, - "name": "string",
- "status": "string"
}
]
}
analyze sql
sql request parameters
sql | string |
{- "sql": "string"
}
{- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}
Get all external streams.
db | string database |
[- {
- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "comment": "string",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "create_query": "CREATE STREAM test_external_stream('str' string) ENGINE=ExternalStream SETTINGS type='kafka'",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my test stream",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "test_external_stream",
- "settings": [
- {
- "key": "string",
- "value": "string"
}
], - "type": "string"
}
]
Delete the external stream with the given name.
name required | string external stream name |
db | string database |
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}
Get the external stream with the given name.
name required | string external stream name |
db | string database |
{- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "comment": "string",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "create_query": "CREATE STREAM test_external_stream('str' string) ENGINE=ExternalStream SETTINGS type='kafka'",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my test stream",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "test_external_stream",
- "settings": [
- {
- "key": "string",
- "value": "string"
}
], - "type": "string"
}
Get the stats of an external stream with the given name.
name required | string external stream name |
db | string database |
historyDays | integer number of days of the history metrics, must be >= 1 and <= 7 if set |
{- "history": [
- {
- "read_bps": 0,
- "read_eps": 0,
- "start_time": "string",
- "written_bps": 0,
- "written_eps": 0
}
], - "read_bps": 0,
- "read_eps": 0,
- "written_bps": 0,
- "written_eps": 0
}
Preview an external stream. If the data format is JSONEachRow
, the response event will be a JSON object. If it is other type such as Protobuf, the response event will only
contain one raw
field, which is the raw bytes of the event.
db | string database |
preview external stream request parameters
count | integer Number of preview events. Defaulted to 1 |
offset | string Enum: "earliest" "latest" Preview from the earliest or latest offset of the stream. Defaulted to latest |
required | Array of objects (StreamSetting) |
timeout | integer Preview timeout in seconds. Defaulted to 60 |
{- "count": 1,
- "offset": "latest",
- "settings": [
- {
- "key": "string",
- "value": "string"
}
], - "timeout": 60
}
[- {
- "property1": null,
- "property2": null
}
]
Get all external tables.
db | string database |
[- {
- "create_query": "CREATE EXTERNAL TABLE test_external_table SETTINGS type='mysql'",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my test table",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "test_external_table",
- "settings": [
- {
- "key": "string",
- "value": "string"
}
], - "type": "string"
}
]
Delete the external table with the given name.
name required | string external table name |
db | string database |
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}
Get the external table with the given name.
name required | string external table name |
db | string database |
{- "create_query": "CREATE EXTERNAL TABLE test_external_table SETTINGS type='mysql'",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my test table",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "test_external_table",
- "settings": [
- {
- "key": "string",
- "value": "string"
}
], - "type": "string"
}
[- {
- "created_by": "timeplus_user",
- "entitlements": [
- {
- "code": "string",
- "created": "string",
- "metadata": {
- "property1": null,
- "property2": null
}, - "updated": "string"
}
], - "expiry": "string",
- "is_trial": true,
- "issued": "string"
}
]
upload and create a license.
key required | string encryption key for license file |
file required | string <binary> license file |
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}
create a trial license and start to use Timeplus
start trial parameters
allowTrack | boolean |
password | string |
userEmail | string |
userName | string |
{- "allowTrack": true,
- "password": "string",
- "userEmail": "string",
- "userName": "string"
}
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}
get license validation result. Note: The validation results will be available after the license has been active for at least 4 hours.
[- {
- "validated_at": "string",
- "validations": [
- {
- "actual": "string",
- "message": "string",
- "status": "string",
- "type": "string",
- "value": "string"
}
]
}
]
Get all materialize view.
expand | boolean whether the response should include optional metrics ( |
db | string database |
[- {
- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "comment": "string",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "create_query": "CREATE MATERIALIZED VIEW my_view AS select * from car_live_data where speed_kmh > 100",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "description for my_view",
- "lagging": 50,
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "logstore_retention_bytes": 10737418240,
- "logstore_retention_ms": 604800000,
- "memory": 1048576,
- "name": "my_view",
- "query": "select * from car_live_data where speed_kmh > 100",
- "status": "Materialized view is not running on any node",
- "status_code": 0,
- "status_ts": 1737411240123,
- "target_stream": "high_speed_cars",
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 7 DAY"
}
]
Delete the materialized view with the given name.
name required | string MaterializedView name |
db | string database |
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}
Get a materialize view with the given name.
name required | string MaterializedView name |
db | string database |
{- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "comment": "string",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "create_query": "CREATE MATERIALIZED VIEW my_view AS select * from car_live_data where speed_kmh > 100",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "description for my_view",
- "lagging": 50,
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "logstore_retention_bytes": 10737418240,
- "logstore_retention_ms": 604800000,
- "memory": 1048576,
- "name": "my_view",
- "query": "select * from car_live_data where speed_kmh > 100",
- "status": "Materialized view is not running on any node",
- "status_code": 0,
- "status_ts": 1737411240123,
- "target_stream": "high_speed_cars",
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 7 DAY"
}
Get the stats of a materialize view with the given name.
name required | string MaterializedView name |
db | string database |
historyDays | integer number of days of the history metrics, must be >= 1 and <= 7 if set |
granularity | string granularity of the history metrics, default is 10m. Examples: [1m, 10m, 1h, 1d] |
{- "earliest_event": "2023-02-01T01:02:03.456Z",
- "historical_data_bytes": 234567,
- "history": [
- {
- "read_bps": 0,
- "read_eps": 0,
- "start_time": "string",
- "written_bps": 0,
- "written_eps": 0
}
], - "lagging": 50,
- "latest_event": "2023-02-13T07:08:09.012Z",
- "memory": 1048576,
- "nodes": [
- {
- "checkpoint_size": 14680064,
- "historical_data_bytes": 234567,
- "lagging_status": {
- "property1": {
- "ckpt_sn": 102,
- "end_sn": 101,
- "processed_record_ts": 1737486069000,
- "processed_sn": 100
}, - "property2": {
- "ckpt_sn": 102,
- "end_sn": 101,
- "processed_record_ts": 1737486069000,
- "processed_sn": 100
}
}, - "last_error_message": "string",
- "last_error_message_ts": 1737411240123,
- "memory": 4,
- "node_id": 1,
- "replication_status": {
- "property1": {
- "property1": null,
- "property2": null
}, - "property2": {
- "property1": null,
- "property2": null
}
}, - "status": "ExecutingPipeline",
- "status_ts": 0,
- "streaming_data_bytes": 12345
}
], - "read_bps": 0,
- "read_eps": 0,
- "row_count": 20,
- "status": "Materialized view is not running on any node",
- "status_code": 0,
- "status_ts": 1737411240123,
- "streaming_data_bytes": 12345,
- "written_bps": 0,
- "written_eps": 0
}
create a user.
create user request parameters
password required | string |
role | string Enum: "admin" "read_only" |
username required | string |
{- "password": "qwekjds45",
- "role": "admin",
- "username": "myname"
}
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}
update a user.
update user request parameters
password | string |
role | string Enum: "admin" "read_only" |
{- "password": "qwekjds45",
- "role": "admin"
}
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}
[- {
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "get the latest data from iot stream",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "streaming_iot",
- "sql": "select * from iot",
- "tags": [
- "string"
]
}
]
Create a new saved query.
saved query parameters
description | string |
name required | string |
sql required | string |
tags | Array of strings |
{- "description": "string",
- "name": "string",
- "sql": "string",
- "tags": [
- "string"
]
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "get the latest data from iot stream",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "streaming_iot",
- "sql": "select * from iot",
- "tags": [
- "string"
]
}
Get a saved query.
id required | string saved query ID |
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "get the latest data from iot stream",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "streaming_iot",
- "sql": "select * from iot",
- "tags": [
- "string"
]
}
Update the specific saved query with the given ID.
id required | string saved query ID |
update saved query request parameters
description | string |
name required | string |
sql required | string |
tags | Array of strings |
{- "description": "string",
- "name": "string",
- "sql": "string",
- "tags": [
- "string"
]
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "get the latest data from iot stream",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "streaming_iot",
- "sql": "select * from iot",
- "tags": [
- "string"
]
}
[- {
- "content": "",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "my_schema",
- "type": "Protobuf"
}
]
get schema with the given name.
name required | string schema name |
{- "content": "",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "my_schema",
- "type": "Protobuf"
}
[- {
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "write data to http endpoint",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "write_to_http",
- "plan": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "properties": {
- "property1": null,
- "property2": null
}, - "query": "select * from car_live_data where speed_kmh > 100",
- "status": "running",
- "type": "http"
}
]
Create a sink. Please refer to the documentation of sink for more details.
http
slack
create sink request parameters
description | string |
name required | string Sink name should only contain a maximum of 64 letters, numbers, or _, and start with a letter |
object Additional properties that required to write the data to the sink (e.g. broker url). Please refer to the documentation for this sink type | |
query required | string |
type required | string Available types: [ |
{- "description": "write data to http endpoint",
- "name": "write_to_http",
- "properties": {
- "property1": null,
- "property2": null
}, - "query": "select * from car_live_data where speed_kmh > 100",
- "type": "http"
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "write data to http endpoint",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "write_to_http",
- "plan": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "properties": {
- "property1": null,
- "property2": null
}, - "query": "select * from car_live_data where speed_kmh > 100",
- "status": "running",
- "type": "http"
}
Get a sink with the given ID.
id required | string sink ID |
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "write data to http endpoint",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "write_to_http",
- "plan": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "properties": {
- "property1": null,
- "property2": null
}, - "query": "select * from car_live_data where speed_kmh > 100",
- "status": "running",
- "type": "http"
}
patch the specific sink with the given ID. The pipeline will be restarted and the checkpoint will be kept.
id required | string sink ID |
patch sink request parameters
description | string |
name | string |
object |
{- "description": "string",
- "name": "string",
- "properties": {
- "property1": null,
- "property2": null
}
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "write data to http endpoint",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "write_to_http",
- "plan": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "properties": {
- "property1": null,
- "property2": null
}, - "query": "select * from car_live_data where speed_kmh > 100",
- "status": "running",
- "type": "http"
}
Update the specific sink with the given ID.
id required | string sink ID |
update sink request parameters
description | string |
name required | string Sink name should only contain a maximum of 64 letters, numbers, or _, and start with a letter |
object Additional properties that required to write the data to the sink (e.g. broker url). Please refer to the documentation for this sink type | |
query required | string |
type required | string Available types: [ |
{- "description": "write data to http endpoint",
- "name": "write_to_http",
- "properties": {
- "property1": null,
- "property2": null
}, - "query": "select * from car_live_data where speed_kmh > 100",
- "type": "http"
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "write data to http endpoint",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "write_to_http",
- "plan": {
- "group_by_columns": [
- "string"
], - "has_aggr": true,
- "has_subquery": true,
- "has_table_join": true,
- "has_union": true,
- "is_streaming": true,
- "original_query": "string",
- "query_type": "string",
- "required_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "result_columns": [
- {
- "column": "string",
- "column_type": "string",
- "database": "string",
- "is_view": true,
- "table": "string"
}
], - "rewritten_query": "string"
}, - "properties": {
- "property1": null,
- "property2": null
}, - "query": "select * from car_live_data where speed_kmh > 100",
- "status": "running",
- "type": "http"
}
Get the stats of a sink with the given id.
id required | string sink ID |
error_log_time_range required | string Example: error_log_time_range=1d |
metrics_time_range required | string Example: metrics_time_range=10m |
{- "earliest_event": "2023-02-01T01:02:03.456Z",
- "errors": [
- {
- "message": "failed to convert data",
- "time": "2023-06-26T21:40:00Z"
}
], - "failure_count": 1,
- "historical_data_bytes": 234567,
- "history": [
- {
- "read_bps": 0,
- "read_eps": 0,
- "start_time": "string",
- "written_bps": 0,
- "written_eps": 0
}
], - "lagging": 50,
- "latest_event": "2023-02-13T07:08:09.012Z",
- "memory": 1048576,
- "nodes": [
- {
- "checkpoint_size": 14680064,
- "historical_data_bytes": 234567,
- "lagging_status": {
- "property1": {
- "ckpt_sn": 102,
- "end_sn": 101,
- "processed_record_ts": 1737486069000,
- "processed_sn": 100
}, - "property2": {
- "ckpt_sn": 102,
- "end_sn": 101,
- "processed_record_ts": 1737486069000,
- "processed_sn": 100
}
}, - "last_error_message": "string",
- "last_error_message_ts": 1737411240123,
- "memory": 4,
- "node_id": 1,
- "replication_status": {
- "property1": {
- "property1": null,
- "property2": null
}, - "property2": {
- "property1": null,
- "property2": null
}
}, - "status": "ExecutingPipeline",
- "status_ts": 0,
- "streaming_data_bytes": 12345
}
], - "read_bps": 0,
- "read_eps": 0,
- "row_count": 20,
- "status": "Materialized view is not running on any node",
- "status_code": 0,
- "status_ts": 1737411240123,
- "streaming_data_bytes": 12345,
- "success_count": 99,
- "throughput": [
- {
- "time": "2023-06-26T21:40:00Z",
- "value": 25000
}
], - "uptime": 60000,
- "written_bps": 0,
- "written_eps": 0
}
Stop the sink with the given ID from sending out data. The underlying materialized view will be paused.
id required | string sink ID |
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}
Get sample events from the source with the given ID. Please refer to create source for more details regarding type
and properties
.
source properties for preview
object See | |
size | integer Number of preview events, works together with |
timeout | string Indicates how long should preview last to fetch the desired amount of data indicated by |
type required | string See |
{- "properties": {
- "property1": null,
- "property2": null
}, - "size": 1,
- "timeout": "1m",
- "type": "websocket"
}
[- {
- "property1": null,
- "property2": null
}
]
[- {
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "read data from a websocket endpoint",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "my_websocket_source",
- "properties": {
- "property1": null,
- "property2": null
}, - "start_time": 1680301788,
- "status": "running",
- "stream": "websocket_stream",
- "type": "websocket"
}
]
Create a source. Please refer to the documentation of source for more details.
stream_generator
websocket
nats
nats_jetstream
create source request parameters
description | string |
name required | string Source name should only contain a maximum of 64 letters, numbers, or _, and start with a letter |
object Additional properties that required to read the data from source (e.g. broker url). Please refer to the documentation for this source type | |
stream required | string The name of the target stream that this source writes to. The stream needs to be created first. |
type required | string Available types: [ |
{- "description": "read from my first source",
- "name": "my_first_source",
- "properties": {
- "property1": null,
- "property2": null
}, - "stream": "dest_stream",
- "type": "websocket"
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "read data from a websocket endpoint",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "my_websocket_source",
- "properties": {
- "property1": null,
- "property2": null
}, - "start_time": 1680301788,
- "status": "running",
- "stream": "websocket_stream",
- "type": "websocket"
}
Get a source with the given ID.
id required | string source ID |
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "read data from a websocket endpoint",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "my_websocket_source",
- "properties": {
- "property1": null,
- "property2": null
}, - "start_time": 1680301788,
- "status": "running",
- "stream": "websocket_stream",
- "type": "websocket"
}
patch the specific source with the given ID. Only stopped sources can be updated.
id required | string source ID |
patch source request parameters
description | string |
name | string |
object | |
stream | string |
{- "description": "new description for the source",
- "name": "new_source_name",
- "properties": {
- "property1": null,
- "property2": null
}, - "stream": "new_stream"
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "read data from a websocket endpoint",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "my_websocket_source",
- "properties": {
- "property1": null,
- "property2": null
}, - "start_time": 1680301788,
- "status": "running",
- "stream": "websocket_stream",
- "type": "websocket"
}
Update the specific source with the given ID. Only stopped sources can be updated.
id required | string source ID |
update source request parameters
description | string |
name | string Source name should only contain a maximum of 64 letters, numbers, or _, and start with a letter |
object Additional properties that required to read the data from source (e.g. broker url). Please refer to the documentation for this source type | |
stream | string The name of the target stream that this source writes to. The stream needs to be created first. |
{- "description": "new description for the source",
- "name": "new_source_name",
- "properties": {
- "property1": null,
- "property2": null
}, - "stream": "new_stream"
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "read data from a websocket endpoint",
- "id": "string",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "my_websocket_source",
- "properties": {
- "property1": null,
- "property2": null
}, - "start_time": 1680301788,
- "status": "running",
- "stream": "websocket_stream",
- "type": "websocket"
}
Get the stats of a source with the given id.
id required | string source ID |
error_log_time_range required | string Example: error_log_time_range=1d |
metrics_time_range required | string Example: metrics_time_range=10m |
{- "errors": [
- {
- "message": "failed to convert data",
- "time": "2023-06-26T21:40:00Z"
}
], - "failure_count": 1,
- "success_count": 99,
- "throughput": [
- {
- "time": "2023-06-26T21:40:00Z",
- "value": 25000
}
], - "uptime": 60000
}
Get all streams.
expand | boolean whether the response should include optional metrics ( |
db | string database |
[- {
- "column_families": [
- {
- "columns": [
- "string"
], - "name": "basic_info"
}
], - "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "comment": "string",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "create_query": "CREATE STREAM test_stream('str' string) ENGINE=Stream(1,1,rand())",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my test stream",
- "engine": "Stream",
- "historical_data_bytes": 234567,
- "is_external": false,
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "logstore_retention_bytes": 1073741824,
- "logstore_retention_ms": 86400000,
- "mode": "append",
- "name": "test_stream",
- "primary_key": "string",
- "row_count": 1000,
- "secondary_indexes": [
- {
- "columns": [
- "string"
], - "name": "basic_info",
- "storing": [
- "string"
], - "unique": true
}
], - "streaming_data_bytes": 12345,
- "ttl": "to_datetime(_tp_time) + INTERVAL 7 DAY",
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 7 DAY"
}
]
Get a stream with the given name.
name required | string stream name |
db | string database |
{- "column_families": [
- {
- "columns": [
- "string"
], - "name": "basic_info"
}
], - "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "comment": "string",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "create_query": "CREATE STREAM test_stream('str' string) ENGINE=Stream(1,1,rand())",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my test stream",
- "engine": "Stream",
- "historical_data_bytes": 234567,
- "is_external": false,
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "logstore_retention_bytes": 1073741824,
- "logstore_retention_ms": 86400000,
- "mode": "append",
- "name": "test_stream",
- "primary_key": "string",
- "row_count": 1000,
- "secondary_indexes": [
- {
- "columns": [
- "string"
], - "name": "basic_info",
- "storing": [
- "string"
], - "unique": true
}
], - "streaming_data_bytes": 12345,
- "ttl": "to_datetime(_tp_time) + INTERVAL 7 DAY",
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 7 DAY"
}
Ingest data to a stream with the given name. For formats are supported:
Content-Type
is set to one of application/json
, application/json;format=compact
, application/vnd.timeplus+json
, application/vnd.timeplus+json;format=compat
, or set format
query parameter with value compact
. And this is the API's default format.Content-Type
is set to one of application/json;format=streaming
, application/vnd.timeplus+json;format=streaming
, or set format
query parameter with value streaming
.Content-Type
is set to one of text/plain
, text/plain;format=raw
, or set format
query parameter with value raw
.Content-Type
is set to text/plain;format=lines
, or set format
query parameter with value lines
.name required | string stream name |
db | string database |
format | string Enum: "compact" "streaming" "raw" "lines" enfoce payload format, if it is set, it overwrite the Content-Type header |
ingest data
columns required | Array of strings |
data required | Array of any[ items ] |
{- "columns": [
- "string"
], - "data": [
- [
- null
]
]
}
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}
Get the stats of a stream with the given name.
name required | string stream name |
db | string database |
historyDays | integer number of days of the history metrics, must be >= 1 and <= 7 if set |
granularity | string granularity of the history metrics, default is 10m. Examples: [1m, 10m, 1h, 1d] |
{- "earliest_event": "2023-02-01T01:02:03.456Z",
- "historical_data_bytes": 234567,
- "history": [
- {
- "read_bps": 0,
- "read_eps": 0,
- "start_time": "string",
- "written_bps": 0,
- "written_eps": 0
}
], - "latest_event": "2023-02-13T07:08:09.012Z",
- "nodes": [
- {
- "historical_data_bytes": 234567,
- "lagging_status": {
- "property1": {
- "applied_sn": 100,
- "committed_sn": 101,
- "timestamp": 0
}, - "property2": {
- "applied_sn": 100,
- "committed_sn": 101,
- "timestamp": 0
}
}, - "node_id": 1,
- "replication_status": {
- "property1": {
- "property1": null,
- "property2": null
}, - "property2": {
- "property1": null,
- "property2": null
}
}, - "streaming_data_bytes": 12345
}
], - "read_bps": 0,
- "read_eps": 0,
- "row_count": 20,
- "streaming_data_bytes": 12345,
- "written_bps": 0,
- "written_eps": 0
}
[- {
- "arguments": [
- {
- "name": "val",
- "type": "float64"
}
], - "auth_context": {
- "auth_header": "string",
- "auth_value": "string"
}, - "auth_method": "string",
- "created_at": 1742240891590,
- "created_by": "admin",
- "description": "my first UDF",
- "is_aggregation": true,
- "last_modified_at": 1742240891590,
- "last_modified_by": "admin",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "sum_2",
- "return_type": "float64",
- "source": "string",
- "type": "remote",
}
]
get the user-defined function with the given name.
name required | string user-defined function name |
{- "arguments": [
- {
- "name": "val",
- "type": "float64"
}
], - "auth_context": {
- "auth_header": "string",
- "auth_value": "string"
}, - "auth_method": "string",
- "created_at": 1742240891590,
- "created_by": "admin",
- "description": "my first UDF",
- "is_aggregation": true,
- "last_modified_at": 1742240891590,
- "last_modified_by": "admin",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "sum_2",
- "return_type": "float64",
- "source": "string",
- "type": "remote",
}
[- {
- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "comment": "string",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "create_query": "CREATE VIEW my_view AS select * from car_live_data where speed_kmh > 100",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "description for my_view",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "logstore_retention_bytes": 10737418240,
- "logstore_retention_ms": 604800000,
- "materialized": false,
- "name": "my_view",
- "query": "select * from car_live_data where speed_kmh > 100",
- "target_stream": "high_speed_cars",
- "ttl": "to_datetime(_tp_time) + INTERVAL 7 DAY",
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 7 DAY"
}
]
Get a view with the given name.
name required | string view name |
db | string database |
{- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "comment": "string",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "create_query": "CREATE VIEW my_view AS select * from car_live_data where speed_kmh > 100",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "description for my_view",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "logstore_retention_bytes": 10737418240,
- "logstore_retention_ms": 604800000,
- "materialized": false,
- "name": "my_view",
- "query": "select * from car_live_data where speed_kmh > 100",
- "target_stream": "high_speed_cars",
- "ttl": "to_datetime(_tp_time) + INTERVAL 7 DAY",
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 7 DAY"
}
Get the basic information about the current workspace.
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "free_trial_end_date": "2023-02-13T07:08:09.012Z",
- "id": "t5abcd1e",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "my_workspace",
- "settings": {
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "enabled_user_tracking": true,
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "name": "string"
}
}
Update the settings of current workspace. For Timeplus cloud, only tenant owner can update the workspace. For Timeplus enterprise, there is no such check.
update workspace request parameters
object (WorkspaceSettings) |
{- "settings": {
- "enabled_user_tracking": true
}
}
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "timeplusd"
}