tencent cloud

Feedback

Connecting to Instance

Last updated: 2022-01-19 11:24:57

CTSDB instances currently can be connected to only in VPCs. You can connect to an instance in the console or through RESTful APIs. In the latter case, you need to provide the root account password to ensure security.

Below is a code sample for connecting to an instance and creating a metric through curl. Here, ${user:password} is the username and password of the instance, ${vip}:${vport} the IP and port, and ${metric_name} the name of the created metric. For parameter descriptions, please see Creating Metric.

 curl -u ${user:password} -H 'Content-Type:application/json' -X PUT ${vip}:${vport}/_metric/${metric_name} -d'
{ 
   "tags": {
       "region": "string",
       "set":  "long",
       "host": "string"
   },
   "time": {
        "name": "timestamp",
        "format": "epoch_second"
   },
   "fields": {
       "cpu_usage":  "float"
   },
   "options": {
       "expire_day": 7,
       "refresh_interval": "10s",
       "number_of_shards": 5,
       "number_of_replicas": 1,
       "rolling_period": 1
   }
}'
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support