Request structure
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:8242Communication protocol
TSDB accepts requests over HTTP.
Request methods
TSDB's HTTP APIs are RESTful. Each HTTP verb maps to a specific type of action:
| Method | Action | Override parameter | Note |
|---|---|---|---|
| GET | Read data | N/A | Can only pass data as query string parameters, not in the request body. |
| POST | Write or modify data | method_override=post | |
| PUT | Overwrite data | method_override=put | |
| DELETE | Delete data | method_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=deleteAPI path
Each request must include an API path that identifies the operation. For example:
/api/delete_dataRequest 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.