Skip to content

Commit

Permalink
Add and Fix the content about showDevice_Template (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
linxt20 authored Jan 17, 2024
1 parent b843617 commit 8f1423e
Show file tree
Hide file tree
Showing 12 changed files with 360 additions and 180 deletions.
14 changes: 12 additions & 2 deletions src/UserGuide/Master/API/RestServiceV1.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X
"expressions": null,
"columnNames": [
"devices",
"isAligned"
"isAligned",
"Template"
],
"timestamps": null,
"values": [
Expand All @@ -534,6 +535,10 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X
[
"false",
"false"
],
[
"t1",
null
]
]
}
Expand All @@ -551,7 +556,8 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X
"columnNames": [
"devices",
"database",
"isAligned"
"isAligned",
"Template"
],
"timestamps": null,
"values": [
Expand All @@ -566,6 +572,10 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X
[
"false",
"false"
],
[
"t1",
null
]
]
}
Expand Down
14 changes: 12 additions & 2 deletions src/UserGuide/Master/API/RestServiceV2.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X
"expressions": null,
"column_names": [
"devices",
"isAligned"
"isAligned",
"Template"
],
"timestamps": null,
"values": [
Expand All @@ -534,6 +535,10 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X
[
"false",
"false"
],
[
"t1",
null
]
]
}
Expand All @@ -551,7 +556,8 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X
"column_names": [
"devices",
"database",
"isAligned"
"isAligned",
"Template"
],
"timestamps": null,
"values": [
Expand All @@ -566,6 +572,10 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X
[
"false",
"false"
],
[
"t1",
null
]
]
}
Expand Down
4 changes: 4 additions & 0 deletions src/UserGuide/Master/SQL-Manual/SQL-Manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ IoTDB> show schema templates
IoTDB> show nodes in schema template t1
IoTDB> show paths set schema template t1
IoTDB> show paths using schema template t1
IoTDB> show devices where template = 't1'
IoTDB> show devices where template != 't1'
IoTDB> show devices where template is null
IoTDB> show devices where template is not null
```

### Deactivate Schema Template
Expand Down
115 changes: 72 additions & 43 deletions src/UserGuide/Master/User-Manual/Operate-Metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,12 @@ show devices root.sg1.**
````
```shell
+---------------+---------+
| devices|isAligned|
+---------------+---------+
| root.sg1.d1| false|
| root.sg1.d2| true|
+---------------+---------+
+---------------+---------+---------+
| devices|isAligned| Template|
+---------------+---------+---------+
| root.sg1.d1| false| null|
| root.sg1.d2| true| null|
+---------------+---------+---------+
````

### Show Schema Template
Expand Down Expand Up @@ -1092,40 +1092,69 @@ Similar to `Show Timeseries`, IoTDB also supports two ways of viewing devices:
* `SHOW DEVICES` statement presents all devices' information, which is equal to `SHOW DEVICES root.**`.
* `SHOW DEVICES <PathPattern>` statement specifies the `PathPattern` and returns the devices information matching the pathPattern and under the given level.
* `WHERE` condition supports `DEVICE contains 'xxx'` to do a fuzzy query based on the device name.
* `WHERE` condition supports `TEMPLATE = 'xxx'`,`TEMPLATE != 'xxx'` to do a filter query based on the template name.
* `WHERE` condition supports `TEMPLATE is null`,`TEMPLATE is not null` to do a filter query based on whether the template is null (null indicating it's inactive)
SQL statement is as follows:
```
IoTDB> show devices
IoTDB> show devices root.ln.**
IoTDB> show devices root.ln.** where device contains 't'
IoTDB> show devices root.ln.** where template = 't1'
IoTDB> show devices root.ln.** where template is null
```
You can get results below:
```
+-------------------+---------+
| devices|isAligned|
+-------------------+---------+
| root.ln.wf01.wt01| false|
| root.ln.wf02.wt02| false|
|root.sgcc.wf03.wt01| false|
| root.turbine.d1| false|
+-------------------+---------+
+-------------------+---------+---------+
| devices|isAligned| Template|
+-------------------+---------+---------+
| root.ln.wf01.wt01| false| t1|
| root.ln.wf02.wt02| false| null|
|root.sgcc.wf03.wt01| false| null|
| root.turbine.d1| false| null|
+-------------------+---------+---------+
Total line number = 4
It costs 0.002s

+-----------------+---------+
| devices|isAligned|
+-----------------+---------+
|root.ln.wf01.wt01| false|
|root.ln.wf02.wt02| false|
+-----------------+---------+
+-----------------+---------+---------+
| devices|isAligned| Template|
+-----------------+---------+---------+
|root.ln.wf01.wt01| false| t1|
|root.ln.wf02.wt02| false| null|
+-----------------+---------+---------+
Total line number = 2
It costs 0.001s

+-----------------+---------+---------+
| devices|isAligned| Template|
+-----------------+---------+---------+
|root.ln.wf01.wt01| false| t1|
|root.ln.wf02.wt02| false| null|
+-----------------+---------+---------+
Total line number = 2
It costs 0.001s

+-----------------+---------+---------+
| devices|isAligned| Template|
+-----------------+---------+---------+
|root.ln.wf01.wt01| false| t1|
+-----------------+---------+---------+
Total line number = 1
It costs 0.001s

+-----------------+---------+---------+
| devices|isAligned| Template|
+-----------------+---------+---------+
|root.ln.wf02.wt02| false| null|
+-----------------+---------+---------+
Total line number = 1
It costs 0.001s
```
`isAligned` indicates whether the timeseries under the device are aligned.
`isAligned` indicates whether the timeseries under the device are aligned, `Template` displays the name of the template activated on the device, with `null` indicating that no template has been activated.
To view devices' information with database, we can use `SHOW DEVICES WITH DATABASE` statement.
Expand All @@ -1143,23 +1172,23 @@ IoTDB> show devices root.ln.** with database
You can get results below:
```
+-------------------+-------------+---------+
| devices| database|isAligned|
+-------------------+-------------+---------+
| root.ln.wf01.wt01| root.ln| false|
| root.ln.wf02.wt02| root.ln| false|
|root.sgcc.wf03.wt01| root.sgcc| false|
| root.turbine.d1| root.turbine| false|
+-------------------+-------------+---------+
+-------------------+-------------+---------+---------+
| devices| database|isAligned| Template|
+-------------------+-------------+---------+---------+
| root.ln.wf01.wt01| root.ln| false| t1|
| root.ln.wf02.wt02| root.ln| false| null|
|root.sgcc.wf03.wt01| root.sgcc| false| null|
| root.turbine.d1| root.turbine| false| null|
+-------------------+-------------+---------+---------+
Total line number = 4
It costs 0.003s

+-----------------+-------------+---------+
| devices| database|isAligned|
+-----------------+-------------+---------+
|root.ln.wf01.wt01| root.ln| false|
|root.ln.wf02.wt02| root.ln| false|
+-----------------+-------------+---------+
+-----------------+-------------+---------+---------+
| devices| database|isAligned| Template|
+-----------------+-------------+---------+---------+
|root.ln.wf01.wt01| root.ln| false| t1|
|root.ln.wf02.wt02| root.ln| false| null|
+-----------------+-------------+---------+---------+
Total line number = 2
It costs 0.001s
```
Expand All @@ -1181,14 +1210,14 @@ IoTDB> count devices root.ln.**
You can get results below:
```
+-------------------+---------+
| devices|isAligned|
+-------------------+---------+
|root.sgcc.wf03.wt03| false|
| root.turbine.d1| false|
| root.ln.wf02.wt02| false|
| root.ln.wf01.wt01| false|
+-------------------+---------+
+-------------------+---------+---------+
| devices|isAligned| Template|
+-------------------+---------+---------+
|root.sgcc.wf03.wt03| false| null|
| root.turbine.d1| false| null|
| root.ln.wf02.wt02| false| null|
| root.ln.wf01.wt01| false| t1|
+-------------------+---------+---------+
Total line number = 4
It costs 0.024s

Expand Down
Loading

0 comments on commit 8f1423e

Please sign in to comment.