Request structure

Updated at:
Copy as MD

Every TSDB HTTP API request is built from five components: an access link, a communication protocol, a request method, an API path, and a request body or query string parameters.

Access link

Find the access link on the instance details page of your TSDB instance. The format is:

ts-xxx.hitsdb.rds.aliyuncs.com:8242

Communication protocol

TSDB accepts requests over HTTP.

Request methods

TSDB's HTTP APIs are RESTful. Each HTTP verb maps to a specific type of action:

MethodActionOverride parameterNote
GETRead dataN/ACan only pass data as query string parameters, not in the request body.
POSTWrite or modify datamethod_override=post
PUTOverwrite datamethod_override=put
DELETEDelete datamethod_override=delete

Work around verb restrictions with method_override

Some firewalls, proxies, and HTTP clients block PUT and DELETE requests. Use the method_override query string parameter to substitute the blocked verb while preserving the intended action.

For example, to delete metadata using a GET request:

/api/delete_meta?m=cpu.usage&method_override=delete

API path

Each request must include an API path that identifies the operation. For example:

/api/delete_data

Request parameters

For data writing requests, use query string parameters to control the response content and set a timeout.

Request body

Include the request body to specify the data to access and the operations to perform.