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"
}
Get all API keys created by current user. The tenant owner will get all the API keys regardless of the creator.
[- {
- "created_at": 1257894000,
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "expire_at": 1257894000,
- "id": "string",
- "name": "myAPIKey (vthm****OjXG)",
- "permissions": [
- "read:query",
- "write:query"
]
}
]
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,
- "created_by": {
- "id": "bob-id",
- "name": "Bob"
}, - "expire_at": 1257894000,
- "id": "string",
- "name": "myAPIKey (vthm****OjXG)",
- "permissions": [
- "read:query",
- "write:query"
]
}
Delete the API key with the givin ID. The tenant owner is able to delete the API key regardless of the creator.
id required | string API key ID |
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "proton"
}
[- {
- "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
Array of objects (ColumnDef) Required if this is a kafka external stream | |
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"
}
]
}
Get the stats of an external stream with the given name.
name required | string external stream name |
historyDays | integer number of days of the history metrics, must be >= 1 and <= 7 if set |
{- "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",
- "read_bps": 0,
- "read_eps": 0,
- "row_count": 20,
- "streaming_data_bytes": 12345,
- "written_bps": 0,
- "written_eps": 0
}
[- {
- "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."inf"
, "-inf"
, "nan"
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"
}
create a user.
create user request parameters
password required | string |
role | string |
username required | string |
{- "password": "qwekjds45",
- "role": "admin",
- "username": "myname"
}
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "proton"
}
update a user.
update user request parameters
password | string |
role | string |
{- "password": "qwekjds45",
- "role": "admin"
}
{- "code": 57,
- "message": "stream 'iot' exists",
- "system": "proton"
}
[- {
- "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.
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 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,
- "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": [
- {
- "checkpoint_size": 0,
- "last_error_message": "string",
- "node_id": 0,
- "status": "ExecutingPipeline"
}
], - "read_bps": 0,
- "read_eps": 0,
- "row_count": 20,
- "streaming_data_bytes": 12345,
- "success_count": 99,
- "throughput": [
- {
- "time": "2023-06-26T21:40:00Z",
- "value": 25000
}
], - "written_bps": 0,
- "written_eps": 0
}
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": "websocket"
}
[- {
- "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.
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 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
}
]
}
[- {
- "column_families": [
- {
- "columns": [
- "string"
], - "name": "basic_info"
}
], - "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",
- "secondary_indexes": [
- {
- "columns": [
- "string"
], - "name": "basic_info",
- "storing": [
- "string"
], - "unique": true
}
], - "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 (ColumnFamily) Columns in column families shall have no overlap with primary keys | |
Array of objects (ColumnDef) | |
description | string |
engine | string Value: "MutableStream" |
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 |
Array of objects (SecondaryIndex) | |
shards | integer |
ttl_expression | string |
{- "column_families": [
- {
- "columns": [
- "string"
], - "name": "basic_info"
}
], - "columns": [
- {
- "codec": "string",
- "default": "string",
- "name": "name",
- "skipping_index_expression": "string",
- "ttl_expression": "string",
- "type": "string"
}
], - "description": "my first stream",
- "engine": "MutableStream",
- "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,
- "secondary_indexes": [
- {
- "columns": [
- "string"
], - "name": "basic_info",
- "storing": [
- "string"
], - "unique": true
}
], - "shards": 0,
- "ttl_expression": "to_datetime(_tp_time) + INTERVAL 7 DAY"
}
{- "column_families": [
- {
- "columns": [
- "string"
], - "name": "basic_info"
}
], - "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",
- "secondary_indexes": [
- {
- "columns": [
- "string"
], - "name": "basic_info",
- "storing": [
- "string"
], - "unique": true
}
], - "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 |
{- "column_families": [
- {
- "columns": [
- "string"
], - "name": "basic_info"
}
], - "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",
- "secondary_indexes": [
- {
- "columns": [
- "string"
], - "name": "basic_info",
- "storing": [
- "string"
], - "unique": true
}
], - "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"
}
{- "column_families": [
- {
- "columns": [
- "string"
], - "name": "basic_info"
}
], - "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",
- "secondary_indexes": [
- {
- "columns": [
- "string"
], - "name": "basic_info",
- "storing": [
- "string"
], - "unique": true
}
], - "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 |
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 |
historyDays | integer number of days of the history metrics, must be >= 1 and <= 7 if set |
{- "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",
- "read_bps": 0,
- "read_eps": 0,
- "row_count": 20,
- "streaming_data_bytes": 12345,
- "written_bps": 0,
- "written_eps": 0
}
{- "cpu": 1000,
- "customer": {
- "email": "bob@email.com",
- "name": "Bob"
}, - "payment": {
- "created": 0,
- "status": "string",
- "types": [
- "string"
]
}, - "storage_size": 10737418240,
- "subscription_plan": "Free Trial"
}