All Products
Search
Document Center

Manage accounts

Last Updated: Jun 22, 2021

Before you can manage accounts, you must visit the Alibaba Cloud official website, log on to the TSDB console, and then select an instance that you have purchased. Time Series Database (TSDB) 1.0 with an engine version of 2.5.13 or later supports account management. Accounts are divided into administrator accounts and normal accounts. You can manage all accounts in the console. Account permissions are divided into the following types: read-only, write-only, read and write, and super.

Manage accounts

Enable the account management feature

On the Accounts page of the console, click Activate User Management.

Create an account
  1. On the Accounts page of the console, click Create.

  2. Set an account name and password.

    • Create an administrator account.

    • Create a normal account.

    Note:

    • The account name must be 1 to 10 characters in length and can contain lowercase letters, digits, and underscores (_). It must start with a letter and end with a letter or digit.

    • The password must be 6 to 20 characters in length and can contain only letters, digits, underscores (_), at signs (@), number signs (#), and periods (.).

Delete an account

On the Accounts page, find the required account and click Delete.

Note: The permissions and passwords of accounts cannot be modified.
Disable the account management feature

On the Accounts page of the console, click Deactivate User Management.

Authenticate accounts to perform read or write operations on the TSDB instance

After you create an account, you can use the account to perform read or write operations on the TSDB instance. If you enable account management, authentication is required when you send HTTP API requests to access the TSDB instance. For more information about the TSDB permissions that are required by different API operations, see the "Permissions for common API operations" section in this topic.

Check whether accounts are available

To check whether an account is available, you can run a curl command to send an api/put or an api/query request based on the permission of the account. In this example, an api/put request is sent.

curl -X POST -u ${Account name}:${Plaintext password} http://ts-xxxxxxx.hitsdb.tsdb.aliyuncs.com:8242/api?summary -d '[{"metric":"sys.cpu.nice","timestamp":1346846400,"value":18,"tags":{"host":"web01","dc":"lga"}}]'
Specify account information in the TSDB SDK

TSDB SDK

You must specify account information for authentication. When you create the TSDBConfig object, call the basicAuth() method to specify an account name and plaintext password. All connections that are established by using the TSDBConfig object carry the specified account information. Note: To access a TSDB instance that has the authentication capability, you must use the TSDB SDK 0.2.7 or later. Specify account information in non-Java applications

For applications that cannot use the TSDB SDK, such as Python or Go applications, you must add the Authorization field to the header when you send an HTTP request.

RFC 2617You can generate a credential string based on the RFC 2617 standard and use the string as the value of the Authorization field.

Only the HTTP requests with the Authorization field can be processed by TSDB. Otherwise, HTTP requests are rejected.

Format of a credential:
Basic {Base64 encoded authentication information}

Format of Base64 encoded authentication information: %Authorization:Basic ${Account name}:${Password}%. You must separate the fields with colons (:).

Permissions for common API operations

Operation

No credential

WriteOnly

ReadOnly

ReadWrite

Super

/api/put

×

×

/api/query

×

×

/api/query/last

×

×

/api/mput

×

×

/api/mquery

×

×

/api/query/mlast

×

×

/api/prom_write

×

×

/api/prom_read

×

×

/api/suggest

×

×

/api/dump_meta

×

×

/api/search/lookup

×

×

/api/ttl

×

×

×

×

/api/delete_meta

×

×

/api/delete_data

×

×

/api/truncate

×

×

×

×