百度智能云

All Product Document

          Time-Spatial Database

          Client Create a TsdbClient

          Tsdb sdk mainly has two types of API, which are management interface and data interface. The management interface mainly operates the database, including adding, deleting, viewing, etc. The data interface is mainly to add, delete and view the data in a specific database. Users need to create different clients according to their specific requirements.

          Basic Process

          1. Determine the Endpoint. Endpoint is the domain name address of the TSDB service in each region.
          2. Import your AK/SK.
          3. Import the configured config into TsdbDataClient.

          Code example:

          import {TsdbDataClient} from '@baiducloud/sdk';  
          // escape to require keyword using babel
          // or use var TsdbDataClient = require('@baiducloud/sdk').TsdbDataClient;
           
          const config = {
              endpoint: <Endpoint>,            // user's time series database domain name, with the format such as http://{databaseName}.tsdb.iot.gz.baidubce.com
              credentials: {
                   ak: <AccessKeyID>,          // user's Access Key ID
                   sk: <SecretAccessKey>       // user's Secret Access Key
              }
          };
            
          // initialize a TsdbClient
          const client = new TsdbDataClient(config);
          Previous
          Getting Started
          Next
          Write Operation