All Products
Search
Document Center

Time Series Database:Set the data's validity period

Last Updated:May 11, 2018

Set data’s validity period

Request path and method

Path Method Description
/api/ttl POST Sets the TTL

Request content

Name Type Required Description Example
val Integer Yes Sets the TTL value in seconds. The value range is [1,2147483647(Integer.MAX_VALUE)]. 7776000

Request JSON example

Job: Set the data’s validity period to 90 days.

Request: POST/api/tti

Body:

  1. { "val": 7776000 }

Response description

If the error code “200” is returned, the request succeeded; otherwise, the request failed. For details about error codes, see Response Codes.

 

Obtain the data’s validity period

Request path and method

Path Method Description
/api/ttl GET Queries the data’s validity period

Request content

The request entity is not required.

Response description

If the error code “200” is returned, the request succeeded; otherwise, the request failed. For details about error codes, see Response codes.

Return JSON example:

  1. { "val": 7776000 }

The “val” value is the “ttl” value, and the unit is second (s).