Download OpenAPI specification:Download
Welcome to the Timeplus HTTP REST API specification.
[- {
- "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": "string",
- "timeline": [
- {
- "timestamp": 0,
- "type": "string"
}
]
}, - "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": "string",
- "timeline": [
- {
- "timestamp": 0,
- "type": "string"
}
]
}, - "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": "string",
- "timeline": [
- {
- "timestamp": 0,
- "type": "string"
}
]
}, - "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": "string",
- "timeline": [
- {
- "timestamp": 0,
- "type": "string"
}
]
}, - "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": "proton"
}
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": "proton"
}
Create a new API key with optional expiration, the created API key represents the owner thus has the same permissions as the owner
API Key parameters
expire_at | string <RFC3339> define the expiration time of the API key by specifying the exact date time, cannot use with expire_in |
expire_in | string define the expiration time of the API key by specifying the amount of time to count from now, cannot use with expire_at |
name | string the name of the API key.
|
{- "expire_at": "2022-06-07T12:00:00Z08:00",
- "expire_in": "24h",
- "name": "myAPIKey"
}
{- "api_key": "vthm5o5ENm4TaX5RcixG+DB8q9ALQtrU3VlfQBVFv1lQauWeDXR87MI5kOjXG",
- "created_at": 1257894000,
- "expire_at": 1257894000,
- "id": "string",
- "name": "myAPIKey (vthm****OjXG)",
- "permissions": [
- "read:query",
- "write:query"
]
}
[- {
- "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"
}
]
}
[- {
- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "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"
}
]
}
]
Create an external stream.
create external stream request parameters
required | Array of objects (ColumnDef) |
description | string |
name required | string |
required | Array of objects (StreamSetting) |
{- "columns": [
- {
- "codec": "string",
- "default": "string",
- "name": "name",
- "skipping_index_expression": "string",
- "ttl_expression": "string",
- "type": "string"
}
], - "description": "a sample kafka external stream",
- "name": "external_kafka",
- "settings": [
- {
- "key": "string",
- "value": "string"
}
]
}
{- "columns": [
- {
- "codec": "string",
- "default": "string",
- "name": "name",
- "skipping_index_expression": "string",
- "ttl_expression": "string",
- "type": "string"
}
], - "description": "a sample kafka external stream",
- "name": "external_kafka",
- "settings": [
- {
- "key": "string",
- "value": "string"
}
]
}
Get the external stream with the given name.
name required | string external stream name |
{- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "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"
}
]
}
[- {
- "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"
}
]
}
]
Create an external table.
create external table request parameters
description | string |
name required | string |
required | Array of objects (StreamSetting) |
{- "description": "a sample kafka external stream",
- "name": "external_kafka",
- "settings": [
- {
- "key": "string",
- "value": "string"
}
]
}
{- "description": "a sample kafka external stream",
- "name": "external_kafka",
- "settings": [
- {
- "key": "string",
- "value": "string"
}
]
}
Get the external table with the given name.
name required | string external table name |
{- "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"
}
]
}
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.
application/json
. Please refer to the failure codes in Responses section below.text/event-stream
.
For SSE
There are 3 types of data that will be sent to SSE channelquery
): The first event of the result will ALWAYS be this type.metrics
): The query metrics in JSON. They will be sent every 1 seconds.query request parameters
object (BatchingPolicy) | |
description | string |
name | string |
sql required | string |
tags | Array of strings |
{- "batching_policy": {
- "count": 0,
- "time_ms": 0
}, - "description": "string",
- "name": "string",
- "sql": "string",
- "tags": [
- "string"
]
}
{- "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": "proton"
}
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"
}
[- {
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "email": "bob@example.com",
- "id": "test_id",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "status": "pending",
- "user_id": "user_id"
}
]
Invite an user to the current tenant.
create invitation request parameters
email required | string |
{- "email": "string"
}
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "proton"
}
[- {
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "data": {
- "created": "string",
- "expiry": "string",
- "key": "string",
- "lastValidated": "string",
- "metadata": { },
- "name": "string",
- "requireHeartbeat": true,
- "scheme": "string",
- "updated": "string"
}, - "id": "string",
- "is_trial": true,
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}
}
]
upload and create a lcense.
key required | string encryption key for license file |
file required | string <binary> license file |
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "data": {
- "created": "string",
- "expiry": "string",
- "key": "string",
- "lastValidated": "string",
- "metadata": { },
- "name": "string",
- "requireHeartbeat": true,
- "scheme": "string",
- "updated": "string"
}, - "id": "string",
- "is_trial": true,
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}
}
remove a lcense by id
id required | string license ID |
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "data": {
- "created": "string",
- "expiry": "string",
- "key": "string",
- "lastValidated": "string",
- "metadata": { },
- "name": "string",
- "requireHeartbeat": true,
- "scheme": "string",
- "updated": "string"
}, - "id": "string",
- "is_trial": true,
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}
}
get a lcense by id
id required | string license ID |
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "data": {
- "created": "string",
- "expiry": "string",
- "key": "string",
- "lastValidated": "string",
- "metadata": { },
- "name": "string",
- "requireHeartbeat": true,
- "scheme": "string",
- "updated": "string"
}, - "id": "string",
- "is_trial": true,
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}
}
[- {
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "get the latest data from iot stream",
- "id": "UUID",
- "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": "UUID",
- "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": "UUID",
- "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": "UUID",
- "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"
}
]
Create a schema
create Schema request parameters
content required | string |
name required | string |
type required | string Value: "Protobuf" |
{- "content": "",
- "name": "my_schema",
- "type": "Protobuf"
}
{- "content": "",
- "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"
}
Update the specific schema with the given content.
update Schema request parameters
content required | string |
name required | string |
type required | string Value: "Protobuf" |
{- "content": "",
- "name": "my_schema",
- "type": "Protobuf"
}
{- "content": "",
- "name": "my_schema",
- "type": "Protobuf"
}
[- {
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "write data to kafka",
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "write_to_kafka",
- "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": "kafka"
}
]
Create a sink. Please refer to the documentation of sink for more details.
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 kafka",
- "name": "write_to_kafka",
- "properties": {
- "property1": null,
- "property2": null
}, - "query": "select * from car_live_data where speed_kmh > 100",
- "type": "kafka"
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "write data to kafka",
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "write_to_kafka",
- "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": "kafka"
}
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 kafka",
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "write_to_kafka",
- "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": "kafka"
}
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 kafka",
- "name": "write_to_kafka",
- "properties": {
- "property1": null,
- "property2": null
}, - "query": "select * from car_live_data where speed_kmh > 100",
- "type": "kafka"
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "write data to kafka",
- "id": "UUID",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "write_to_kafka",
- "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": "kafka"
}
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,
- "latest_event": "2023-02-13T07:08:09.012Z",
- "row_count": 20,
- "streaming_data_bytes": 12345,
- "success_count": 99,
- "throughput": [
- {
- "time": "2023-06-26T21:40:00Z",
- "value": 25000
}
]
}
Get sample events from the source with the given ID. Please refer to create source for more details regarding type
and properties
.
source propeties 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": "kafka"
}
[- {
- "property1": null,
- "property2": null
}
]
[- {
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "read data from my kafka topic",
- "id": "source_id",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "my_kafka_source",
- "properties": {
- "property1": null,
- "property2": null
}, - "start_time": 1680301788,
- "status": "running",
- "stream": "kafka_stream",
- "type": "kafka"
}
]
Create a source. Please refer to the documentation of source for more details.
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 kafka topic",
- "name": "my_kafka_source",
- "properties": {
- "property1": null,
- "property2": null
}, - "stream": "kafak_stream",
- "type": "kafka"
}
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "read data from my kafka topic",
- "id": "source_id",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "my_kafka_source",
- "properties": {
- "property1": null,
- "property2": null
}, - "start_time": 1680301788,
- "status": "running",
- "stream": "kafka_stream",
- "type": "kafka"
}
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 my kafka topic",
- "id": "source_id",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "my_kafka_source",
- "properties": {
- "property1": null,
- "property2": null
}, - "start_time": 1680301788,
- "status": "running",
- "stream": "kafka_stream",
- "type": "kafka"
}
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 my kafka topic",
- "id": "source_id",
- "last_updated_at": "2023-02-05 11:12:13",
- "last_updated_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "message": "string",
- "name": "my_kafka_source",
- "properties": {
- "property1": null,
- "property2": null
}, - "start_time": 1680301788,
- "status": "running",
- "stream": "kafka_stream",
- "type": "kafka"
}
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
}
]
}
[- {
- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my test stream",
- "engine": "Stream",
- "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",
- "ttl": "to_datetime(_tp_time) + INTERVAL 7 DAY",
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 7 DAY"
}
]
Create a stream. Please refer to the documentation of stream for more details.
create stream request parameters
Array of objects (ColumnDef) | |
description | string |
event_time_column | string This column will be used as the event time if specified |
event_time_timezone | string The timezone of the |
logstore_retention_bytes | integer The max size a stream can grow. Any non-positive value means unlimited size. Defaulted to 10 GiB. |
logstore_retention_ms | integer The max time the data can be retained in the stream. Any non-positive value means unlimited time. Defaulted to 7 days. |
mode | string Enum: "append" "changelog" "changelog_kv" "versioned_kv" Storage mode of stream. Defaulted to |
name required | string Stream name should only contain a maximum of 64 letters, numbers, or _, and start with a letter |
order_by_expression | string |
order_by_granularity | string |
partition_by_granularity | string |
primary_key | string Expression of primary key, required in |
replication_factor | integer |
shards | integer |
ttl_expression | string |
{- "columns": [
- {
- "codec": "string",
- "default": "string",
- "name": "name",
- "skipping_index_expression": "string",
- "ttl_expression": "string",
- "type": "string"
}
], - "description": "my first stream",
- "event_time_column": "time",
- "event_time_timezone": "UTC",
- "logstore_retention_bytes": 10737418240,
- "logstore_retention_ms": 604800000,
- "mode": "append",
- "name": "test_stream",
- "order_by_expression": "string",
- "order_by_granularity": "string",
- "partition_by_granularity": "string",
- "primary_key": "string",
- "replication_factor": 0,
- "shards": 0,
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 7 DAY"
}
{- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my test stream",
- "engine": "Stream",
- "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",
- "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 |
{- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my test stream",
- "engine": "Stream",
- "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",
- "ttl": "to_datetime(_tp_time) + INTERVAL 7 DAY",
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 7 DAY"
}
Update the specific stream with the given name. Right now it only supports updating data retention-related settings. Altering stream or updating external stream is not supported yet.
name required | string name of the stream |
update stream request parameters
description | string |
logstore_retention_bytes | integer The max size a stream can grow. Any non-positive value means unlimited size. Defaulted to 10 GiB. |
logstore_retention_ms | integer The max time the data can be retained in the stream. Any non-positive value means unlimited time. Defaulted to 7 days. |
ttl_expression | string |
{- "description": "new description",
- "logstore_retention_bytes": 10737418240,
- "logstore_retention_ms": 604800000,
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 28 DAY"
}
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "proton"
}
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 |
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": "proton"
}
Get the stats of a stream with the given name.
name required | string stream name |
{- "earliest_event": "2023-02-01T01:02:03.456Z",
- "historical_data_bytes": 234567,
- "latest_event": "2023-02-13T07:08:09.012Z",
- "row_count": 20,
- "streaming_data_bytes": 12345
}
{- "cpu": 1000,
- "customer": {
- "email": "bob@email.com",
- "name": "Bob"
}, - "payment": {
- "created": 0,
- "status": "string",
- "types": [
- "string"
]
}, - "storage_size": 10737418240,
- "subscription_plan": "Free Trial"
}
Get topology graph of all existings resources.
{- "edges": [
- {
- "source": "string",
- "target": "string"
}
], - "nodes": [
- {
- "id": "string",
- "name": "string",
- "ownership": {
- "id": "bob-id",
- "name": "Bob"
}, - "properties": {
- "property1": null,
- "property2": null
}, - "type": "string"
}
]
}
[- {
- "arguments": [
- {
- "name": "val",
- "type": "float64"
}
], - "auth_context": {
- "key_name": "string",
- "key_value": "string"
}, - "auth_method": "string",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my first UDF",
- "is_aggregation": true,
- "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",
}
]
Create an user-defined function.
create UDF request parameters
Array of objects (UDFArgument) The input argument of the UDF
| |
object (UDFAuthContext) | |
auth_method | string Only valid when |
created_at | string |
object (Owner) | |
description | string |
is_aggregation | boolean Only valid when type is 'javascript'. Whether it is an aggregation function. |
last_updated_at | string |
object (Owner) | |
name required | string |
return_type | string The erturn type of the UDF
|
source | string Only valid when type is 'javascript' The source code of the UDA. There are functions to be defined:
|
type required | string Either |
url | string Only valid when |
{- "arguments": [
- {
- "name": "val",
- "type": "float64"
}
], - "auth_context": {
- "key_name": "string",
- "key_value": "string"
}, - "auth_method": "string",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my first UDF",
- "is_aggregation": true,
- "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",
}
{- "arguments": [
- {
- "name": "val",
- "type": "float64"
}
], - "auth_context": {
- "key_name": "string",
- "key_value": "string"
}, - "auth_method": "string",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my first UDF",
- "is_aggregation": true,
- "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": {
- "key_name": "string",
- "key_value": "string"
}, - "auth_method": "string",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my first UDF",
- "is_aggregation": true,
- "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",
}
Update the specific user-defined function with the given name.
update UDF request parameters
Array of objects (UDFArgument) The input argument of the UDF
| |
object (UDFAuthContext) | |
auth_method | string Only valid when |
created_at | string |
object (Owner) | |
description | string |
is_aggregation | boolean Only valid when type is 'javascript'. Whether it is an aggregation function. |
last_updated_at | string |
object (Owner) | |
name required | string |
return_type | string The erturn type of the UDF
|
source | string Only valid when type is 'javascript' The source code of the UDA. There are functions to be defined:
|
type required | string Either |
url | string Only valid when |
{- "arguments": [
- {
- "name": "val",
- "type": "float64"
}
], - "auth_context": {
- "key_name": "string",
- "key_value": "string"
}, - "auth_method": "string",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my first UDF",
- "is_aggregation": true,
- "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",
}
{- "arguments": [
- {
- "name": "val",
- "type": "float64"
}
], - "auth_context": {
- "key_name": "string",
- "key_value": "string"
}, - "auth_method": "string",
- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "description": "my first UDF",
- "is_aggregation": true,
- "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))",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "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"
}
]
Create a view. There are two different types of the view, please refer to the documentation of view for more details.
create view request parameters
description | string |
logstore_retention_bytes | integer The max size a stream can grow. Any non-positive value means unlimited size. Defaulted to 10 GiB. |
logstore_retention_ms | integer The max time the data can be retained in the stream. Any non-positive value means unlimited time. Defaulted to 7 days. |
materialized | boolean Default: false |
name required | string View name should only contain a maximum of 64 letters, numbers, or _, and start with a letter |
query required | string |
target_stream | string This option is applicable only when |
ttl_expression | string |
{- "description": "the description of my_test_view",
- "logstore_retention_bytes": 10737418240,
- "logstore_retention_ms": 604800000,
- "materialized": false,
- "name": "my_test_view",
- "query": "select * from car_live_data where speed_kmh > 100",
- "target_stream": "string",
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 28 DAY"
}
{- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "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 |
{- "columns": [
- {
- "codec": "CODEC(ZSTD(1))",
- "default": "string",
- "name": "my_col",
- "nullable": true,
- "type": "int64"
}
], - "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"
}
Update the specific view with the given name. Updating the query of a materialized view is not allowed
name required | string name of the view |
update view request parameters
description | string |
logstore_retention_bytes | integer The max size a stream can grow. Any non-positive value means unlimited size. Defaulted to 10 GiB. |
logstore_retention_ms | integer The max time the data can be retained in the stream. Any non-positive value means unlimited time. Defaulted to 7 days. |
query | string |
ttl_expression | string |
{- "description": "string",
- "logstore_retention_bytes": 10737418240,
- "logstore_retention_ms": 604800000,
- "query": "string",
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 28 DAY"
}
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "proton"
}
Get the stats of a view with the given name.
name required | string view name |
{- "earliest_event": "2023-02-01T01:02:03.456Z",
- "historical_data_bytes": 234567,
- "latest_event": "2023-02-13T07:08:09.012Z",
- "row_count": 20,
- "streaming_data_bytes": 12345
}
Get the basic information about the current workspace.
{- "created_at": "2023-02-01 23:22:59",
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "demo_mode": false,
- "enabled_subscription": true,
- "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": {
- "enabled_user_tracking": true
}
}
Update the settings of current workspace
update workspace request parameters
object (WorkspaceSettings) |
{- "settings": {
- "enabled_user_tracking": true
}
}
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "proton"
}