Timeplus python SDK
Project description
swagger-client
Welcome to the Timeplus HTTP REST API specification. # Authentication
This Python package is automatically generated by the Swagger Codegen project:
- API version: 1.0.0-oas3
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen For more information, please visit https://timeplus.com
Requirements.
Python 3.9+
Installation & Usage
pip install
pip install timeplus
(you may need to run pip
with root permission)
Then import the package:
import timeplus_client
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import timeplus_client
Getting Started
Please follow the installation procedure and then run the following:
import os
import json
import timeplus_client
from timeplus_client.rest import ApiException
from timeplus.stream import QueryStreamV2
from pprint import pprint
api_key = os.environ.get("TIMEPLUS_API_KEY")
api_address = os.environ.get("TIMEPLUS_HOST")
worksapce = os.environ.get("TIMEPLUS_WORKSAPCE")
# Configure API key and address
configuration = timeplus_client.Configuration()
# Address of timeplus for example, https://beta.timeplus.com
configuration.address(api_address)
configuration.apikey(api_key)
configuration.workspace(worksapce)
# create an instance of the API class
api_instance = timeplus_client.QueriesV1beta2Api(
timeplus_client.ApiClient(configuration)
)
body = timeplus_client.CreateQueryRequestV1Beta2(sql="select * from iot")
try:
# create query
api_response = api_instance.v1beta2_queries_post(body)
stream = QueryStreamV2(api_response)
for event in stream.events():
pprint(f"event : {event.event} ")
pprint(json.loads(event.data))
except ApiException as e:
print(
"Exception when calling APIKeysV1beta1Api->v1beta1_auth_api_keys_get: %s\n" % e
)
Documentation for API Endpoints
All URIs are relative to https//beta.timeplus.cloud/{workspace-id}/api
Class | Method | HTTP request | Description |
---|---|---|---|
APIKeysV1beta1Api | v1beta1_auth_api_keys_get | GET /v1beta1/auth/api_keys | List API keys |
APIKeysV1beta1Api | v1beta1_auth_api_keys_id_delete | DELETE /v1beta1/auth/api_keys/{id} | Delete an API key |
APIKeysV1beta1Api | v1beta1_auth_api_keys_post | POST /v1beta1/auth/api_keys | Create an API key |
DashboardsV1beta2Api | v1beta2_dashboards_get | GET /v1beta2/dashboards | list dashboards. |
DashboardsV1beta2Api | v1beta2_dashboards_id_delete | DELETE /v1beta2/dashboards/{id} | delete a dashboard. |
DashboardsV1beta2Api | v1beta2_dashboards_id_get | GET /v1beta2/dashboards/{id} | get a dashboard. |
DashboardsV1beta2Api | v1beta2_dashboards_id_put | PUT /v1beta2/dashboards/{id} | Update a dashboard. |
DashboardsV1beta2Api | v1beta2_dashboards_post | POST /v1beta2/dashboards | create a dashboard. |
PersistentQueriesV1beta2Api | v1beta2_persistent_queries_get | GET /v1beta2/persistent-queries | list persistent-queries. |
PersistentQueriesV1beta2Api | v1beta2_persistent_queries_id_data_get | GET /v1beta2/persistent-queries/{id}/data | stream persistent query result via websocket |
PersistentQueriesV1beta2Api | v1beta2_persistent_queries_id_delete | DELETE /v1beta2/persistent-queries/{id} | delete a persistent query. |
PersistentQueriesV1beta2Api | v1beta2_persistent_queries_id_get | GET /v1beta2/persistent-queries/{id} | get a persistent query. |
PersistentQueriesV1beta2Api | v1beta2_persistent_queries_post | POST /v1beta2/persistent-queries | execute a persistent query. |
QueriesV1beta1Api | v1beta1_format_post | POST /v1beta1/format | format a query. |
QueriesV1beta1Api | v1beta1_queries_get | GET /v1beta1/queries | list queries. |
QueriesV1beta1Api | v1beta1_queries_id_cancel_post | POST /v1beta1/queries/{id}/cancel | cancel a query. |
QueriesV1beta1Api | v1beta1_queries_id_delete | DELETE /v1beta1/queries/{id} | delete a query. |
QueriesV1beta1Api | v1beta1_queries_id_get | GET /v1beta1/queries/{id} | get a query. |
QueriesV1beta1Api | v1beta1_queries_id_pipeline_get | GET /v1beta1/queries/{id}/pipeline | get the pipeline for a query |
QueriesV1beta1Api | v1beta1_queries_post | POST /v1beta1/queries | execute a query. |
QueriesV1beta1Api | v1beta1_sqlanalyze_post | POST /v1beta1/sqlanalyze | analyze sql |
QueriesV1beta1Api | ws_queries_id_get | GET /ws/queries/{id} | stream query result via websocket [THIS API DOESN'T HAVE `v1beta1` IN PATH] |
QueriesV1beta2Api | v1beta2_queries_post | POST /v1beta2/queries | execute a query. |
SinksV1beta1Api | v1beta1_sinks_get | GET /v1beta1/sinks | list sinks |
SinksV1beta1Api | v1beta1_sinks_id_delete | DELETE /v1beta1/sinks/{id} | delete a sink. |
SinksV1beta1Api | v1beta1_sinks_id_get | GET /v1beta1/sinks/{id} | get a sink. |
SinksV1beta1Api | v1beta1_sinks_post | POST /v1beta1/sinks | create a sink. |
SourcesV1beta1Api | v1beta1_source_infer_post | POST /v1beta1/source/infer | infer schema from an existing event |
SourcesV1beta1Api | v1beta1_source_match_post | POST /v1beta1/source/match | return streams match provided events |
SourcesV1beta1Api | v1beta1_source_preview_post | POST /v1beta1/source/preview | preview a source. |
SourcesV1beta1Api | v1beta1_source_upload_post | POST /v1beta1/source/upload | upload a file |
SourcesV1beta1Api | v1beta1_sources_get | GET /v1beta1/sources | list sources. |
SourcesV1beta1Api | v1beta1_sources_id_delete | DELETE /v1beta1/sources/{id} | delete a source. |
SourcesV1beta1Api | v1beta1_sources_id_get | GET /v1beta1/sources/{id} | get a source. |
SourcesV1beta1Api | v1beta1_sources_id_put | PUT /v1beta1/sources/{id} | Update a source. |
SourcesV1beta1Api | v1beta1_sources_id_start_post | POST /v1beta1/sources/{id}/start | start a source. |
SourcesV1beta1Api | v1beta1_sources_id_stop_post | POST /v1beta1/sources/{id}/stop | stop a source. |
SourcesV1beta1Api | v1beta1_sources_post | POST /v1beta1/sources | create a source. |
StreamsV1beta1Api | v1beta1_streams_external_post | POST /v1beta1/streams/external | create an external stream. |
StreamsV1beta1Api | v1beta1_streams_get | GET /v1beta1/streams | list streams. |
StreamsV1beta1Api | v1beta1_streams_name_delete | DELETE /v1beta1/streams/{name} | delete a stream. |
StreamsV1beta1Api | v1beta1_streams_name_ingest_post | POST /v1beta1/streams/{name}/ingest | ingest data. |
StreamsV1beta1Api | v1beta1_streams_name_put | PUT /v1beta1/streams/{name} | Update a stream. |
StreamsV1beta1Api | v1beta1_streams_post | POST /v1beta1/streams | create a stream. |
TopologyV1beta2Api | v1beta2_topology_get | GET /v1beta2/topology | get topology graph. |
UDFsV1beta1Api | v1beta1_udfs_get | GET /v1beta1/udfs | list udf. |
UDFsV1beta1Api | v1beta1_udfs_name_delete | DELETE /v1beta1/udfs/{name} | delete a udf. |
UDFsV1beta1Api | v1beta1_udfs_name_get | GET /v1beta1/udfs/{name} | get a udf. |
UDFsV1beta1Api | v1beta1_udfs_post | POST /v1beta1/udfs | create a udf. |
ViewsV1beta1Api | v1beta1_views_get | GET /v1beta1/views | list views. |
ViewsV1beta1Api | v1beta1_views_name_delete | DELETE /v1beta1/views/{name} | delete a view. |
ViewsV1beta1Api | v1beta1_views_post | POST /v1beta1/views | create a view. |
Documentation For Models
- APIKey
- AnalyzeSQLRequest
- Column
- ColumnDef
- ColumnsResp
- Connection
- ConnectionConfig
- ConnectionStat
- CreateAPIKeyRequest
- CreateAPIKeyResponse
- CreateDashboardRequest
- CreatePersistentQueryRequest
- CreateQueryRequestV1Beta1
- CreateQueryRequestV1Beta2
- CreateQueryResponse
- CreateSinkRequest
- CreateSourceRequest
- DashboardDashboard
- DashboardPanel
- Edge
- ErrorResponse
- Event
- EventInferRequest
- EventInferResponse
- ExternalStreamDef
- FileUploadResponse
- FormatQueryRequest
- FormatQueryResponse
- Graph
- IngestData
- Latency
- Node
- Owner
- Query
- QueryAnalysis
- QueryMetrics
- QueryPipeline
- QueryPipelineEdge
- QueryPipelineNode
- QueryPipelineNodeMetric
- QueryResult
- QueryWithMetrics
- SQLAnalyzeColumn
- SQLAnalyzeResult
- Sink
- SinkMetrics
- SinkStat
- SinkWithMetrics
- Source
- SourceMetrics
- SourcePreviewRequest
- SourceUploadBody
- SourceWithMetrics
- Stream
- StreamDef
- StreamMatchRequest
- StreamSetting
- StreamStats
- Throughput
- TimeColumns
- UDF
- UDFArgument
- UDFAuthContext
- UpdateDashboardRequest
- UpdateSourceRequest
- View
Documentation For Authorization
ApiKeyAuth
- Type: API key
- API key parameter name: X-Api-Key
- Location: HTTP header
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
timeplus-1.0.1.tar.gz
(66.0 kB
view hashes)
Built Distribution
timeplus-1.0.1-py3-none-any.whl
(200.5 kB
view hashes)