Updated on 2024-10-25 GMT+08:00

IoTDB User Permission Description

MRS supports users, user groups, and roles. Permissions must be assigned to roles and then roles are bound to users or user groups. Users can obtain permissions only by binding a role or joining a group that is bound with a role.

In security mode, you need to manage IoTDB permissions and add the created user to the iotdbgroup user group. In normal mode, IoTDB permission management is not required.

IoTDB Permission List

The Name column in Table 1 lists the permissions supported by open-source IoTDB. If an MRS user needs to use corresponding permissions to perform operations, grant the permissions to the user on Manager by referring to the Required Permission column. For details, see Creating an IoTDB Permission Role.

Table 1 IoTDB permissions

Name

Description

Required Permission

Example

SET_STORAGE_GROUP

Used for creating a storage group, including setting permissions for the storage group and setting or canceling its time to live (TTL).

Set StorageGroup

  • set storage group to root.ln;
  • set ttl to root.ln 3600000;
  • unset ttl to root.ln;

CREATE_TIMESERIES

Used for creating a time series.

Create

  • Creating a time series

    create timeseries root.ln.wf02.status with datatype=BOOLEAN,encoding=PLAIN;

  • Creating an aligned time series

    create aligned timeseries root.ln.device1(latitude FLOAT encoding=PLAIN compressor=SNAPPY, longitude FLOAT encoding=PLAIN compressor=SNAPPY);

INSERT_TIMESERIES

Used for inserting data.

Write

  • insert into root.ln.wf02(timestamp,status) values(1,true);
  • insert into root.sg1.d1(time, s1, s2) aligned values(1, 1, 1);

ALTER_TIMESERIES

Used for modifying a time series, and adding attributes and tags.

Alter

  • alter timeseries root.turbine.d1.s1 ADD TAGS tag3=v3, tag4=v4;
  • ALTER timeseries root.turbine.d1.s1 UPSERT ALIAS=newAlias TAGS(tag2=newV2, tag3=v3) ATTRIBUTES(attr3=v3, attr4=v4);

READ_TIMESERIES

Used for querying data.

Read

  • show storage group;
  • show child paths root.ln, show child nodes root.ln;
  • show devices;
  • show timeseries root.**;
  • show all ttl;
  • Querying data

    select * from root.ln.**;

  • Querying performance tracing

    tracing select * from root.**;

  • Querying the UDF

    select example(*) from root.sg.d1;

  • Querying statistics

    count devices;

DELETE_TIMESERIES

Used for deleting data or time series.

Delete

  • Deleting a time series

    delete timeseries root.ln.wf01.wt01.status;

  • Deleting data

    delete from root.ln.wf02.wt02.status where time < 10;

DELETE_STORAGE_GROUP

Used for deleting a storage group.

IoTDB Admin Privilege

delete storage group root.ln;

CREATE_FUNCTION

Used for registering a UDF.

IoTDB Admin Privilege

create function example AS 'org.apache.iotdb.udf.UDTFExample';

DROP_FUNCTION

Used for deregistering a UDF.

IoTDB Admin Privilege

drop function example;

UPDATE_TEMPLATE

Used for creating, deleting, and modifying metadata templates.

IoTDB Admin Privilege

create schema template t1(s1 int32);

READ_TEMPLATE

Used for viewing all metadata templates and metadata template content.

IoTDB Admin Privilege

  • show schema templates;
  • show nodes in template t1;

APPLY_TEMPLATE

Used for attaching, detaching, and activating a metadata template.

IoTDB Admin Privilege

  • set schema template t1 to root.sg.d;
  • create timeseries of schema template on root.sg.d;

READ_TEMPLATE_APPLICATION

Used for viewing the path for attaching or activating the metadata template.

IoTDB Admin Privilege

  • show paths set schema template t1;
  • show paths using schema template t1;